grub2 error: can't find command 'background_image'.
So, I have been trying to add a background image to the grub2 bootloader and been having no luck. I am running Fedora 27 and using UEFI boot. I did notice when booting grub flashes an error very quickly, and by manually editing grub.cfg and adding a sleep command at the the end, I was able to to determine that the error was:error: can't find command 'background_image'.
I have included my /etc/default/grub and the /boot/efi/EFI/fedora/grub.cfg that is generated by grub2-mkconfig below if those are any help, but I think the problem is due to the missing command error. I just don't know how to solve this. Any help is greatly appreciated.
My /etc/default/grub:
GRUB_TIMEOUT=60
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=false
GRUB_TERMINAL_OUTPUT="gfxterm"
GRUB_CMDLINE_LINUX="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvid$
GRUB_DISABLE_RECOVERY="true"
GRUB_TERMINAL=gfxterm
export GRUB_COLOR_NORMAL="white/black"
export GRUB_COLOR_HIGHLIGHT="yellow/red"
GRUB_BACKGROUND="/boot/efi/EFI/fedora/tardis_inside.png"
GRUB_GFXMODE=auto
and my /boot/efi/EFI/fedora/grub.cfg:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
set pager=1
if [ -f ${config_directory}/grubenv ]; then
load_env -f ${config_directory}/grubenv
elif [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="${saved_entry}"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root c71e3b1d-4bb4-483b-8c33-616a59502613
else
search --no-floppy --fs-uuid --set=root c71e3b1d-4bb4-483b-8c33-616a59502613
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_input gfxterm
terminal_output gfxterm
insmod part_gpt
insmod fat
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root AE0C-F05B
else
search --no-floppy --fs-uuid --set=root AE0C-F05B
fi
insmod png
background_image -m stretch /EFI/fedora/tardis_inside.png
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=60
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=60
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/01_users ###
if [ -f ${prefix}/user.cfg ]; then
source ${prefix}/user.cfg
if [ -n "${GRUB2_PASSWORD}" ]; then
set superusers="root"
export superusers
password_pbkdf2 root ${GRUB2_PASSWORD}
fi
fi
### END /etc/grub.d/01_users ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-simple-c71e3b1d-4bb4-483b-8c33-616a59502613' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ...