Page 4 of 4
Re: How do you edit the grub menu by hand?
Posted: Wed Dec 04, 2024 5:17 pm
by siamhie
fehlix wrote: Wed Dec 04, 2024 4:45 pm
OK, thanks.
The picture got now a bit clearer.
So what you want, is disable generation of grub menu entries, and have your own. OK fine.
And you would need manually adjust the grub menu after every kernel upgrade, or removal
Probably one way to go, but that not what I would recommend in general to do.
Anyway, good luck.
My days of chasing/experimenting with the latest kernels are done. I'm sticking with the LTS kernels (Xanmod-6.6 and Debian-6.1).
If either of those kernels have an update, I can always re-enable the executable flag for 10_linux and 30_os-prober and copy the
entry found in the grub.cfg file and apply it to the 09_custom file.
I'll go ahead and mark what I did in post #28 as solved.
Re: How do you edit the grub menu by hand?
Posted: Wed Dec 04, 2024 5:29 pm
by siamhie
fehlix wrote: Wed Dec 04, 2024 5:16 pm
To avoid a potential issue, with booting into latest installed kernel,
e.g. just after kernel upgrade, and you missed manually adjusting the grub menu:
You may try this menuentry, potentially to be put on top,
e.g. as an example for fluxbox:
Code: Select all
menuentry 'Fluxbox latest kernel installed' --class fluxbox --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-latest-installed-init-systemd-20cfcd8f-3e81-49d4-a5f4-35784be52c3f' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 20cfcd8f-3e81-49d4-a5f4-35784be52c3f
echo 'Loading Linux latest installed ...'
linux /vmlinuz root=UUID=20cfcd8f-3e81-49d4-a5f4-35784be52c3f ro quiet init=/lib/systemd/systemd
echo 'Loading initial ramdisk ...'
initrd /initrd.img
}
The difference is , latest kernel installation creates alway two symlinks /vmlinuz and /initrd.img:
E.g in the example above as:
Code: Select all
/vmlinux -> boot/vmlinuz-6.6.63-x64v3-xanmod1
/initrd.img -> boot/initrd.img-6.6.63-x64v3-xanmod1
As those symlinks are relative symlinks, you can use it as booting into latest installed.
Similar would be, /vmlinuz.old and /initrd.img.old pointing to the one which was previous the latest.
Seems you have responded before I could publish post #31.
Re: How do you edit the grub menu by hand?
Posted: Wed Dec 04, 2024 5:51 pm
by fehlix
siamhie wrote: Wed Dec 04, 2024 5:29 pm
Seems you have responded before I could publish post #31.
So at least you now have a fallback in case you missed to adjust the grub menu manually.
Re: How do you edit the grub menu by hand?
Posted: Wed Dec 04, 2024 9:05 pm
by siamhie
fehlix wrote: Wed Dec 04, 2024 5:51 pm
siamhie wrote: Wed Dec 04, 2024 5:29 pm
Seems you have responded before I could publish post #31.
So at least you now have a fallback in case you missed to adjust the grub menu manually.
Yes. Always have a backup and then have a backup for that backup.

Re: How do you edit the grub menu by hand?
Posted: Thu Dec 05, 2024 10:26 am
by siamhie
@fehlix Wanted to give you an update on adding kernels with my setup. What a breeze.
I re-enabled the executable flag for the /etc/grub.d/10_linux file.
Installed the Liquorix kernel from the repos. Let the installation update grub.
Copy the (systemd) Liquorix entry from grub.cfg to my /etc/grub.d/09_custom file.
Disable the executable flag for the /etc/grub.d/10_linux file.
Ran sudo update-grub.
mxbo.png
Re: How do you edit the grub menu by hand?
Posted: Thu Dec 05, 2024 10:31 am
by asqwerth
Nice work!
Re: How do you edit the grub menu by hand?
Posted: Thu Dec 05, 2024 10:35 am
by siamhie
asqwerth wrote: Thu Dec 05, 2024 10:31 amNice work!
Thanks
@asqwerth
Between you and
@fehlix bouncing ideas around, I think I have a handle now on customizing grub.
I still miss the simple days of LILO.
