coreboot target.cfg: permit GRUB as primary payload

Dell OptiPlex 3050 Micro support was added to Libreboot,
which we can't add in Canoeboot, but SeaBIOS hung on that
board so we made GRUB the primary payload on that board.

SeaGRUB is still enforced on all Canoeboot targets at
present, but we want cbmk to maintain parity with lbmk.

Therefore, import this functionality into cbmk, but without
actually using it.

Add two variable options for target.cfg files:

* seabiosname
* grubname

This string defines where it would be located in CBFS.

Signed-off-by: Leah Rowe <leah@libreboot.org>
master
Leah Rowe 2024-10-06 09:21:08 +01:00 committed by Leah Rowe
parent 4c08c390dd
commit b6036e81d2
2 changed files with 7 additions and 4 deletions

View File

@ -116,9 +116,10 @@ mkcorebootbin()
add_seabios() add_seabios()
{ {
[ -n "$seabiosname" ] || seabiosname="fallback/payload"
_seabioself="elf/seabios/default/$initmode/bios.bin.elf" _seabioself="elf/seabios/default/$initmode/bios.bin.elf"
cbfs "$tmprom" "$_seabioself" "fallback/payload" cbfs "$tmprom" "$_seabioself" "$seabiosname"
x_ "$cbfstool" "$tmprom" add-int -i 3000 -n etc/ps2-keyboard-spinup x_ "$cbfstool" "$tmprom" add-int -i 3000 -n etc/ps2-keyboard-spinup
_z="2"; [ "$initmode" = "vgarom" ] && _z="0" _z="2"; [ "$initmode" = "vgarom" ] && _z="0"
@ -137,7 +138,8 @@ add_seabios()
add_grub() add_grub()
{ {
cbfs "$tmprom" "$grubelf" "img/grub2" [ -n "$grubname" ] || grubname="img/grub2"
cbfs "$tmprom" "$grubelf" "$grubname"
printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" \ printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" \
> "$TMPDIR/tmpcfg" || $err "$target: !insert scandisk" > "$TMPDIR/tmpcfg" || $err "$target: !insert scandisk"
cbfs "$tmprom" "$TMPDIR/tmpcfg" scan.cfg raw cbfs "$tmprom" "$TMPDIR/tmpcfg" scan.cfg raw

View File

@ -12,7 +12,8 @@ set -u -e
eval `setvars "" xarch srcdir premake cmakedir xlang mode makeargs elfdir cmd \ eval `setvars "" xarch srcdir premake cmakedir xlang mode makeargs elfdir cmd \
project target target_dir targets xtree _f release bootstrapargs mkhelper \ project target target_dir targets xtree _f release bootstrapargs mkhelper \
autoconfargs listfile autogenargs btype tree rev tree_depend build_depend \ autoconfargs listfile autogenargs btype tree rev tree_depend build_depend \
defconfig postmake mkhelpercfg dry dest_dir mdir cleanargs`; badhash="n" defconfig postmake mkhelpercfg dry dest_dir mdir cleanargs seabiosname \
grubname`; badhash="n"
main() main()
{ {
@ -112,7 +113,7 @@ configure_project()
{ {
eval `setvars "" xarch xlang build_depend autoconfargs xtree postmake \ eval `setvars "" xarch xlang build_depend autoconfargs xtree postmake \
tree_depend makeargs btype mkhelper bootstrapargs premake release \ tree_depend makeargs btype mkhelper bootstrapargs premake release \
cleanargs` cleanargs grubname seabiosname`
_tcfg="$1/target.cfg"; badhash="n"; [ -f "$_tcfg" ] || btype="auto" _tcfg="$1/target.cfg"; badhash="n"; [ -f "$_tcfg" ] || btype="auto"
[ -f "$datadir/mkhelper.cfg" ] && eval `setcfg "$datadir/mkhelper.cfg"` [ -f "$datadir/mkhelper.cfg" ] && eval `setcfg "$datadir/mkhelper.cfg"`