bug-hurd
[Top][All Lists]
Advanced

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

settrans --chroot


From: Roland McGrath
Subject: settrans --chroot
Date: Sat, 4 May 2002 18:58:59 -0400 (EDT)

I've added a new mode of operation to the settrans command, in the form of
the new option --chroot.  I have not tested this code, so please try it out
for me.

settrans --chroot is a way to start a filesystem translator that need not
be attached to any parent filesystem node as an active translator,
but rather is accessible only as the root filesystem of a new subprocess.
For example:

        settrans --chroot bash -i -- / /hurd/fakeroot

This executes "bash -i" (the settrans process calls execvp).  But first,
it starts an active translator as `settrans -a / /hurd/fakeroot'
would--but does not attach the translator to any node.  The file name
argument (/ here) is used only to give the underlying node port to the
translator.  The active translator control port is used only by settrans
itself to get a root directory port, for which it supplies a null .. port.
It then works like "chroot X bash -i" where X is the (nameless) root
directory of the new active translator.

Another use would be to try out a root filesystem image.
You could do this two ways:

        settrans -ca /tmp/myfs /hurd/ext2fs my.img
        chroot /tmp/myfs sh blah blah
        settrans -g /tmp/fs
        rm -f /tmp/fs

or, now you can do:

        settrans --chroot sh blah blah -- / /hurd/ext2fs my.img

(The ext2fs translator ignores its underlying node,
but you have to give it something.)


I suspect that presently if you use this (assuming settrans works right),
that the filesystem process will stick around after the command finishes
and you might have to kill it.  If that happens, we should clean up the
filesystem code so that it gracefully notices when there are live no
control ports and no live node ports, and exits. 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]