Re: [PATCH] root-hopping for pre-2.3.41-3

From: H. Peter Anvin (hpa@transmeta.com)
Date: Tue Jan 25 2000 - 18:16:12 EST


Matthew Kirkwood wrote:
>
> On Tue, 25 Jan 2000, H. Peter Anvin wrote:
>
> > > > pivot_root("new_root", "old_root");
> > >
> > > ... with an implicit "chroot everybody on / to /new_root". That would
> > > solve a few problems, yes. I'll give it a try.
> >
> > Right... everyone on the old / move to the new /, although I guess
> > that's technically not 100% necessary.
>
> Even possible?
>
> Where does someone in /boot end up when there is no /new_root/boot?
>

I think we were talking about the root, not the cwd. However, the same
issues apply. I think the cleanest is to not do anything, although it
may have some serious problems.

For the normal case where you'd have no processes except a pseudo-init
running, you'd just do chdir("/"); chroot("/"); before you
execl("/sbin/init", "init", 0); but I don't know if there are other
applications in which it would be an issue.

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:15 EST