/grub2/fonts/unicode.pf2 not found error before grub menu appears

Issue

When booting Fedora Silverblue 34 I see an error flash on the screen before being replaced with the grub menu. I managed to inspect what it says by taking a video. It says:

error: ../../grub-core/fs/fshelp.c:257:file `/grub2/fonts/unicode.pf2' not found.

It doesn’t prevent the OS from booting, but wondering if anyone knows what might be causing this.

The only grub related customization I’ve made is change GRUB_TERMINAL_OUTPUT from console to gfxterm, as the former rendered extremely slowly and was laggy when navigating the grub menu.

Grub config

> cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
#GRUB_TERMINAL_OUTPUT="console"
GRUB_TERMINAL_OUTPUT="gfxterm"
GRUB_CMDLINE_LINUX="rd.luks.uuid=luks-0c755fd5-99d6-4578-bb46-328eb72fd038 rd.lvm.lv=vg0/root rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

rpm-ostree status

> rpm-ostree status
State: idle
Deployments:
● fedora:fedora/34/x86_64/silverblue
                   Version: 34.20210923.0 (2021-09-23T19:02:00Z)
                BaseCommit: 4547905b37f46a790a810248c13ce718e4c42cdbf6f1bff38a311d1503543dfa
              GPGSignature: Valid signature by 8C5BA6990BDB26E19F2A1A801161AE6945719A39
           LayeredPackages: virt-manager rpmfusion-nonfree-release snapper virt-viewer bcache-tools google-chrome-stable fish ffmpeg
                            fedora-workstation-repositories acpica-tools rpmfusion-free-release

I’ve confirmed that reverting GRUB_TERMINAL_OUTPUT back to console makes the error go away - but that makes the grub menu extremely slow and laggy again.

I’ll go ahead and log a bug for this.

Issue reported here: [BUG] Grub error `/grub2/fonts/unicode.pf2' not found when using gfxterm console · Issue #204 · fedora-silverblue/issue-tracker · GitHub

I think you can specify GRUB_FONT="/path/to/font.pf2" in /etc/default/grub.

Edit: It seems it’s already been filed as a bug here (1739762 – Error message about missing file(unicode.pf2) while boot via EFI).
Unfortunately, it seems it is still an issue in F35 (at least in my installation of Kinoite).

Oh that’s interesting!

I had assumed that this was just a silverblue/rpm-ostree issue due to they way the boot process is a little different from regular fedora workstation (in order to support booting into earlier images and so on).

I didn’t think to check for normal workstation bug reports.

It could be that a temporary solution is just to manually copy/paste the correct font file. Could you give this a try?

Yep, copying /usr/share/grub/unicode.pf2 into /boot/grub2/fonts/ fixed the error.

But as you say, this solution is only temporary.

Hi, I had a similar problem where the /boot/efi/EFI/fedora/grub.cfg file had a line saying:

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod btrfs
search --no-floppy --fs-uuid --set=root 6aa880a6-9826-48ef-afbd-4e0703239427
    font="/root/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=800x600
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_CA
  insmod gettext
fi

The important part here is the /root/usr/share/grub/unicode.pf2. It is not found because actually the file is in /usr/share/grub/unicode.pf2, and I the grub2-mkconfig seems to add the little `/root/ in front of this path during the grub.cfg file generation.

Now for some people, it can cause a lot of troubles because this prevents the boot menu from loading the GRUB_GFXMODE parameter. A way to bypass this is to provide your own GRUB_FONT (and something different than /usr/share/grub/unicode.pf2).

I hope that it’ll help someone as I just spent 5 hours on this.

I also hope that I’m posting this at the right place.

For me my hard disk is encrypted, so I think the real issue is the root partition is not mounted when grub is loaded. grub does seem to have a copy of unicode.pf2 in /boot/efi/EFI/fedora/unicode.pf2, not sure why grub is not loading it, nor do I want to change anything in grub.cfg manually.