mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-22 05:00:08 +02:00
vendor.sh: simplify modify_gbe()
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+5
-12
@@ -420,19 +420,12 @@ inject()
|
|||||||
|
|
||||||
modify_gbe()
|
modify_gbe()
|
||||||
{
|
{
|
||||||
printf "changing mac address in gbe to $new_mac\n"
|
chkvars CONFIG_GBE_BIN_PATH
|
||||||
[ -z "$CONFIG_GBE_BIN_PATH" ] && \
|
|
||||||
err "modify_gbe: $board: CONFIG_GBE_BIN_PATH not set"
|
|
||||||
|
|
||||||
_gbe_location=${CONFIG_GBE_BIN_PATH##*../}
|
e "${CONFIG_GBE_BIN_PATH##*../}" f n && $err "missing gbe file"
|
||||||
[ -f "$_gbe_location" ] || \
|
|
||||||
err "modify_gbe: $_gbe_location points to missing file"
|
|
||||||
x_ make -C util/nvmutil
|
x_ make -C util/nvmutil
|
||||||
|
|
||||||
_gbe_tmp=$(mktemp -t gbeXXXX.bin)
|
x_ cp "${CONFIG_GBE_BIN_PATH##*../}" "$TMPDIR/gbe"
|
||||||
x_ cp "$_gbe_location" "$_gbe_tmp"
|
x_ "$nvmutil" "$TMPDIR/gbe" setmac "$new_mac"
|
||||||
x_ "$nvmutil" "$_gbe_tmp" setmac "$new_mac"
|
x_ "$ifdtool" -i GbE:"$TMPDIR/gbe" "$1" -O "$1"
|
||||||
x_ "${ifdtool}" -i GbE:"$_gbe_tmp" "$1" -O "$1"
|
|
||||||
|
|
||||||
x_ rm -f "$_gbe_tmp"
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user