From 636b86237fc778825a1f3b86f0f4c8dafd3a44e7 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 28 Jun 2024 16:24:07 +0100 Subject: vendor.sh: re-add modify_gbe() i accidentally deleted it in an earlier code purge Signed-off-by: Leah Rowe --- include/vendor.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'include') 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" +} -- cgit v1.2.1