build/roms: simplified seagrub handling

Signed-off-by: Leah Rowe <leah@libreboot.org>
20240612_branch
Leah Rowe 2024-04-28 20:21:35 +01:00
parent 515185a7f5
commit 230f68fd8f
2 changed files with 7 additions and 30 deletions

1
config/grub/bootorder Normal file
View File

@ -0,0 +1 @@
/rom@img/grub2

View File

@ -399,8 +399,12 @@ build_grub_roms()
newrom="${newrom}${initmode}_${keymap}.rom"
x_ moverom "${tmpgrubrom}" "${newrom}"
if [ "${payload_seabios_grubonly}" = "y" ]; then
mkSeagrubRom "${tmpgrubrom}" "${newrom}"
mkSeabiosGrubonlyRom "${tmpgrubrom}" "${newrom}"
x_ "$cbfstool" "$tmpgrubrom" add \
-f "config/grub/bootorder" -n bootorder -t raw
x_ moverom "$tmpgrubrom" "${newrom%.rom}_grubfirst.rom"
x_ "$cbfstool" "$tmpgrubrom" add-int -i 0 \
-n etc/show-boot-menu
x_ moverom "$tmpgrubrom" "${newrom%.rom}_grubonly.rom"
fi
x_ rm -f "${tmpgrubrom}"
done
@ -429,34 +433,6 @@ mkSeabiosRom() {
printf "%s\n" "${tmprom}"
}
# SeaGRUB configuration
mkSeagrubRom()
{
_grubrom="${1}"
_newrom="${2}"
tmpbootorder=$(mktemp -t coreboot_rom.XXXXXXXXXX)
# only load grub, by inserting a custom bootorder file
printf "/rom@img/grub2\n" > "$tmpbootorder" || $err "printf bootorder"
x_ "${cbfstool}" "${_grubrom}" \
add -f "${tmpbootorder}" -n bootorder -t raw
x_ rm -f "${tmpbootorder}"
x_ moverom "${_grubrom}" "${_newrom%.rom}_grubfirst.rom"
}
# SeaGRUB, and disable the SeaBIOS menu (grub only)
mkSeabiosGrubonlyRom()
{
_grubrom="${1}"
_newrom="${2}"
x_ "${cbfstool}" "${_grubrom}" add-int -i 0 -n etc/show-boot-menu
x_ moverom "${_grubrom}" "${_newrom%.rom}_grubonly.rom"
}
build_uboot_roms()
{
tmprom=$(mkUbootRom "${cbrom}" "fallback/payload") || \