chroot

Bryan Dumm bdumm at bobby.bcpub.com
Sat Jan 6 17:20:18 PST 2001


Howdy,

> We have to be able to exit chroot while still running the backend. LFS
> require that and in general we should allow it.
>
> So instead of <chroot file="&LFS;"/> we should use (I prefer dir over file
> :) :
>
> 	<chroot dir="&LFS;">
> 		...
> 	</chroot>
>
> I did a _quick test_ of the subroutine below and I think it works.
>
> Tell me what you think.
>

Well, with 

perl -MFile::Basename alfs <profile>

and the following below, I have finished through chap6. I am 
doing the second test. Which I should have any errors to note, 
otherwise, we need more testing for chap4, chap5 and chap6.

sub tag_chroot {
                my $elt = shift;
                my $dir = $elt->att('dir');

                my $pid = fork;

                if ($pid == 0) {
                        print "chrooting to $dir\n";
                        chroot $dir || print "Unable to chroot to $dir\n";
                        foreach ($elt->children) {
                        	&call_handler($_);
                	}
                        exit;
                }

                wait;
         }

Bryan





More information about the alfs-discuss mailing list