bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #60568] grub-mkconfig generates broken paths for themes and fonts l


From: Marco Bonelli
Subject: [bug #60568] grub-mkconfig generates broken paths for themes and fonts located in mountpoints different than "/"
Date: Sun, 9 May 2021 20:37:57 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?60568>

                 Summary: grub-mkconfig generates broken paths for themes and
fonts located in mountpoints different than "/"
                 Project: GNU GRUB
            Submitted by: mebeim
            Submitted on: Mon 10 May 2021 12:37:55 AM UTC
                Category: Configuration
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 
                 Release: 2.02
         Discussion Lock: Any
         Reproducibility: Every Time
         Planned Release: None

    _______________________________________________________

Details:

I'm running Debian Buster with the following partitions set up:

    $ lsblk
    ...
    nvme0n1p5 259:5    0 102.8G  0 part /
    nvme0n1p6 259:6    0  31.9G  0 part [SWAP]
    nvme0n1p7 259:7    0   492M  0 part /boot

I was trying to install a theme into /boot/grub/themes by adding the
following to /etc/default/grub:

    GRUB_THEME=/boot/grub/themes/mytheme/theme

The theme also references a pf2 font file in the same folder as the "theme"
file.

Updating with grub-mkconfig this results in the following in
/boot/grub/grub.cfg:

    loadfont ($root)/grub/themes/mytheme/font.pf2
    set theme=($root)/grub/themes/mytheme/theme

And when booting GRUB isn't able to load the theme nor the font:

    error: can't open '/grub/themes/mytheme/theme': No such file or
directory.
    error: can't open '/grub/themes/mytheme/font.pf2': No such file or
directory.

This appears to happen because my files are inside the partition which is
mounted at "/boot" instead of "/". If I put my theme in another folder in
the main partition ("/"), like e.g. under / or /usr, the generated path
seems correct and everything works as expected. Furthermore, keeping the
theme inside "/boot/grub" and manually editing grub.cfg after it's
generated to change "($root)/grub/..." into "($root)/boot/grub/..." also
seems to fix the issue.

So AFAICT, it looks like grub-mkconfig should _not_ strip the leading
mountpoint ("/boot") from my paths. Looking at the source code it seems
that this is done in "util/grub.d/00_header.in" using the function
"make_system_path_relative_to_its_root":

    loadfont (\$root)`make_system_path_relative_to_its_root $x`
    ...
    set theme=(\$root)`make_system_path_relative_to_its_root $GRUB_THEME`

I hope this is not intended, as it looks like a bug. If intended, does this
mean that I should not load fonts/themes from inside "/boot"? It looks
counter-intuitive to say the least.

Additional information:

    $ uname -a
    Linux xxx 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 
GNU/Linux

    $ grub-mkconfig --version
    grub-mkconfig (GRUB) 2.02+dfsg1-20+deb10u4

    $ dpkg -l | grep ii | grep grub
    ii  grub-common              2.02+dfsg1-20+deb10u4       amd64
    ii  grub-efi-amd64           2.02+dfsg1-20+deb10u4       amd64
    ii  grub-efi-amd64-bin       2.02+dfsg1-20+deb10u4       amd64
    ii  grub-efi-amd64-signed    1+2.02+dfsg1+20+deb10u4     amd64
    ii  grub-emu                 2.02+dfsg1-20+deb10u4       amd64
    ii  grub2-common             2.02+dfsg1-20+deb10u4       amd64




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60568>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]