diff options
author | Leah Rowe <leah@libreboot.org> | 2024-06-28 21:43:23 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2024-06-28 21:43:23 +0100 |
commit | 155ce49b17e39a12b6e3ead684a5e302416f471c (patch) | |
tree | 8cafa29208cdb1c0b53b4790217fa07feced0ede /include/vendor.sh | |
parent | 08bce7ad3b26706fc6d445bd226fe4e4c5851f5e (diff) |
vendor.sh: simplify modify_gbe()
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/vendor.sh')
-rwxr-xr-x | include/vendor.sh | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/include/vendor.sh b/include/vendor.sh index 22d5a76d..f996e377 100755 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -420,19 +420,12 @@ inject() modify_gbe() { - printf "changing mac address in gbe to $new_mac\n" - [ -z "$CONFIG_GBE_BIN_PATH" ] && \ - err "modify_gbe: $board: CONFIG_GBE_BIN_PATH not set" + chkvars CONFIG_GBE_BIN_PATH - _gbe_location=${CONFIG_GBE_BIN_PATH##*../} - [ -f "$_gbe_location" ] || \ - err "modify_gbe: $_gbe_location points to missing file" + e "${CONFIG_GBE_BIN_PATH##*../}" f n && $err "missing gbe file" x_ make -C util/nvmutil - _gbe_tmp=$(mktemp -t gbeXXXX.bin) - x_ cp "$_gbe_location" "$_gbe_tmp" - x_ "$nvmutil" "$_gbe_tmp" setmac "$new_mac" - x_ "${ifdtool}" -i GbE:"$_gbe_tmp" "$1" -O "$1" - - x_ rm -f "$_gbe_tmp" + x_ cp "${CONFIG_GBE_BIN_PATH##*../}" "$TMPDIR/gbe" + x_ "$nvmutil" "$TMPDIR/gbe" setmac "$new_mac" + x_ "$ifdtool" -i GbE:"$TMPDIR/gbe" "$1" -O "$1" } |