This was already mentioned, but no one has to use grub-mkconfig. In fact the less talked about tool, grub-menulst2cfg, will take a grub legacy config and directly translate it to grub-2 and keep it the same minimalist config it always was.tld wrote:Disk space had nothing whatsoever to do with canning grub2 for me. As soon as I saw that whole kludgy generated config script crap, as compared to the simplicity of the grub1 (and syslinux) config files, I was just immediately put off. I couldn't care less how well it might work, or whether or not you can edit those generated scripts etc...I just don't want to (See NeddySeagoon's C. A. R. Hoare quote). To each their own, but for me you can keep that mess.
Tom
Code: Select all
# cat /boot/grub.0/grub.conf
# Boot automatically after 5 secs.
timeout 5
# By default, boot the first entry.
default 0
# Fallback to the second entry.
fallback 1
# Splash image to show behind grub.
splashimage=(hd0,0)/grub/splash.xpm.gz
title=Gentoo Linux (4.9.34-gentoo)
root (hd0,0)
kernel /vmlinuz-4.9.34-gentoo root=UUID=e392274b-edd4-4e44-975c-9c1fbce772d5 video=radeondrmfb:1024x768 net.ifnames=0 rootfstype=ext4
initrd /initramfs-4.9.34-gentoo.img
title=Gentoo Linux (4.9.16-gentoo)
root (hd0,0)
kernel /vmlinuz-4.9.16-gentoo root=UUID=e392274b-edd4-4e44-975c-9c1fbce772d5 video=radeondrmfb:1024x768 net.ifnames=0 rootfstype=ext4
initrd /initramfs-4.9.16-gentoo.img
title=Gentoo Linux (4.4.26-gentoo)
root (hd0,0)
kernel /kernel-genkernel-x86_64-4.4.26-gentoo root=/dev/sda3 video=radeondrmfb:1024x768 net.ifnames=0 rootfstype=ext4
# For booting Gentoo with the static rescue shell
title Gentoo (rescue shell)
root (hd0,0)
kernel /kernel-genkernel-x86_64-4.4.26-gentoo root=/dev/sda3 ramdisk=8192 init=/bin/bb dolvm net.ifnames=0
initrd /initramfs-genkernel-x86_64-4.4.26-gentooCode: Select all
# grub-menulst2cfg /boot/grub.0/grub.conf
# Boot automatically after 5 secs.
set timeout=5
# By default, boot the first entry.
set default='0'; if [ x"$default" = xsaved ]; then load_env; set default="$saved_entry"; fi
# Fallback to the second entry.
set fallback='1'
# Splash image to show behind grub.
# Unsupported legacy command: splashimage=(hd0,0)/grub/splash.xpm.gz
menuentry 'Gentoo Linux (4.9.34-gentoo)' {
set root='(hd0,1)'; set legacy_hdbias='0'
legacy_kernel '/vmlinuz-4.9.34-gentoo' '/vmlinuz-4.9.34-gentoo' 'root=UUID=e392274b-edd4-4e44-975c-9c1fbce772d5' 'video=radeondrmfb:1024x768' 'net.ifnames=0' 'rootfstype=ext4'
legacy_initrd '/initramfs-4.9.34-gentoo.img' '/initramfs-4.9.34-gentoo.img'
}
menuentry 'Gentoo Linux (4.9.16-gentoo)' {
set root='(hd0,1)'; set legacy_hdbias='0'
legacy_kernel '/vmlinuz-4.9.16-gentoo' '/vmlinuz-4.9.16-gentoo' 'root=UUID=e392274b-edd4-4e44-975c-9c1fbce772d5' 'video=radeondrmfb:1024x768' 'net.ifnames=0' 'rootfstype=ext4'
legacy_initrd '/initramfs-4.9.16-gentoo.img' '/initramfs-4.9.16-gentoo.img'
}
menuentry 'Gentoo Linux (4.4.26-gentoo)' {
set root='(hd0,1)'; set legacy_hdbias='0'
legacy_kernel '/kernel-genkernel-x86_64-4.4.26-gentoo' '/kernel-genkernel-x86_64-4.4.26-gentoo' 'root=/dev/sda3' 'video=radeondrmfb:1024x768' 'net.ifnames=0' 'rootfstype=ext4'
# For booting Gentoo with the static rescue shell
}
menuentry 'Gentoo (rescue shell)' {
set root='(hd0,1)'; set legacy_hdbias='0'
legacy_kernel '/kernel-genkernel-x86_64-4.4.26-gentoo' '/kernel-genkernel-x86_64-4.4.26-gentoo' 'root=/dev/sda3' 'ramdisk=8192' 'init=/bin/bb' 'dolvm' 'net.ifnames=0'
legacy_initrd '/initramfs-genkernel-x86_64-4.4.26-gentoo' '/initramfs-genkernel-x86_64-4.4.26-gentoo'
}Code: Select all
$ head -14 /boot/grub/custom.cfg
#timeout=5
#default=0
#menu_color_normal=white/blue
menuentry 'Gentoo GNU/Linux, with Linux 5.4.88-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.88-gentoo-advanced-5958fd45-723e-4d6b-9253-e74dada52d45' {
set root='hd0,msdos1'
linux /boot/kernel-5.4.88-gentoo root=/dev/sda1 ro rootfstype=ext4 net.ifnames=0
initrd /boot/early_ucode.cpio
}
menuentry 'Gentoo GNU/Linux, with Linux 5.4.88-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.88-gentoo-advanced-5958fd45-723e-4d6b-9253-e74dada52d45' {
set root='hd0,msdos1'
linux /boot/kernel-5.4.88-gentoo root=/dev/sda1 ro single rootfstype=ext4
initrd /boot/early_ucode.cpio
}

I am using it with GPT currently, and I have never tried EFI still.NeddySeagoon wrote:Chiitoo,
LILO won't work with EFI/GPT, so it's effectively dead.
Your system is haunted by the bootloader :)
I also boot via UEFI and want to add an information: grub2 starts a stub-kernel like every other normal kernel also.Jaglover wrote:As said, for each their own. My UEFI boot choice is EFi stub kernel. Motherboard firmware has built in menu which I can use to load a backup kernel if need arises. My kernel command line is built into kernel. Since my kernel names never change there is never any need to mess with efibootmgr. I like it simple.
Sure it does. Actually when I got my very first EFi board I knew nothing about EFI. But I made my install EFI-ready. ESP, stub kernel. But I booted it with syslinux. One day I read the excellent documentation by Roderick Smith and switched to EFI. At this point I had sort of "dual boot", when I chose CSM in BIOS it performed legacy boot, when I chose EFI it booted in EFI mode. All this with the same kernel, located in same place.pietinger wrote:I also boot via UEFI and want to add an information: grub2 starts a stub-kernel like every other normal kernel also.
Actually, only for UEFI systems. But, should I ever be required to use EFI again, I'm interested in rEFInd and glad to know about it. I have had to use EFI in the enterprise where it's been buggy and painful in each case. My personal systems are either old, or in the case of my main desktop PC, perfectly happy with traditional BIOS booting of MBR drives. The limitations of MBR partitioning are nowhere close to approaching my needs. I'm just added a "new" 2TB drive to my primary desktop (3rd spinning rust drive, this on an ST2000DM008-2FR1) using MBR partitioning should I ever need to use it as my boot drive.tld wrote:As I briefly mentioned above, especially for UEFI systems, I can't say enough about rEFInd (sys-boot/refind). ...
Tom
This is a common misconception. Disk table types rarely matters for boot installation types (UEFI vs CSM/BIOS) except for some really strange mainboard firmwares (certain ThinkPads for example).figueroa wrote:Actually, only for UEFI systems. But, should I ever be required to use EFI again, I'm interested in rEFInd and glad to know about it. I have had to use EFI in the enterprise where it's been buggy and painful in each case. My personal systems are either old, or in the case of my main desktop PC, perfectly happy with traditional BIOS booting of MBR drives. The limitations of MBR partitioning are nowhere close to approaching my needs. I'm just added a "new" 2TB drive to my primary desktop (3rd spinning rust drive, this on an ST2000DM008-2FR1) using MBR partitioning should I ever need to use it as my boot drive.tld wrote:As I briefly mentioned above, especially for UEFI systems, I can't say enough about rEFInd (sys-boot/refind). ...
Tom


Lmao .. hey, whatever works, works. Thanks all for the interesting tips, insights and/or reminders of all things booting gnu/Linux.figueroa wrote:
I realize that this is supposed to work, but with MBR and traditional BIOS boot loading no particular preparation is required beyond partitioning and formatting. I just don't need the grief. I'm happy to stick with BIOS/CSM until they pry it from my cold dead fingers.

Linus Torvalds wrote:
A computer is like air conditioning – it becomes useless when you open Windows.”