Custom grub2 theme gets deleted from /boot/grub2/themes/ on every update

As the title says, I’ve put a custom grub2 theme in /boot/grub2/themes/ and changed it in the Bootloader settings accordingly. However every time OpenSuse runs a bigger update the directory gets purged and grub falls back to the default theme that came with the OS. Unfortunately I can’t figure out what process exactly overwrites it as it happens during the boot upgrade phase, neither what exact process is responsible for changing the theme back in /etc/default/grub.

I’ve found this 8 year old thread talking about this exact issue (unfortunately very unfriendly) but without solution. I lack the abilities to find and fix the issue myself. :frowning:

Anyone knowing a solution?

Just wondering: Did you try to put the theme in a folder that is not owned by any bootloader related package? Like create a folder in /etc/default/ called grub-theme, then adapt it and see what happens?

/boot/grub2/themes directory is deleted by grub2-branding-openSUSE package

my $grub2_theme_dir = "/boot/grub2/themes";
...
system "rm -rf $grub2_theme_dir";

As long as you are going to use custom theme anyway, install grub2-branding-upstream. It is less intrusive and should not delete your custom theme directory.

You may consider opening bug report for grub2-branding-openSUSE.

OTOH you do not really need to do it. Themes can be loaded from any directory as long as it is accessible by grub during boot.

There is already one (opened 2021-10-03).

Thank you all. :slight_smile: So it seems the cause of the problem was discovered 2.5 years ago but never fixed?

I’ll try removing the grub branding package, hopefully this will fix the issue.

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