How do you edit the grub menu by hand?  [Solved]

Message
Author
User avatar
siamhie
Global Moderator
Posts: 3215
Joined: Fri Aug 20, 2021 5:45 pm

Re: How do you edit the grub menu by hand?

#31 Post 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.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
siamhie
Global Moderator
Posts: 3215
Joined: Fri Aug 20, 2021 5:45 pm

Re: How do you edit the grub menu by hand?

#32 Post 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.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
fehlix
Developer
Posts: 12577
Joined: Wed Apr 11, 2018 5:09 pm

Re: How do you edit the grub menu by hand?

#33 Post 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.

User avatar
siamhie
Global Moderator
Posts: 3215
Joined: Fri Aug 20, 2021 5:45 pm

Re: How do you edit the grub menu by hand?

#34 Post 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. :biggrin:
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
siamhie
Global Moderator
Posts: 3215
Joined: Fri Aug 20, 2021 5:45 pm

Re: How do you edit the grub menu by hand?

#35 Post 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
You do not have the required permissions to view the files attached to this post.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
asqwerth
Developer
Posts: 7752
Joined: Sun May 27, 2007 5:37 am

Re: How do you edit the grub menu by hand?

#36 Post by asqwerth »

Nice work!
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
siamhie
Global Moderator
Posts: 3215
Joined: Fri Aug 20, 2021 5:45 pm

Re: How do you edit the grub menu by hand?

#37 Post by siamhie »

asqwerth wrote: Thu Dec 05, 2024 10:31 amNice work!

Thanks @asqwerth :number1:
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. :rofl:
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

Post Reply

Return to “Software / Configuration”