On Tue, Oct 11, 2016 at 10:54 AM, M. J. Everitt <m.j.ever...@iee.org> wrote:
> On 11/10/16 15:42, Tom H wrote:
>> You can use exactly the same text in 40_grub that you'd use in
>> grub.cfg and have the latter generated.
> That's a useful tit-bit .. thanks!

You're welcome.

I doubt that the grub developers intended 40_custom to be the only
"/etc/grub.d/" file to be executed but it's practical for generating a
simple grub.cfg. This is what I use in a Debian VM:


cat <<EOF
# kernel
insmod gzio

# disk/partition
insmod part_msdos

# filesystem
insmod ext2

# /boot
search --no-floppy --fs-uuid --set=root e14bb0ac-4b43-41db-ac97-d67feaa7e291

# video
terminal_input console
terminal_output console

# menu
set default=0
set timeout=2

menuentry 'upstream 4.8.2' {
linux /boot/vmlinuz-4.8.2 root=UUID=e14bb0ac-4b43-41db-ac97-d67feaa7e291 ro

menuentry 'distro 4.6' {
linux /boot/vmlinuz-4.6.0-1-amd64
root=UUID=e14bb0ac-4b43-41db-ac97-d67feaa7e291 ro
initrd /boot/initrd.img-4.6.0-1-amd64

Reply via email to