Skip to content

Instantly share code, notes, and snippets.

@sstallion
Last active May 20, 2024 00:44
Show Gist options
  • Save sstallion/19852bad286709a1c301fccdd8234681 to your computer and use it in GitHub Desktop.
Save sstallion/19852bad286709a1c301fccdd8234681 to your computer and use it in GitHub Desktop.
Convert UEFI BGRT image
#!/bin/sh -e
# convert-bgrt.sh - convert UEFI BGRT image
BGRT_DIR=/sys/firmware/acpi/bgrt
if [ ! -d $BGRT_DIR ]; then
echo "BGRT not found" >&2
exit 1
fi
if [ $# -lt 2 ]; then
echo "usage: `basename $0` size file" >&2
exit 1
fi
X=`cat $BGRT_DIR/xoffset`
Y=`cat $BGRT_DIR/yoffset`
convert -background black -extent $1-$X-$Y $BGRT_DIR/image $2
exit 0
@sstallion
Copy link
Author

sstallion commented Jan 21, 2017

Create a GRUB2 background image that matches the UEFI boot image:

# dnf -y install ImageMagick
# sh convert-bgrt.sh 1920x1080 /boot/efi/EFI/fedora/background.png
# echo 'GRUB_BACKGROUND="/boot/efi/EFI/fedora/background.png"' >> /etc/default/grub
# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

GRUB_TERMINAL should be set to gfxterm or commented out in /etc/default/grub. This method works with UEFI Secure Boot provided the gfxterm_background module is included in the grub image.

background

@Grief
Copy link

Grief commented May 9, 2023

Thanks!
foo

@sstallion
Copy link
Author

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment