10.4. Set Up the Boot Process

10.4.1. Introduction

Configuring the bootloaders incorrectly can render your system inoperable without an alternate boot device such as a CD-ROM or bootable USB drive. And, the booting process of MIPS boards is not standardized like the PC systems. So it's recommended to modify your current boot loader, e.g. GRUB2, or Pmon, to boot up the LFS system.

Ensure that an emergency boot disk is ready to rescue the computer if the computer becomes unusable (un-bootable). For example, a Live CD of Live USB of your host distribution.

10.4.2. Creating the GRUB Configuration File

For example, on a Loongson 3A4000 board whose official distribution boots with an UEFI-like firmware and GRUB2, create /boot/efi/EFI/BOOT/custom.cfg, to add the entry for LFS into GRUB boot menu:

cat > /boot/efi/EFI/BOOT/custom.cfg << "EOF"
# Begin custom.cfg
menuentry "GNU/Linux, Linux 5.10.17-lfs-10.1-mips64el" {
        linux   /boot/vmlinuz-5.10.17-lfs-10.1-mips64el root=/dev/sda2 ro
}
EOF
[Note]

Note

From GRUB's perspective, the kernel files are relative to the partition used. If you used a separate /boot partition, remove /boot from the above linux line. You will also need to change the set root line to point to the boot partition.