RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Emulating rootdir for non-root chroot(2) emulation.

From: Mark Hatle <mark.hatle@windriver.com>
Date: Fri 02 Nov 2007 - 20:42:12 CET
Message-ID: <472B7D94.1090007@windriver.com>
Two items from extensive use of "fakeroot" and "fakechroot" (from Debian).

fakeroot has some many gotcha's.. it in essence has to be built to match
the glibc that it will be overriding.  There are a million and one
overrides.  We've recently been fighting a problem where building
fakeroot for RHEL 4 won't work on Fedora 7.. because Fedora 7's glibc
has additional interfaces that didn't exist in RHEL 4..  so the problem
growns...

The fakechroot issues are quite as bad, but there are still some
problems.  The biggest of them is the behavior where a chroot runs and
the cwd doesn't change.. but PATHs and related now reference the new
root.  So this isn't trivial either.

My best recommendation at this time is to use the debian
fakeroot/fakechroot and document for people how to use them to achieve
what they want.  I'm not sure integrating them into RPM is worth the
effort.. (or more to the point the maintenance headaches!)

--Mark

Jeff Johnson wrote:
> Since the discussion this week is on --root, there are
> several other related issues and/or implementations.
> 
> The core feature request related to --root is how to
> permit non-root installs into home directories.
> 
> Since chroot(2) is root-only, that means (to me) that all
> system calls which mention a path will need wrapping
> in order to prefix an emulated chroot path.
> 
> It also means that the wrapped system calls must be used
> consistently throughout rpm.
> 
> The issue of prefixing current working directory to change
> a relative into an absolute path is a closely related problem
> (without the root-only showstopper flaw) and likely should be attempted
> at the same time.
> 
> There have also been suggestions about fakeroot emulation
> using rpmlib which are closely related.
> 
> FInally, there is the choice of names for the syscall wrappers.
> Currently, rpm is changing the first letter to uppercase, as in
> the Open() system wrapper. That's fine for rpm code itself, but will
> not permit applications to use an emulated chroot(2) as non-root.
> 
> So the eventual implementation of an emulated chroot(2) and
> fakeroot will have to replace the system calls in libc much like
> current implementations of fakeroot do.
> 
> Whether rpm should attempt chroot(2) emulation at all is an open question.
> 
> The RFE for the ability to be able to install using --root as non-root
> user has been around forever, and (imho) an implementation needs
> to be attempted somewhen.
> 
> 73 de Jeff
> 
> 
> 
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> Developer Communication List                        rpm-devel@rpm5.org
Received on Fri Nov 2 20:43:18 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.