mirror of
https://github.com/openwrt/openwrt.git
synced 2025-04-12 21:53:23 +00:00
mediatek: store random MAC address in U-Boot env on first boot
For devboards without a MAC address assigned from factory, store the random MAC in U-Boot env on first boot to make it persistent. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
parent
31872a38be
commit
f5278bf820
@ -0,0 +1,14 @@
|
||||
[ ! -e /etc/fw_env.config ] && exit 0
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
case "$(board_name)" in
|
||||
bananapi,bpi-r2|\
|
||||
bananapi,bpi-r64|\
|
||||
unielec,u7623-02)
|
||||
[ -z "$(fw_printenv -n ethaddr 2>/dev/null)" ] &&
|
||||
fw_setenv ethaddr "$(cat /sys/class/net/eth0/address)"
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
Loading…
x
Reference in New Issue
Block a user