[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: chroot in /usr and initrd booting



On Sat, Jun 08, 2002 at 10:47:26PM +0200, Andreas Bombe wrote:
> On Fri, Jun 07, 2002 at 08:52:52AM -0500, Steve Langasek wrote:
> > On Fri, Jun 07, 2002 at 04:13:11AM +0200, Andreas Bombe wrote:
> > > I'm just going by the Documentation/initrd.txt in the Linux sources
> > > (I looked in 2.4.18 here).  pivot_root(1) also recommends a chroot.

> > > In any case much is implementation defined (like whether the shell's
> > > root is implicitly changed), so it's better to stick to the protocol.
> > > It might change, and a simple cd might not be sufficient anymore.

> > > Anyway, can you umount the initrd if you only did a 'cd /'?

> > Well, no, because the script itself, if still running, has files open on
> > that device: the executable and all the libraries it loads.  You have to
> > exec a different program/script on your main root in order to free up
> > the mount point, IIRC.

> Sure.  Um, let's word it a bit differently.  Is it possible to umount
> the initrd if /sbin/init in the new root is exec'd without chroot?

Yes, it is.

> Maybe it is, but the documentation gives no guarantees about that, so
> that behaviour is fair game for kernel changes.

I wish it would give such a guarantee.  The current behavior is far more
intuitive, IMHO. :)

Steve Langasek
postmodern programmer

Attachment: pgpQBOqo9Td9c.pgp
Description: PGP signature


Reply to: