diff options
author | Leah Rowe <leah@libreboot.org> | 2023-09-30 18:41:57 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-09-30 19:09:25 +0100 |
commit | 0a0defd3256ff5e29e3b4d129a04fb7546bc31ac (patch) | |
tree | 479d686f0578b506dbe3f862300e73c090ed8bcc /script/build/boot/roms_helper | |
parent | 49b266eb4248f87d111e9babae86a873300afa03 (diff) |
simplify initialising variables in shell scripts
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/build/boot/roms_helper')
-rwxr-xr-x | script/build/boot/roms_helper | 48 |
1 files changed, 11 insertions, 37 deletions
diff --git a/script/build/boot/roms_helper b/script/build/boot/roms_helper index a92012e1..dcadc4b9 100755 --- a/script/build/boot/roms_helper +++ b/script/build/boot/roms_helper @@ -14,41 +14,21 @@ set -u -e read projectname < projectname +seavgabiosrom="elf/seabios/default/libgfxinit/vgabios.bin" +grub_background="background1280x800.png" +grubelf="elf/grub/grub.elf" cfgsdir="config/coreboot" - -blobs_required="" - -ubdir="" kmapdir="config/grub/keymap" -grub_timeout="" -grub_scan_disk="undefined" -tree="undefined" -arch="undefined" - # Disable all payloads by default. # target.cfg files have to specifically enable [a] payload(s) -payload_grub="n" -payload_grub_withseabios="n" # seabios chainloaded from grub -payload_seabios="n" -payload_seabios_withgrub="n" # i386-coreboot grub from SeaBIOS boot menu -payload_memtest="n" -payload_uboot="n" -uboot_config="undefined" - -romdir="" -cbdir="" -cbfstool="" -corebootrom="" -seavgabiosrom="elf/seabios/default/libgfxinit/vgabios.bin" -grub_background="background1280x800.png" +eval "$(setvars "n" payload_grub payload_grub_withseabios payload_seabios \ + payload_seabios_withgrub payload_memtest payload_uboot)" -initmode="" -displaymode="" -cbcfg="" -targetdir="" +eval "$(setvars "" romdir cbdir cbfstool corebootrom initmode displaymode \ + cbcfg targetdir grub_timeout ubdir blobs_required)" -grubelf="elf/grub/grub.elf" +eval "$(setvars "undefined" grub_scan_disk tree arch uboot_config)" # main() is in include/boot.sh @@ -120,13 +100,9 @@ configure_target() # Override all payload directives with cmdline args if [ ! -z ${_payload} ]; then printf "setting payload to: %s\n" "${_payload}" - payload_grub="n" - payload_grub_withseabios="n" # seabios chainloaded from grub - payload_seabios="n" - payload_seabios_withgrub="n" # i386-coreboot grub from SeaBIOS - payload_uboot="n" - payload_memtest="n" - + eval "$(setvars "n" payload_grub payload_grub_withseabios \ + payload_seabios payload_seabios_withgrub payload_uboot \ + payload_memtest)" eval "payload_${_payload}=y" fi } @@ -494,10 +470,8 @@ moverom() { [ -d "${newrompath%/*}" ] || mkdir -p "${newrompath%/*}/" || \ err "moverom: cannot create rom directory: \"${newrompath%/*}\"" - [ "${blobs_required}" = "n" ] && \ newrompath="${newrompath%.rom}_noblobs.rom" - cp "${rompath}" "${newrompath}" || err "moverom: can't copy rom" } |