Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 8553  / 3 Years ago, sun, may 2, 2021, 10:03:03

Every time grub updates, due to normal updates, I lose some icons on the grub menu. I have to manually edit the /boot/grub/grub.cfg file and add '--class ubuntu' (or whatever) to lines that no longer have a '--class' entry and hence display no icon.



Where, exactly, does grub get the instruction to write a '--class' entry into the grub.cfg file ? I have looked at templates but can't see anything obvious.



I have read a few online grub guides but I'm finding it heavy going so thought I would ask for help !



(Ubuntu 14.04 LTS)


More From » grub2

 Answers
5

For anybody who is interested, I have figured this out. The folder to look in is



/etc/grub.d/


There are a collection of files in here that are the templates for the generation of the file



/boot/grub/grub.cfg


The files I am interested in are



10_linux*
30_uefi-firmware*


The 10_linux file is for linux operating system entries, the 30_uefi-firmware file is for the eufi setup entry.



To generate an icon for the submenu entry, I edited the corresponding line. The original line was this



echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' $menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"


I added the CLASS option so that it now looks like this



echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' ${CLASS} $menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"


To add an icon for the System Setup entry i.e. the uefi settings (bios) I edited 30_uefi-firmware



I added a class entry, immediately after the export entries



CLASS="--class recovery"


and I added the CLASS option in the menuentry line



menuentry '$LABEL' ${CLASS} $menuentry_id_option 'uefi-firmware'


The class entry has to match an icon that is in the themes icon folder.



/boot/grub/themes/<theme name>/icons


I have used the 'recovery' class/icon, which shows a toolbox icon. I will look for something a little more suitable when I get a moment, place the icon in the icons folder and change the class entry accordingly.


[#23647] Monday, May 3, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
gliroopy

Total Points: 290
Total Questions: 115
Total Answers: 114

Location: Egypt
Member since Tue, May 3, 2022
2 Years ago
;