grub: insert background in memdisk instead

the background is only a few kb. the whole rationale
before was to limit the space used in memdisk, but this
decision was made when the background was much bigger;
it has since been optimised greatly, and the grub modules
were heavily reduce, so it should be safe.

grub's memdisk breaks when you add too much data to it.
as part of simplifying the rest of lbmk, this change removes
some more bloat from the rest of lbmk. handling this in the
memdisk is much simpler than handling it with cbfstool.

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2-merge1
Leah Rowe 2024-06-15 22:53:34 +01:00 committed by Leah Rowe
parent 7f5adffc02
commit b50a588cba
9 changed files with 26 additions and 35 deletions

View File

@ -2,5 +2,4 @@ tree="i945"
xarch="i386-elf" xarch="i386-elf"
payload_seabios="y" payload_seabios="y"
payload_seabios_withgrub="y" payload_seabios_withgrub="y"
grub_background="background1024x768.png"
grub_scan_disk="ahci" grub_scan_disk="ahci"

View File

@ -2,5 +2,4 @@ tree="i945"
xarch="i386-elf" xarch="i386-elf"
payload_seabios="y" payload_seabios="y"
payload_seabios_withgrub="y" payload_seabios_withgrub="y"
grub_background="background1024x768.png"
grub_scan_disk="ahci" grub_scan_disk="ahci"

View File

@ -2,5 +2,4 @@ tree="i945"
xarch="i386-elf" xarch="i386-elf"
payload_seabios="y" payload_seabios="y"
payload_seabios_withgrub="y" payload_seabios_withgrub="y"
grub_background="background1024x768.png"
grub_scan_disk="ahci" grub_scan_disk="ahci"

View File

@ -2,5 +2,4 @@ tree="i945"
xarch="i386-elf" xarch="i386-elf"
payload_seabios="y" payload_seabios="y"
payload_seabios_withgrub="y" payload_seabios_withgrub="y"
grub_background="background1024x768.png"
grub_scan_disk="ahci" grub_scan_disk="ahci"

View File

@ -26,13 +26,14 @@ else
gfxpayload=keep gfxpayload=keep
terminal_output --append gfxterm terminal_output --append gfxterm
if [ -f (cbfsdisk)/background.png ]; then for dt in cbfsdisk memdisk; do
insmod png for it in png jpg; do
background_image (cbfsdisk)/background.png if [ -f (${dt})/background.${it} ]; then
elif [ -f (cbfsdisk)/background.jpg ]; then insmod ${it}
insmod jpeg background_image (${dt})/background.${it}
background_image (cbfsdisk)/background.jpg fi
fi done
done
fi fi
# Keep CTRL pressed to enable default serial terminal (COM1 or the like) # Keep CTRL pressed to enable default serial terminal (COM1 or the like)

View File

@ -26,13 +26,14 @@ else
gfxpayload=keep gfxpayload=keep
terminal_output --append gfxterm terminal_output --append gfxterm
if [ -f (cbfsdisk)/background.png ]; then for dt in cbfsdisk memdisk; do
insmod png for it in png jpg; do
background_image (cbfsdisk)/background.png if [ -f (${dt})/background.${it} ]; then
elif [ -f (cbfsdisk)/background.jpg ]; then insmod ${it}
insmod jpeg background_image (${dt})/background.${it}
background_image (cbfsdisk)/background.jpg fi
fi done
done
fi fi
# Keep CTRL pressed to enable default serial terminal (COM1 or the like) # Keep CTRL pressed to enable default serial terminal (COM1 or the like)

View File

@ -27,13 +27,14 @@ else
gfxpayload=keep gfxpayload=keep
terminal_output --append gfxterm terminal_output --append gfxterm
if [ -f (cbfsdisk)/background.png ]; then for dt in cbfsdisk memdisk; do
insmod png for it in png jpg; do
background_image (cbfsdisk)/background.png if [ -f (${dt})/background.${it} ]; then
elif [ -f (cbfsdisk)/background.jpg ]; then insmod ${it}
insmod jpeg background_image (${dt})/background.${it}
background_image (cbfsdisk)/background.jpg fi
fi done
done
fi fi
# Keep CTRL pressed to enable default serial terminal (COM1 or the like) # Keep CTRL pressed to enable default serial terminal (COM1 or the like)

View File

@ -11,7 +11,6 @@ set -u -e
. "include/lib.sh" . "include/lib.sh"
seavgabiosrom="elf/seabios/default/libgfxinit/vgabios.bin" seavgabiosrom="elf/seabios/default/libgfxinit/vgabios.bin"
grub_background="background1280x800.png"
cfgsdir="config/coreboot" cfgsdir="config/coreboot"
picosrc="src/pico-serprog" picosrc="src/pico-serprog"
picosdk="src/pico-sdk" picosdk="src/pico-sdk"
@ -107,7 +106,6 @@ list_serprog_boards()
configure_target() configure_target()
{ {
eval "$(setvars "n" $pv) $(setvars "" $v)" eval "$(setvars "n" $pv) $(setvars "" $v)"
grub_background="background1280x800.png"
board="$1" board="$1"
targetdir="$cfgsdir/$board" targetdir="$cfgsdir/$board"
@ -261,13 +259,6 @@ build_grub_roms()
# we only need insert grub.elf once, for each coreboot config: # we only need insert grub.elf once, for each coreboot config:
cbfs "$tmprom" "$grubelf" "$grub_cbfs" cbfs "$tmprom" "$grubelf" "$grub_cbfs"
# we only need insert background.png once, for each coreboot config:
if [ "$displaymode" = "vesafb" ] || \
[ "$displaymode" = "corebootfb" ]; then
cbfs "$tmprom" "$grubdata/background/$grub_background" \
background.png raw
fi
tmpcfg="$(mktemp -t coreboot_rom.XXXXXXXXXX)" tmpcfg="$(mktemp -t coreboot_rom.XXXXXXXXXX)"
printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" > "$tmpcfg" || \ printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" > "$tmpcfg" || \
$err "set grub_scan_disk, $grub_scan_disk, $tmpcfg" $err "set grub_scan_disk, $grub_scan_disk, $tmpcfg"

View File

@ -284,7 +284,8 @@ mkpayload_grub()
--fonts= --themes= --locales= --modules="$grub_modules" \ --fonts= --themes= --locales= --modules="$grub_modules" \
--install-modules="$grub_install_modules" \ --install-modules="$grub_install_modules" \
"/boot/grub/grub_default.cfg=${cdir}/.config" \ "/boot/grub/grub_default.cfg=${cdir}/.config" \
"/boot/grub/grub.cfg=$grubdata/memdisk.cfg" || \ "/boot/grub/grub.cfg=$grubdata/memdisk.cfg" \
"/background.png=$grubdata/background/background1280x800.png" || \
$err "$tree: cannot build grub.elf" $err "$tree: cannot build grub.elf"
} }