diff options
author | Leah Rowe <leah@libreboot.org> | 2024-06-14 13:36:31 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2024-06-14 13:37:03 +0100 |
commit | 167e1a0fbe6765aaa5f5d3dc682709aa3c31260b (patch) | |
tree | 8dde0d22155b438140e3d2e22be8fb4197abe351 /include/mrc.sh | |
parent | 98724d701b10a037e8ffa7ce2864a08993268517 (diff) |
unified checks for variable initialisation
new function chkvars() does the job
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/mrc.sh')
-rwxr-xr-x | include/mrc.sh | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/mrc.sh b/include/mrc.sh index caf893a7..fddaef5d 100755 --- a/include/mrc.sh +++ b/include/mrc.sh @@ -8,9 +8,7 @@ eval "$(setvars "" MRC_url MRC_url_bkup MRC_hash MRC_board SHELLBALL)" extract_mrc() { - [ -z "$MRC_board" ] && $err "extract_mrc $MRC_hash: MRC_board not set" - [ -z "$CONFIG_MRC_FILE" ] && $err "$MRC_hash: CONFIG_MRC_FILE unset" - + chkvars "MRC_board" "CONFIG_MRC_FILE" SHELLBALL="chromeos-firmwareupdate-$MRC_board" ( @@ -49,7 +47,7 @@ extract_refcode() # cbfstool changed the attributes scheme for stage files, # incompatible with older versions before coreboot 4.14, # so we need coreboot 4.13 cbfstool for certain refcode files - [ -n "$cbfstoolref" ] || $err "$board: MRC_refcode_cbtree not set" + chkvars cbfstoolref mkdir -p "${_refdest%/*}" || $err "ref: !mkdir -p ${_refdest%/*}" "$cbfstoolref" "$appdir/bios.bin" extract \ |