Customize Names in Grub menu

I now have three Manjaro installations on my system.

  • Manjaro KDE (my daily driver, in charge of the bootloader)
  • Manjaro minimal Xfce
  • Manjaro minimal Gnome (to try Niri)

In the grub menu they are all called “Manjaro Linux”, apart from the main installation with a note which device is used.

To make it easier to distinguish the installations, I changed the value of GRUB_DISTRIBUTOR="Manjaro" to GRUB_DISTRIBUTOR="Manjaro-Xfce" and GRUB_DISTRIBUTOR="Manjaro-Gnome" in the respective /etc/default/grub and updated grub on all installations.

In the submenus the names are applied correctly, but not on the main level.
As far as I understood the grub-scripts, the name of the main level comes from the output of os-prober

$ sudo os-prober
/dev/sda1:Windows 10:Windows:chain
/dev/sdc3:Manjaro Linux (23.1.4):ManjaroLinux:linux
/dev/sdc4:Manjaro Linux (23.1.4):ManjaroLinux1:linux

the names in the submenus from linux-boot-prober

$ sudo linux-boot-prober /dev/sdc3 
/dev/sdc3:/dev/sdc3:Manjaro-Gnome Linux:/boot/vmlinuz-6.6-x86_64:/boot/intel-ucode.img /boot/initramfs-6.6-x86_64.img:root=UUID=ba16c9d4-46e2-475f-acfb-453275b5b42a rw quiet udev.log_priority=3 nvidia_drm.modeset=1
/dev/sdc3:/dev/sdc3:Manjaro-Gnome Linux (Kernel 6.6.26-1-MANJARO x64):/boot/vmlinuz-6.6-x86_64:/boot/intel-ucode.img /boot/initramfs-6.6-x86_64.img:root=UUID=ba16c9d4-46e2-475f-acfb-453275b5b42a rw quiet udev.log_priority=3 nvidia_drm.modeset=1
/dev/sdc3:/dev/sdc3:Manjaro-Gnome Linux (Kernel 6.6.26-1-MANJARO x64 - fallback initramfs):/boot/vmlinuz-6.6-x86_64:/boot/initramfs-6.6-x86_64-fallback.img:root=UUID=ba16c9d4-46e2-475f-acfb-453275b5b42a rw quiet udev.log_priority=3 nvidia_drm.modeset=1
/dev/sdc3:/dev/sdc3:Memory Tester (memtest86+):/boot/memtest86+/memtest.bin::
/dev/sdc3:/dev/sdc3:Memory Tester (memtest86+):/boot/memtest86+/memtest.efi::

$ sudo linux-boot-prober /dev/sdc4    
/dev/sdc4:/dev/sdc4:Manjaro-Xfce Linux:/boot/vmlinuz-6.8-x86_64:/boot/intel-ucode.img /boot/initramfs-6.8-x86_64.img:root=UUID=afafb774-fda7-444d-b5f3-8ded4befe91c rw quiet udev.log_priority=3 sysrq_always_enabled=1 nowatchdog
/dev/sdc4:/dev/sdc4:Manjaro-Xfce Linux (Kernel 6.8.8-1-MANJARO x64):/boot/vmlinuz-6.8-x86_64:/boot/intel-ucode.img /boot/initramfs-6.8-x86_64.img:root=UUID=afafb774-fda7-444d-b5f3-8ded4befe91c rw quiet udev.log_priority=3 sysrq_always_enabled=1 nowatchdog
/dev/sdc4:/dev/sdc4:Manjaro-Xfce Linux (Kernel 6.8.8-1-MANJARO x64 - fallback initramfs):/boot/vmlinuz-6.8-x86_64:/boot/initramfs-6.8-x86_64-fallback.img:root=UUID=afafb774-fda7-444d-b5f3-8ded4befe91c rw quiet udev.log_priority=3 sysrq_always_enabled=1 nowatchdog
/dev/sdc4:/dev/sdc4:Memory Tester (memtest86+):/boot/memtest86+/memtest.bin::
/dev/sdc4:/dev/sdc4:Memory Tester (memtest86+):/boot/memtest86+/memtest.efi::

is there a sustainable clean way in grub to get the customized names on the main level which withstands updates, changing the kernel version, etc?

1 Like

That’s what /etc/grub.d/ is for. Create your own bash script or modify the /etc/grub.d/40_custom script.

More information can be found in the GRUB manual. :point_down:

2 Likes

I had feared this answer, but hoped for a switch/option kinda… :wink:

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.