On 2023-10-19, Dale <rdalek1...@gmail.com> wrote:

> That config kinda reminds me of the old grub.  A title line, location of
> kernel and then options.  Sounds easy enough.  The new grub config is
> almost impossible to config by hand.  They had to make a tool to do it. 
> That says a lot there.  ;-) 

Manually configuring Grub2 for a single OS is pretty trivial.  Here's
a typical grub.cfg file:

-----------------------------grub.cfg------------------------------------
timeout=10
default=0

root (hd0,0)

menuentry vmlinuz-5.15.135-gentoo {
linux /boot/vmlinuz-5.15.135-gentoo root=/dev/sda1
}

menuentry vmlinuz-5.10.76-gentoo-r1 {
  linux /boot/vmlinuz-5.10.76-gentoo-r1 root=/dev/sda1
}
------------------------------------------------------------------------

If you want to get fancy and use labels and UUIDs, it looks like this

------------------------------grub.cfg----------------------------------
search --no-floppy --label ROOT --set root

timeout=10
default=0

menuentry vmlinuz-5.15.135-gentoo {
linux /boot/vmlinuz-5.15.135-gentoo 
root=PARTUUID=fd96ac2d-5521-c043-9fdb-5067b48fb063
}

menuentry vmlinuz-5.15.127-gentoo {
linux /boot/vmlinuz-5.15.127-gentoo 
root=PARTUUID=fd96ac2d-5521-c043-9fdb-5067b48fb063
}
------------------------------------------------------------------------

Most distros add 2 or 3 layers of obsfucation on top of grub.cfg with
scripts upon scripts upon scripts that read a dozen or so config files
and automagically detect kernels and initrds and other OSes and then
generate a grub.cfg file containing many hundreds of lines of stuff.

If you just boot one OS with a "main" kernel and a "backup" kernel,
then all you need is what you see above.


Reply via email to