Re: chroot in /usr and initrd booting
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?
Maybe it is, but the documentation gives no guarantees about that, so
that behaviour is fair game for kernel changes. It is imaginable that
the exec'd init inherits the root location from the script, which would
be in the initrd. At least if the script's root is still in the initrd,
which is implementation defined after pivot_root.
Andreas Bombe <firstname.lastname@example.org> DSA key 0x04880A44
To UNSUBSCRIBE, email to email@example.com
with a subject of "unsubscribe". Trouble? Contact firstname.lastname@example.org