On 2/4/20 11:16 AM, Tom Armistead via lfs-dev wrote:
Having built LFS a number of times, the part that I still sometimes have
difficulty with is getting the bootloader properly setup to boot the
newly built LFS system.
I agree that this can be a bit tricky. When I have students do the
initial install (using Debian) to a raw disk I have them create a
separate /boot partition. Then in Chapter 8, but in the host, not chroot,
mount --bind /boot /mnt/lfs/boot
Then I have them go to /boot/grub (at this point it can be on the host
or in chroot) and copy grub.cfg to grub.cfg.sav. (Any failures can be
fixed by booting to a rescue system and just restoring grub.cfg from
the saved file.)
Then you can start hacking grub.cfg. Typically I can cut it down from
over 200 lines to less than 20. Students seem to be impressed about how
much unnecessary stuff is in the default grub.cfg file.
Then at the bottom, just add:
menuentry "GNU/Linux, Linux 5.5.1-lfs-SVN-20200201" {
linux /vmlinuz-5.5.1-lfs-SVN-20200201 root=/dev/sda2 ro
Of course the filename changes with the LFS version and the root
directory will change according to where /mnt/lfs is mounted. It gets a
lot more difficult if the host is using lvm or btrfs. Personally I
never see any advantage for those filesystems for /. They should be
reserved for /home or possibly other custom mount points.
SecondĀ place to that, kernel configuration can be a bit tricky.
Generally 'make defconfig' will work well enough for a base LFS install.
Of course there are a fair number of pages in BLFS that may require
rebuilding the kernel, but that is a part of the learning process.
-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page