My goal was to get LFS 9.1 (
http://www.linuxfromscratch.org/lfs/...S-BOOK-9.1.pdf ) running with multi boot option in my personal laptop along with current ubuntu setup.
Finally I am able to get LFS booted, but have lots of questions on booting sequence. Let me explain the steps performed.
My Host laptop setup as follows:
Dell laptop ; it came with WIN 7; but later uninstalled WIN7 and installed Ubuntu 18 from a live USB stick;Single HDD of 1TB with 2 partitions.
In my host Ubuntu apart from loopX( 0 – 17) partitions the 2 HDD partitions are,
/dev/sda1 mounted on => /boot/efi
/dev/sda2 mounted on /
Boot mode : set to UEFI with secure ON ( this could be due to old windows installation ); it was also confirmed with command => ‘ls /sys/firmware/efi’ returning directory listing as available.
LFS build + configuration: Created a new partition on my HDD as /dev/sda3 for lfs root partition and followed the instructions as per the book, until chapter #7 end without any glitches.
Chapter #8 was a bit tough due to my limited knowledge on boot options. Before getting to chapter #8 instructions, I executed the “
mount –bind /boot /mnt/lfs/boot” as per chroot prerequsites. I am not clear is this really required for my setup?
LFS’s /etc/fstab looks as below: [ in the fstab, swap was ignored as
----------------------------------------------
root@srinivas-Inspiron-5567:/mnt/lfs/etc# cat fstab
# Begin /etc/fstab
# file system mount-point type options dump fsck
# order
/dev/sda3 / ext4 defaults 1 1
/dev/sda1 /boot/efi vfat defaults 0 1
/swapfile none swap sw 0 0
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpf mode=0755,nosuid 0 0
#End /etc/fstab
root@srinivas-Inspiron-5567:/mnt/lfs/etc#
----------------------
For the 8.3 section in the book, first “make defconfig” was issued , followed by “make menuconfig” with default options, make modules_install. Also copied the bZImage, System.map, config files to /boot folder. I could see CONFIG_EFI_STUB=y in my .config file, which confirms that kernel is enabled with UEFI.
As the mount bind is done for /boot with /mnt/lfs/boot, I see the files of my host ubuntu’s /boot inside chroot of LFS’s /boot. Is this ok?
8.4 section was complete overwhelming as I was not clear about Grub and UEFI. I executed the command "grub-install /dev/sda –target i386-pc", but it failed.
After few attempts of googling, I tried grub-update from my Ubuntu host. This has updated my ubuntu’s grub.cfg file with entries from lfs also. Fortunately I had taken backup of my original ubuntu’s grub.cfg.
Original-grub.cfg file:
-------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_IN
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=hidden
set timeout=0
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 0 ; then
set timeout=0
fi
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30,0; then
clear
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=1
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-7d15f6ce-fd74-42c7-a588-881a391afd77' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
linux /boot/vmlinuz-5.3.0-61-generic root=UUID=7d15f6ce-fd74-42c7-a588-881a391afd77 ro quiet splash $vt_handoff
initrd /boot/initrd.img-5.3.0-61-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-7d15f6ce-fd74-42c7-a588-881a391afd77' {
menuentry 'Ubuntu, with Linux 5.3.0-61-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.3.0-61-generic-advanced-7d15f6ce-fd74-42c7-a588-881a391afd77' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
echo 'Loading Linux 5.3.0-61-generic ...'
linux /boot/vmlinuz-5.3.0-61-generic root=UUID=7d15f6ce-fd74-42c7-a588-881a391afd77 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.3.0-61-generic
}
menuentry 'Ubuntu, with Linux 5.3.0-61-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.3.0-61-generic-recovery-7d15f6ce-fd74-42c7-a588-881a391afd77' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
echo 'Loading Linux 5.3.0-61-generic ...'
linux /boot/vmlinuz-5.3.0-61-generic root=UUID=7d15f6ce-fd74-42c7-a588-881a391afd77 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.3.0-61-generic
}
menuentry 'Ubuntu, with Linux 4.18.0-15-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.18.0-15-generic-advanced-7d15f6ce-fd74-42c7-a588-881a391afd77' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
echo 'Loading Linux 4.18.0-15-generic ...'
linux /boot/vmlinuz-4.18.0-15-generic root=UUID=7d15f6ce-fd74-42c7-a588-881a391afd77 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.18.0-15-generic
}
menuentry 'Ubuntu, with Linux 4.18.0-15-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.18.0-15-generic-recovery-7d15f6ce-fd74-42c7-a588-881a391afd77' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
echo 'Loading Linux 4.18.0-15-generic ...'
linux /boot/vmlinuz-4.18.0-15-generic root=UUID=7d15f6ce-fd74-42c7-a588-881a391afd77 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.18.0-15-generic
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
Updated grub.cfg file after update-grub command:
-------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_IN
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=hidden
set timeout=0
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 0 ; then
set timeout=0
fi
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30,0; then
clear
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=1
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-7d15f6ce-fd74-42c7-a588-881a391afd77' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=/dev/sda2 ro quiet splash $vt_handoff
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-7d15f6ce-fd74-42c7-a588-881a391afd77' {
menuentry 'Ubuntu, with Linux 5.5.3-lfs-9.1' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.5.3-lfs-9.1-advanced-7d15f6ce-fd74-42c7-a588-881a391afd77' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
echo 'Loading Linux 5.5.3-lfs-9.1 ...'
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=/dev/sda2 ro quiet splash $vt_handoff
}
menuentry 'Ubuntu, with Linux 5.5.3-lfs-9.1 (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.5.3-lfs-9.1-recovery-7d15f6ce-fd74-42c7-a588-881a391afd77' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
echo 'Loading Linux 5.5.3-lfs-9.1 ...'
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=/dev/sda2 ro recovery nomodeset
}
menuentry 'Ubuntu, with Linux 5.3.0-61-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.3.0-61-generic-advanced-7d15f6ce-fd74-42c7-a588-881a391afd77' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
echo 'Loading Linux 5.3.0-61-generic ...'
linux /boot/vmlinuz-5.3.0-61-generic root=UUID=7d15f6ce-fd74-42c7-a588-881a391afd77 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.3.0-61-generic
}
menuentry 'Ubuntu, with Linux 5.3.0-61-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.3.0-61-generic-recovery-7d15f6ce-fd74-42c7-a588-881a391afd77' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
echo 'Loading Linux 5.3.0-61-generic ...'
linux /boot/vmlinuz-5.3.0-61-generic root=UUID=7d15f6ce-fd74-42c7-a588-881a391afd77 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.3.0-61-generic
}
menuentry 'Ubuntu, with Linux 4.18.0-15-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.18.0-15-generic-advanced-7d15f6ce-fd74-42c7-a588-881a391afd77' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
echo 'Loading Linux 4.18.0-15-generic ...'
linux /boot/vmlinuz-4.18.0-15-generic root=UUID=7d15f6ce-fd74-42c7-a588-881a391afd77 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.18.0-15-generic
}
menuentry 'Ubuntu, with Linux 4.18.0-15-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.18.0-15-generic-recovery-7d15f6ce-fd74-42c7-a588-881a391afd77' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7d15f6ce-fd74-42c7-a588-881a391afd77
else
search --no-floppy --fs-uuid --set=root 7d15f6ce-fd74-42c7-a588-881a391afd77
fi
echo 'Loading Linux 4.18.0-15-generic ...'
linux /boot/vmlinuz-4.18.0-15-generic root=UUID=7d15f6ce-fd74-42c7-a588-881a391afd77 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.18.0-15-generic
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Linux From Scratch (9.1) (on /dev/sda3)' --class linuxfromscratch --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-90a0119c-ef0a-4f33-a9da-ddcb69bb8466' {
insmod part_gpt
insmod ext2
set root='hd0,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 90a0119c-ef0a-4f33-a9da-ddcb69bb8466
else
search --no-floppy --fs-uuid --set=root 90a0119c-ef0a-4f33-a9da-ddcb69bb8466
fi
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=/dev/sda3
}
submenu 'Advanced options for Linux From Scratch (9.1) (on /dev/sda3)' $menuentry_id_option 'osprober-gnulinux-advanced-90a0119c-ef0a-4f33-a9da-ddcb69bb8466' {
menuentry 'Linux From Scratch (9.1) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-5.5.3-lfs-9.1--90a0119c-ef0a-4f33-a9da-ddcb69bb8466' {
insmod part_gpt
insmod ext2
set root='hd0,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 90a0119c-ef0a-4f33-a9da-ddcb69bb8466
else
search --no-floppy --fs-uuid --set=root 90a0119c-ef0a-4f33-a9da-ddcb69bb8466
fi
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=/dev/sda3
}
menuentry 'Linux From Scratch (9.1) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-5.5.3-lfs-9.1--90a0119c-ef0a-4f33-a9da-ddcb69bb8466' {
insmod part_gpt
insmod ext2
set root='hd0,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 90a0119c-ef0a-4f33-a9da-ddcb69bb8466
else
search --no-floppy --fs-uuid --set=root 90a0119c-ef0a-4f33-a9da-ddcb69bb8466
fi
linux /vmlinuz-5.5.3-lfs-9.1 root=/dev/sda3
}
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
set timeout=10
fi
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
After reboot I am able to see grub menu options for multi boot and able to choose LFS and it boots as expected with root. That’s cool, but now i am not excited due to below question.
The big question is that, I could not understand how the grub-eufi worked on “update-grub’ command. Please some one help to me to understand the basics here and how it worked in my laptop.
Note:
- My LFS doesn’t shutdown properly when root#shutdown –f now’ command is given. What is missing here?