[lfs-support] chroot script

Garrett Gaston garrett85 at hotmail.com
Thu Oct 4 12:05:29 PDT 2012

I've written the script below for starting the exiting the chroot environment for starting and stopping the LFS project. I'M concerned about the logout and umount commands. I need the script to do all the unmounts upon exiting or logging out. I'M afraid what I've written here will simply chroot and then immediately logout via the "logout" line in the script rather than doing the umounts when I personally logout myself. Have I written this right or what changes do I need to make?

export LFS=/mnt/lfs                  &&mount -v --bind /dev $LFS/dev        &&mount -vt devpts devpts $LFS/dev/pts &&mount -vt proc proc $LFS/proc        &&mount -vt sysfs sysfs $LFS/sys       &&
chroot "$LFS" /tools/bin/env -i \    HOME=/root                  \    TERM="$TERM"                \    PS1='\u:\w\$ '              \    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \    /tools/bin/bash --login +h
logoutumount -v $LFS/dev/ptsumount -v $LFS/dev/shmumount -v $LFS/devumount -v $LFS/procumount -v $LFS/sysumount -v $LFSumount -v $LFS/usrumount -v $LFS/homeumount -v $LFS 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-support/attachments/20121004/2f94f669/attachment.html>

More information about the lfs-support mailing list