diff --git a/scripts/chapter10/10.4-grub.sh b/scripts/chapter10/10.4-grub.sh new file mode 100644 index 0000000..77a421d --- /dev/null +++ b/scripts/chapter10/10.4-grub.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Exit this line +# grub-install /dev/sda + +cat > /boot/grub/grub.cfg << "EOF" +# Begin /boot/grub/grub.cfg +set default=0 +set timeout=5 + +insmod ext2 +set root=(hd0,2) + +menuentry "GNU/Linux, Linux 5.19.2-lfs-11.2" { + linux /boot/vmlinuz-5.19.2-lfs-11.2 root=/dev/sda2 ro +} +EOF + diff --git a/scripts/main.sh b/scripts/main.sh index 18e9057..7435049 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -1572,3 +1572,15 @@ then stop_script "chapter10/10.3-kernel.sh" fi +# Chapter 10.4 +# ============ +echo "Installng grub" +su -c "bash $SCRIPT/chapter10/10.4-grub.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter10/10.4-grub.sh" +fi +