[SOLVED] grub2: gfxterm_background and secure boot
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 9 of 9
  1. #1
    Join Date
    May 2018
    Location
    Rome
    Posts
    6

    Angry grub2: gfxterm_background and secure boot

    Hello,
    I recently installed Fedora 28 on my Dell XPS 15 9550 and everything worked fine right after the install (except for the touchpad which required a bit digging, but I eventually figured it out).
    I was also able to sign the proprietary nvidia drivers and bbswitch in order to use them with Secure Boot enabled.
    Still, there is a little problem which I can live with but I would live better if we can solve it (lol): I would like to change the grub2-efi background while keeping secure boot on.
    I did the following steps with secure boot off and it worked, this is why I'm guessing it's related to secure boot.

    First, I edited /etc/default/grub and added/edited the following lines:
    Code:
    GRUB_GFXMODE=3840x2160,1280x760,auto
    GRUB_TERMINAL_OUTPUT=gfxterm
    GRUB_BACKGROUND=/boot/grub2/themes/fedora_flip.png
    Then I added "insmod gfxterm_background" in /ec/grub.d/00_header right after "insmod gfxterm" so that it looks like this:
    Code:
    ...
    insmod gfxterm
    insmod gfxterm_background
    ...
    And finally I generated the grub.cfg file with:
    Code:
    grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
    However, there is no "insmod gfxterm_background" in /boot/grub2/grub.cfg:
    Code:
    # cat /boot/grub2/grub.cfg | grep -i gfxterm_background
    #
    And this results in grub with the classic black background.
    Is there any way to make it work with secure boot enabled?

    Thank you.
    Last edited by gbyolo; 16th May 2018 at 08:50 AM.

  2. #2
    Join Date
    Mar 2004
    Location
    In your closet
    Posts
    15,714

    Re: grub2: gfxterm_background and secure boot

    Contents of my /etc/default/grub. I have a custom background with color text. Try a lower resolution first to see if it works.

    PHP Code:
    GRUB_TIMEOUT="20"
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT="saved"
    GRUB_DISABLE_SUBMENU="true"
    #GRUB_TERMINAL_OUTPUT="console"
    #GRUB_CMDLINE_LINUX="rhgb quiet"
    GRUB_DISABLE_RECOVERY="true"

    GRUB_BACKGROUND="/boot/grub2/themes/fedora_wall6_fixed.jpg"
    export GRUB_COLOR_NORMAL="white/black"
    export GRUB_COLOR_HIGHLIGHT="yellow/red"
    GRUB_GFXMODE="800x600" 
    Glenn
    The Bassinator

  3. #3
    Join Date
    May 2018
    Location
    Rome
    Posts
    6

    Re: grub2: gfxterm_background and secure boot

    Still not working. I guess it's a problem of grub2-efi-modules, maybe they're not signed?
    I tried to sign gfxterm_background.mod but still nothing.

  4. #4
    PabloTwo's Avatar
    PabloTwo is offline "Registered User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    7,765

    Re: grub2: gfxterm_background and secure boot

    If Fedora is installed in UEFI mode then your working grub.cfg file is NOT in the /boot/grub2/ directory. It would be in the /boot/efi/EFI/fedora/ directory.

  5. #5
    PabloTwo's Avatar
    PabloTwo is offline "Registered User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    7,765

    Re: grub2: gfxterm_background and secure boot

    Here is another way to set a grub2 menu background image that does not utilize a "GRUB_BACKGROUND=" entry in your /etc/default/grub file. Works on either MBR or UEFI installs and is what I use on my Fedora desktop PC and my Fedora laptop.

    You could do this with the default "system" grub theme, but any update to grub2 itself would undo your work. So I install an optional grub2 theme, in this case "starfield". Starfield installs to /usr/share/grub/themes/ directory. I then copy the entire /usr/share/grub/themes/starfield directory to /boot/grub2/themes/. I place the background image I want to use in the /boot/grub2/themes/starfield directory.

    I edit the line in the /boot/grub2/themes/starfield/theme.txt file that begins with desktop-image:, replacing the "default" entry with the name of the image file I want. No path to the file is necessary if it is already in the theme directory.
    Code:
    $ sudo grep desktop /boot/grub2/themes/starfield/theme.txt
    desktop-image: "night_street.png"
    I set the default theme to use in the /etc/default/grub file:
    Code:
    GRUB_THEME="/boot/grub2/themes/starfield/theme.txt"
    No need for all that other gfxterm stuff, etc.
    PHP Code:
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT="0"
    GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 $([ -x /usr/sbin/rhcrashkernel-param ] && /usr/sbin/rhcrashkernel-param || :) rd.luks=0 vconsole.keymap=us quiet acpi_backlight=vendor"
    GRUB_DISABLE_RECOVERY="true"
    GRUB_THEME="/boot/grub2/themes/starfield/theme.txt"
    #GRUB_DISABLE_OS_PROBER="true"
    GRUB_DISABLE_SUBMENU="true" 
    And, of course, regenerate the grub.cfg file after editing the /etc/default/grub file. This method preserves your grub2 menu background over both updates to grub itself and Fedora release upgrades.

  6. #6
    Join Date
    May 2018
    Location
    Rome
    Posts
    6

    Re: grub2: gfxterm_background and secure boot

    Quote Originally Posted by PabloTwo
    Here is another way to set a grub2 menu background image that does not utilize a "GRUB_BACKGROUND=" entry in your /etc/default/grub file. Works on either MBR or UEFI installs and is what I use on my Fedora desktop PC and my Fedora laptop.

    You could do this with the default "system" grub theme, but any update to grub2 itself would undo your work. So I install an optional grub2 theme, in this case "starfield". Starfield installs to /usr/share/grub/themes/ directory. I then copy the entire /usr/share/grub/themes/starfield directory to /boot/grub2/themes/. I place the background image I want to use in the /boot/grub2/themes/starfield directory.

    I edit the line in the /boot/grub2/themes/starfield/theme.txt file that begins with desktop-image:, replacing the "default" entry with the name of the image file I want. No path to the file is necessary if it is already in the theme directory.
    Code:
    $ sudo grep desktop /boot/grub2/themes/starfield/theme.txt
    desktop-image: "night_street.png"
    I set the default theme to use in the /etc/default/grub file:
    Code:
    GRUB_THEME="/boot/grub2/themes/starfield/theme.txt"
    No need for all that other gfxterm stuff, etc.
    PHP Code:
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT="0"
    GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 $([ -x /usr/sbin/rhcrashkernel-param ] && /usr/sbin/rhcrashkernel-param || :) rd.luks=0 vconsole.keymap=us quiet acpi_backlight=vendor"
    GRUB_DISABLE_RECOVERY="true"
    GRUB_THEME="/boot/grub2/themes/starfield/theme.txt"
    #GRUB_DISABLE_OS_PROBER="true"
    GRUB_DISABLE_SUBMENU="true" 
    And, of course, regenerate the grub.cfg file after editing the /etc/default/grub file. This method preserves your grub2 menu background over both updates to grub itself and Fedora release upgrades.
    Thanks,
    I'll give it a try.

  7. #7
    Join Date
    May 2018
    Location
    Rome
    Posts
    6

    Re: grub2: gfxterm_background and secure boot

    Quote Originally Posted by PabloTwo
    If Fedora is installed in UEFI mode then your working grub.cfg file is NOT in the /boot/grub2/ directory. It would be in the /boot/efi/EFI/fedora/ directory.
    Yes you're right, I mistyped. Using /boot/efi/EFI/fedora/grub.cfg does not solve the problem.


    Quote Originally Posted by PabloTwo
    Here is another way to set a grub2 menu background image that does not utilize a "GRUB_BACKGROUND=" entry in your /etc/default/grub file. Works on either MBR or UEFI installs and is what I use on my Fedora desktop PC and my Fedora laptop.

    You could do this with the default "system" grub theme, but any update to grub2 itself would undo your work. So I install an optional grub2 theme, in this case "starfield". Starfield installs to /usr/share/grub/themes/ directory. I then copy the entire /usr/share/grub/themes/starfield directory to /boot/grub2/themes/. I place the background image I want to use in the /boot/grub2/themes/starfield directory.

    I edit the line in the /boot/grub2/themes/starfield/theme.txt file that begins with desktop-image:, replacing the "default" entry with the name of the image file I want. No path to the file is necessary if it is already in the theme directory.
    Code:
    $ sudo grep desktop /boot/grub2/themes/starfield/theme.txt
    desktop-image: "night_street.png"
    I set the default theme to use in the /etc/default/grub file:
    Code:
    GRUB_THEME="/boot/grub2/themes/starfield/theme.txt"
    No need for all that other gfxterm stuff, etc.
    PHP Code:
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT="0"
    GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 $([ -x /usr/sbin/rhcrashkernel-param ] && /usr/sbin/rhcrashkernel-param || :) rd.luks=0 vconsole.keymap=us quiet acpi_backlight=vendor"
    GRUB_DISABLE_RECOVERY="true"
    GRUB_THEME="/boot/grub2/themes/starfield/theme.txt"
    #GRUB_DISABLE_OS_PROBER="true"
    GRUB_DISABLE_SUBMENU="true" 
    And, of course, regenerate the grub.cfg file after editing the /etc/default/grub file. This method preserves your grub2 menu background over both updates to grub itself and Fedora release upgrades.
    Did it, and It solved the problem meaning that now I can see the background. However, another problem rises, which is, A black box covering about 70% of the screen as soon as I select a boot option in the grub menu.
    What I would like to have is the same layout of the default grub2, but with a custom background.
    I searched a bit and didn't find anything for removing that annoying black box, so for now I think that I'll live with no background at all.

  8. #8
    PabloTwo's Avatar
    PabloTwo is offline "Registered User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    7,765

    Re: grub2: gfxterm_background and secure boot

    Quote Originally Posted by gbyolo
    However, another problem rises, which is, A black box covering about 70% of the screen as soon as I select a boot option in the grub menu.
    Once you click on an OS boot option in grub, grub is finished. Grub hands over control to the bootloader of whatever it is you selected. If you picked a Fedora kernel, then what you are most likely seeing next comes from plymouth. Plymouth has several downloadable GUI themes. From F27,
    Code:
    $ sudo dnf search plymouth-theme
    Last metadata expiration check: 2:02:32 ago on Wed 16 May 2018 08:31:23 AM EDT.
    ========================================== Name Matched: plymouth-theme ===========================================
    plymouth-theme-solar.x86_64 : Plymouth "Solar" theme
    plymouth-theme-charge.x86_64 : Plymouth "Charge" plugin
    plymouth-theme-breeze.x86_64 : Breeze theme for Plymouth
    plymouth-theme-script.x86_64 : Plymouth "Script" plugin
    plymouth-theme-fade-in.x86_64 : Plymouth "Fade-In" theme
    plymouth-theme-hot-dog.noarch : Plymouth Happy Hot Dog Theme
    plymouth-theme-spinner.x86_64 : Plymouth "Spinner" theme
    plymouth-theme-spinfinity.x86_64 : Plymouth "Spinfinity" theme
    It also has the built-in "details" and "text" non-gui themes. I have been using the details theme for a long time, where you can watch everything that's being loaded in console mode, which when finished, then hands over to the login screen. Using the details theme requires removing the rhgb parm from your kernel boot parms list. You might want to try changing your plymouth theme:
    Code:
    # plymouth-set-default-theme <theme_name> -R
    The -R rebuilds your initramfs file with the new theme included in it. To see available themes,
    Code:
    $ plymouth-set-default-theme --list
    With a little work, you might be able to hack an existing gui theme and insert your own image in to use as background, or seek out a tutorial on how to create your own plymouth theme.
    Last edited by PabloTwo; 16th May 2018 at 07:19 PM.

  9. #9
    Join Date
    May 2018
    Location
    Rome
    Posts
    6

    Re: grub2: gfxterm_background and secure boot

    I solved it.
    I used the deepin grub2 theme took from https://github.com/linuxdeepin/deepin-grub2-themes and I changed both the font and the background. Now it works.

Similar Threads

  1. grub2: gfxterm_background and secure boot
    By gbyolo in forum Using Fedora
    Replies: 0
    Last Post: 8th May 2018, 10:58 AM
  2. Where's the tutorial on installing F20 to dual boot on Win8 with Secure boot?
    By Don97365 in forum Installation, Upgrades and Live Media
    Replies: 39
    Last Post: 25th December 2013, 08:07 AM
  3. Unable to Boot Fedora 19 Installation Media: UEFI + Secure Boot
    By Steinmeister in forum Installation, Upgrades and Live Media
    Replies: 9
    Last Post: 8th December 2013, 12:59 AM
  4. Secure Boot not Enabled on an Acer Aspire with Windows 7 [USB Live Boot]
    By czechmate in forum Installation, Upgrades and Live Media
    Replies: 7
    Last Post: 28th October 2013, 06:59 AM
  5. Replies: 0
    Last Post: 27th January 2013, 09:34 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •