summaryrefslogtreecommitdiff
path: root/include/vendor.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-28 16:24:07 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-28 16:24:07 +0100
commit636b86237fc778825a1f3b86f0f4c8dafd3a44e7 (patch)
treeb91b5311f99203ae03b7718a9330d7aecc09aa09 /include/vendor.sh
parent2eb0163cc78e61f424f26798b3416d371e0818d0 (diff)
vendor.sh: re-add modify_gbe()
i accidentally deleted it in an earlier code purge Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/vendor.sh')
-rwxr-xr-xinclude/vendor.sh22
1 files changed, 21 insertions, 1 deletions
diff --git a/include/vendor.sh b/include/vendor.sh
index 54d1750a..fd726acb 100755
--- a/include/vendor.sh
+++ b/include/vendor.sh
@@ -331,7 +331,7 @@ patch_release_roms()
[ "$modifygbe" = "true" ] && \
for x in "$_tmpdir"/bin/*/*.rom ; do
- modify_gbe "$x"
+ [ -f "$x" ] && modify_gbe "$x"
done
[ -d "bin/release" ] || x_ mkdir -p bin/release
@@ -419,3 +419,23 @@ inject()
fi
fi
}
+
+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"
+
+ rom="$1"
+ _gbe_location=${CONFIG_GBE_BIN_PATH##*../}
+ [ -f "$_gbe_location" ] || \
+ err "modify_gbe: $_gbe_location points to missing 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" "$rom" -O "$rom"
+
+ x_ rm -f "$_gbe_tmp"
+}