rom.sh: re-add seabios-only roms and grub keymaps

this time, only handle multiple keymaps on seagrub
images. for images where seabios is first but does
not immediately load grub, whether grub is still
available in flash, just do one image (US Qwerty)

this still results in fewer images per target than
Libreboot 20240612, but should prevent most users
from being annoyed. i got a few people asking
repeatedly, and i hadn't documented yet how to add
keymap.gkb or how to remove bootorder, to get a
different keymap or disable seagrub respectively.

i anticipate that i'll get such questions a lot, even
if i do document it, so i'm reversing that decision.

it doesn't result in much extra code. the new design
in lbmk makes this sort of thing much simpler.

Signed-off-by: Leah Rowe <leah@libreboot.org>
master
Leah Rowe 2024-07-22 09:11:53 +01:00 committed by Leah Rowe
parent f0c25c7258
commit d08b175a0d
2 changed files with 20 additions and 7 deletions

View File

@ -7,7 +7,7 @@ seavgabiosrom="elf/seabios/default/libgfxinit/vgabios.bin"
pv="payload_uboot payload_seabios payload_memtest payload_grub"
v="initmode ubootelf grub_scan_disk uboot_config grubtree grubelf pname"
v="$v displaymode tmprom"
v="$v displaymode tmprom newrom"
eval `setvars "n" $pv`
eval `setvars "" $v`

View File

@ -104,10 +104,8 @@ mkcorebootbin()
$dry add_seabios
[ "$payload_uboot" = "y" ] && pname="uboot" && $dry add_uboot
else
pname="custom" # coreboot's build system added payloads
fi
newrom="bin/$target/${pname}_${target}_$initmode$displaymode.rom"
$dry x_ mkdir -p "${newrom%/*}"; $dry x_ mv "$tmprom" "$newrom"
pname="custom" && cprom; :
fi; :
}
add_seabios()
@ -126,7 +124,7 @@ add_seabios()
[ "$payload_memtest" = "y" ] && cbfs "$tmprom" \
"elf/memtest86plus/memtest.bin" img/memtest
[ "$payload_grub" = "y" ] && pname="seagrub" && add_grub; return 0
cprom && [ "$payload_grub" = "y" ] && pname="seagrub" && add_grub; :
}
add_grub()
@ -136,6 +134,11 @@ add_grub()
> "$TMPDIR/tmpcfg" || $err "$target: !insert scandisk"
cbfs "$tmprom" "$TMPDIR/tmpcfg" scan.cfg raw
cbfs "$tmprom" "$grubdata/bootorder" bootorder raw
for keymap in config/data/grub/keymap/*.gkb; do
[ -f "$keymap" ] || continue
keymap="${keymap##*/}"
cprom "${keymap%.gkb}"
done
}
add_uboot()
@ -145,7 +148,17 @@ add_uboot()
ubootelf="$ubdir/u-boot"
[ -f "$ubootelf" ] || $err "cb/$target: Can't find u-boot"
cbfs "$tmprom" "$ubootelf" "fallback/payload"
cbfs "$tmprom" "$ubootelf" "fallback/payload"; cprom
}
cprom()
{
newrom="bin/$target/${pname}_${target}_$initmode$displaymode.rom"
[ $# -gt 0 ] && newrom="${newrom%.rom}_$1.rom"
x_ mkdir -p "bin/$target"
x_ cp "$tmprom" "$newrom" && [ $# -gt 0 ] && \
cbfs "$newrom" "config/data/grub/keymap/$1.gkb" keymap.gkb raw; :
}
mkcoreboottar()