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.
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.