7.1. Making the USB live system bootable

This chapter assume you use grub2 for your LFS.

Install the GRUB files into /boot/grub, assuming you are installing LFS on sda[x]:

mount --bind /dev $LFSMOUNT/dev
mount --bind /sys $LFSMOUNT/sys
mount --bind /proc $LFSMOUNT/proc
chroot $LFSMOUNT
grub-install /dev/sda
exit
umount $LFSMOUNT/proc
umount $LFSMOUNT/sys
umount $LFSMOUNT/dev

Issue the following to create the file grub.cfg:

cd $LFSMOUNT
echo 'menuentry "LFS" {' > boot/grub/grub.cfg
echo "   search -n -l $LFSLIVE -s" >> boot/grub/grub.cfg
echo "        linux   /boot/lfskernel root=LABEL=$LFSLIVE quiet rootdelay=10" >> boot/grub/grub.cfg
echo "        initrd  /boot/initrd.gz" >> boot/grub/grub.cfg
echo "}" >> boot/grub/grub.cfg

Rename kernel, according to menu.lst:

mv -v boot/lfskernel-<version> boot/lfskernel

Where <version> is your kernel version

Enjoy the livekey !