RPM Community Forums

Mailing List Message of <rpm-users>

Re: Question about "rpmbuild --root"

From: Jeff Johnson <n3npq@mac.com>
Date: Mon 14 Feb 2011 - 14:41:42 CET
Message-id: <F3FEFEAA-480A-4AC4-82A1-86DF7593A8A4@mac.com>

On Feb 14, 2011, at 8:31 AM, Eric MSP Veith wrote:

> Am Montag, 14. Februar 2011, 13:26:32 schrieb Jeff Johnson:
>> Yes but ... rpmbuild --root is not doing chroot(2), never has done
>> chroot(2), and cannot do chroot(2) unless uid == 0.
> 
> The latter one I solved by calling "sudo rpmbuild". 
> 

So no figger where rpmbuild is supposed to read its configuration from.
That's a bit harder than using sudo to get uid == 0.

>> It in the man page because someone insisted:
>> 	Its a CLI option so it MUST be in the man page.
>> and it was easier to oblige than explain.
> 
> What's the difference between '--root' and '--dbpath' then?
> 

Depends on context.

Traditionally, RPM implicitly added --root to --dbpath when opening
an rpmdb and expected the user to "know" when to add the chroot
prefix to the --dbpath argument for non-root execution.

But PLD wanted --rebuilddb --root instead of --rebuildb --dbpath
(where one had to manually insert the root prefix in the --dbpath argument).

So --root and --dbpath behavior was changed.

The change has broken 4-5 times over the years and is way too complex
and undocumented and more.

>> File path's get implicitly prefixed when chroot(2) is called.
>> 
>> There's harder issues, like readong configuration (from inside or outside
>> the chroot?) and finding the rpmdb (inside or outside?) and writing *.rpm
>> output (inside or outside), but otherwise yes.
> 
> I can answer these questions in case of what I'm planning to do. I mainly 
> don't want to populate the buildroot with all dependencies of RPM, that's all. 
> But I can live with copying macro files and other config data.
> 
> Ok, off trying... :-)
> 

Good luck!

FYI: --root takes a /string which is used to construct a command that looks like
	rsh -c "chroot /string ..."
that isn't what anyone is expecting but is exactly what was intended.

73 de jeff



  • application/pkcs7-signature attachment: smime.p7s
Received on Mon Feb 14 14:42:23 2011
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.