diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/init.sh | 4 | ||||
-rw-r--r-- | include/rom.sh | 27 |
2 files changed, 31 insertions, 0 deletions
diff --git a/include/init.sh b/include/init.sh index 6bed6ca4..96247908 100644 --- a/include/init.sh +++ b/include/init.sh @@ -60,6 +60,10 @@ xbmk_init() export PWD="$xbmkpwd" x_ xbmkdir "$basetmp" + if [ ! -e "cache" ]; then + x_ xbmkdir "cache" + fi + for init_cmd in get_version set_env set_threads git_init child_exec; do if ! xbmk_$init_cmd "$@"; then break diff --git a/include/rom.sh b/include/rom.sh index 2efe4919..b1c3c559 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -175,6 +175,9 @@ mkcorebootbin_real() initmode="${initmode%%_*}" cbfstool="elf/coreboot/$tree/cbfstool" + # cbfstool option backends, if they exist + cbfscfg="config/coreboot/$target/cbfs.cfg" + elfrom="elf/coreboot/$tree/$target/$initmode" if [ -n "$displaymode" ]; then elfrom="${elfrom}_$displaymode" @@ -232,6 +235,11 @@ mkcorebootbin_real() payload_grubsea="n" fi + if [ -f "$cbfscfg" ]; then + $if_not_dry_build \ + dx_ add_cbfs_option "$cbfscfg" + fi + if $if_not_dry_build grep "CONFIG_PAYLOAD_NONE=y" "$defconfig"; then if [ "$payload_seabios" = "y" ]; then pname="seabios" @@ -250,6 +258,25 @@ mkcorebootbin_real() fi; : } +# options for cbfs backend (as opposed to nvram/smmstore): + +add_cbfs_option() +{ + # TODO: input sanitization (currently mitigated by careful config) + + op_name="`printf "%s\n" "$1" | awk '{print $1}'`" + op_arg="`printf "%s\n" "$1" | awk '{print $2}'`" + + if [ -z "$op_name" ] || [ -z "$op_arg" ]; then + return 0 + fi + + ( x_ "$cbfstool" "$tmprom" remove -n "option/$op_name" 1>/dev/null \ + 2>/dev/null ) || : + + x_ "$cbfstool" "$tmprom" add-int -i "$op_arg" -n "option/$op_name" +} + # in our design, SeaBIOS is also responsible for starting either # a GRUB or U-Boot payload. this is because SeaBIOS is generally # a more reliable codebase, so it's less likely to cause a brick |