Actually never mind, I'll put everything I can think of down for future reference.
Firstly, I recommend not taking breaks in the middle of building a package. Although make is supposed to be able to continue where it left off, I have had problems with this before. I advise letting the current package build to completion, install it, remove the source directory, and THEN shutdown the computer.
I also recommend noting the last program built, to avoid confusion (hehe don't ask).
I assume you are at least up to Chapter 5 before taking a break.
So. If you want to take a break somewhere in Chapter 5:
If you are using an existing distro as a host, then all you need to do is remount the lfs partition and login as the lfs user again. You can then start where you left off.
Code:
export LFS=/mnt/lfs
mount -v /dev/xxx $LFS
su - lfs
cd $LFS/sources
Then you can start on the next package. If you are using a different LFS variable then adjust as necessary. Likewise /dev/xxx should refer to the lfs partition.
I have assumed that only one partition is used for lfs. If you are using separate partitions for /usr or /var etc. then you need to mount them too as in chapter 2.4. Don't forget to mount swap each time, if it is necessary.
If you are using the LFS Live CD, then it's the same thing, except you need to recreate the lfs user and its environment. Using a live cd means the lfs user is not stored across reboots.You also need to recreate the /tools --> $LFS/tools symlink.
Code:
export LFS=/mnt/lfs
mkdir -pv $LFS
mount -v /dev/xxx $LFS
ln -sv $LFS/tools /
groupadd lfs
useradd -s /bin/bash -g lfs -m -k /dev/null lfs
passwd lfs
chown -v lfs $LFS/tools
chown -v lfs $LFS/sources
su - lfs
Set up the environment:
Code:
cat > ~/.bash_profile << "EOF"
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
EOF
cat > ~/.bashrc << "EOF"
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL PATH
EOF
source ~/.bash_profile
cd $LFS/sources
From there start on the next package.
--------
If you want to take a break somewhere after 6.6 "Creating Essential File and symlinks" (Taking a break between 5.31 and 6.6 is pointless, as it does not take very long.)
If you are using an existing distro as a host:
Remount the lfs partition and enter chroot.
Code:
export LFS=/mnt/lfs
mount -v /dev/xxx $LFS
mount --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" /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
cd /sources
Now you can start on the next package.
If you are using the LFS Live CD, then the only extra thing to do is recreate the lfs mount point.
Code:
export LFS=/mnt/lfs
mkdir -pv $LFS
mount -v /dev/xxx $LFS
mount --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" /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
cd /sources
Continue the build.
From chapter 6.60 onwards, a different chroot command is used, otherwise the procedure is no different in either case:
Code:
chroot "$LFS" /usr/bin/env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login
I think I covered everything. If I missed something, please tell me and I will update the post accordingly.