Wednesday, June 16, 2010

Chapter 7 Commands to run before beginning.

I hope the laborious part is over. It just occurred to me that I should make another backup.
 As root,
export LFS=/media/lfs  
mount -v -t ext3 /dev/sdb6 $LFS (see note below)

The order of mount and chroot may or may not be important. I still do not understand what happens to LFS after chroot.

mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts
mount -vt tmpfs shm $LFS/dev/shm
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
 
chroot "$LFS" /usr/bin/env -i \
    HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
    /bin/bash --login
 

Note, if you get the error,
chroot: cannot run command `/usr/bin/env': No such file or directory
It just means that you forgot to mount the partition. 
 
Relevent output of the command mount, executed before the chroot
/dev/sdb6 on /media/lfs type ext3 (rw) 
/dev on /media/lfs/dev type none (rw,bind)
devpts on /media/lfs/dev/pts type devpts (rw)
shm on /media/lfs/dev/shm type tmpfs (rw)
proc on /media/lfs/proc type proc (rw)
sysfs on /media/lfs/sys type sysfs (rw)

where $LFS is /media/lfs

After chroot,  the output of the command mount is:
root:/# mount
sysfs on /sys type sysfs (rw)
proc on /proc type proc (rw)
/dev on /dev type none (rw,bind)
I am assuming that there is a reason for which the devpts and shm are not in the list. Maybe they are a subdirectory. Chapter 6.2.2 in the manual describes this and I do not really understand it so I will move on.





No comments:

Post a Comment