summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"
+}