File isopatch.sh of Package fedora-minimalX-live
#! /bin/sh
set -ex
location=$1
iso_dir=${location#iso:}
iso_bootloader=boot/x86_64/loader
grubcfg=${iso_dir}/boot/grub2/grub.cfg
theme=breeze
grubtheme=${iso_dir}/boot/grub2/themes/${theme}/theme.txt
sed -i '/terminal_/d' ${grubcfg}
_a1="set gfxmode=auto\n"
_a2="set font=(\$root)/${iso_bootloader}/grub2/fonts/unicode.pf2\n"
_a3="set ascii_font=grub2/themes/${theme}/ascii.pf2\n"
_a4="set unifont_bold_16_font=grub2/themes/${theme}/unifont-bold-16.pf2\n"
_a5="set unifont_regular_16_font=grub2/themes/${theme}/unifont-regular-16.pf2\n"
_a6="set unifont_regular_14_font=grub2/themes/${theme}/unifont-regular-14.pf2\n"
_b1="if [ -f \${font} ];then\n"
_b2=" loadfont \${font}\n"
_b3="if [ -f (\$root)/boot/\${ascii_font} ];then\n"
_b4=" loadfont (\$root)/boot/\${ascii_font}\n"
_b5="if [ -f (\$root)/boot/\${unifont_bold_16_font} ];then\n"
_b6=" loadfont (\$root)/boot/\${unifont_bold_16_font}\n"
_b7="if [ -f (\$root)/boot/\${unifont_regular_14_font} ];then\n"
_b8=" loadfont (\$root)/boot/\${unifont_regular_14_font}\n"
_b9="if [ -f (\$root)/boot/\${unifont_regular_16_font} ];then\n"
_b10=" loadfont (\$root)/boot/\${unifont_regular_16_font}\n"
_b11="if [ -f (\$root)/${grubtheme} ];then\n"
_b12=" set theme=(\$root)/${grubtheme}\n"
_c1="fi\n"
_d1="terminal_input console\n"
_d2="terminal_output gfxterm\n"
_e1="if [ \"\${grub_platform}\" = \"efi\" ]; then\n"
_e2=" echo \"Please press 't' to show the boot menu on this console\"\n"
sed -i "/timeout_style=menu/a\\\n$_e1$_e2$_c1$_a1$_a2$_a3$_a4$_a5$_a6$_b1$_b2$_c1$_b3$_b4$_c1$_b5$_b6$_c1$_b7$_b8$_c1$_b9$_b10$_c1$_b11$_b12$_c1$_d1$_d2" ${grubcfg}
sed -i '/desktop-color/s/000000/0d202f/' ${grubtheme}
sed -i '/desktop-color/s/$/\ndesktop-image: "back.png"\n/' ${grubtheme}