3.83. etc-grub-11.1

The setting implies the main bootable disk and partition are called /dev/sda1.

#!/bin/sh
# Copyright © 1999-2022 Gerard Beekmans
# Copyright © 2017-2022 Random Crew
# Distributed under the terms of MIT License.

Configuration

src_config()
{
    return
}

Compilation

src_compile()
{
    return
}

Installation

src_install()
{
    mkdir -p ${D}/boot/grub/
    cat > ${D}/boot/grub/grub.cfg << "EOF"
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5

insmod ext2
set root=(hd0,2)

menuentry "Linux 5.16.9-lfs-${LFS_VERSION}" {
        linux   /boot/vmlinuz-5.16.9-lfs-${LFS_VERSION} root=/dev/sda1 ro
}
EOF

}

Build code

etc-grub.build

Other files

meta.txt
text

Links

url.lfs: https://linuxfromscratch.org/lfs/view/11.1/chapter10/grub.html