summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-09-28 02:28:51 +0100
committerLeah Rowe <leah@libreboot.org>2023-09-28 02:28:51 +0100
commit178b888aa05ce367d4cf975f329bf488e4868f6e (patch)
tree0170aa393227f935b517264b3bbbe1874a3accd8 /include
parente9e1a3b4aea2a1d1db13149c342a3aca24ea5c78 (diff)
include/blobutil: properly set global variables
I was setting certain global variables inside for loops, but some sh implementations won't like this. Instead, don't run eval inside the for loops. Set a string for eval inside the for loops, then execute eval outside of the loops. This should work on every shell. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
-rwxr-xr-xinclude/blobutil.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/blobutil.sh b/include/blobutil.sh
index eb3ef6af..6c78b381 100755
--- a/include/blobutil.sh
+++ b/include/blobutil.sh
@@ -9,16 +9,17 @@ _b=""
blobdir="blobs"
appdir="${blobdir}/app"
-for x in EC_url EC_url_bkup EC_hash DL_hash DL_url DL_url_bkup dl_path \
+setvars="EC_url=\"\""
+for x in EC_url_bkup EC_hash DL_hash DL_url DL_url_bkup dl_path \
E6400_VGA_DL_hash E6400_VGA_DL_url E6400_VGA_DL_url_bkup E6400_VGA_offset \
E6400_VGA_romname SCH5545EC_DL_url SCH5545EC_DL_url_bkup \
SCH5545EC_DL_hash; do
- eval "${x}=\"\""
+ setvars="${setvars}; ${x}=\"\""
done
for x in sname archive _filetype rom board modifygbe new_mac release \
releasearchive vendor_rom; do
- eval "${x}=\"\""
+ setvars="${setvars}; ${x}=\"\""
done
cbdir="coreboot/default"
@@ -43,5 +44,7 @@ for x in _me_destination _gbe_destination _ifd_destination \
CONFIG_VGA_BIOS_FILE CONFIG_VGA_BIOS_ID CONFIG_GBE_BIN_PATH \
CONFIG_INCLUDE_SMSC_SCH5545_EC_FW CONFIG_SMSC_SCH5545_EC_FW_FILE \
CONFIG_IFD_BIN_PATH; do
- eval "${x}=\"\""
+ setvars="${setvars}; ${x}=\"\""
done
+
+eval "${setvars}"