0

I recently installed fedora, and I wanted to add a background to GRUB, so I modified my /etc/default/grub to look like this:

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="gfxterm" #<----- changed to gfxterm
GRUB_CMDLINE_LINUX="rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

# added by me:
GRUB_COLOR_NORMAL="light-gray/black"
GRUB_BACKGROUND="/boot/efi/eclipse.png"
GRUB_GFXMODE="1920x1080"

It says "Found background image" when calling grub2-mkconfig and the new grub.cfg also contains the lines for loading the image.

However GRUB still won't display the PNG file.

I know that it only works if the image is exported the right way, but this exact image file worked perfectly in my old GRUB on arch linux (which was normal GRUB, not GRUB2).

After some investigation, I manually edited my grub.cfg to add the following debugging lines:

# ...

search --no-floppy --fs-uuid --set=root 063E-0BE5
insmod png
echo "Hello world"
ls /
sleep 5
background_image -m stretch /eclipse.png
echo "background image called"
sleep 5

# ...

The output of GRUB then looks like this:

Hello world!
efi/ System Volume Information/ (a bunch of other files...) eclipse.png (...)
error: ../../grub-core/script/function.c:119:can't find command 'background_image'.
background image called

So somehow, it looks like the background_image command is missing.

In some corner of the internet I found the suggestion to manually insmod gfxterm_background, but then GRUB also prints the following error:

error: ../../grub-core/fs/fsheip.c:257:file '/boot/grub2/x86_64-efi/gfxterm_background.mod' not found

So somehow this module seems to be missing too. But there is no directory /boot/grub2/x86_64-efi on my filesystem. There is a similar directory for the old GRUB however, and it contains the gfxterm_background.mod file. But where does GRUB2 gets all its other modules from if the /boot/grub2/x86_64-efi directory doesn't exist?

Any ideas why that command is missing and how to fix it?

Thank you

16
  • 1
    Why do you place the image under /boot/efi (instead of /boot) and --set=root to it? Commented Dec 7 at 12:47
  • @TomYan That was only one of the paths I've tried. I tried my home directory, the boot directory, the EFI partition (/boot/efi), the GRUB2 themes folder etc. Commented Dec 7 at 13:28
  • @TomYan also, the ls commands lists the file with the same path that is used in the background_image command. So it should be accessible but I guess it doesnt matter since the command itself doesn't even exist. Commented Dec 7 at 13:29
  • 1
    There is a similar directory for the old GRUB however Wait a minute. Do you mean there is /boot/grub but not /boot/grub2 in your system (like after the system is booted up; or in the grub shell but only when root is not changed with search)? You mentioned that you were with Arch but installed Fedora recently, but did you start from scretch (new machine or drive wiped) or is this some kind of multi-boot system now? Commented Dec 8 at 8:29
  • 1
    For the record there is no such thing as "old GRUB" unless you have a decade(s)-old Arch installation. Naming the directory grub2 is a Fedora/downstream thing (because there was a time some people still cling to the real "old GRUB" and they think this kind of "hack" is good for the transition period; something like that). AFAIK they have never undo that, but I'm not sure if things have changed recently or so (and if so whether that in turn has something to do with the problem you bumped into). Commented Dec 8 at 8:35

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.