The eth0 assignment never takes effect. 05_set_preinit_iface brings eth0
up in its default case before 10_fix_eth_mac.sh runs, and the kernel
refuses a MAC change on a running interface, so ip link fails with EBUSY.
This script cannot run any earlier either, since it needs /tmp/tp_data
mounted by 09_mount_cfg_part.
Nothing is lost by dropping it: the DSA user ports carry their own
addresses, which the lan1-3 assignments below already take care of, and
br-lan takes its address from them.
Verified on a BE450 running an image built from main: eth0 comes up with
a different random address on every boot regardless of this line, while
lan1-3 and br-lan keep the label MAC across reboots even with no macaddr
in /etc/config/network.
Fixes: 1513da34bb1a ("mediatek: filogic: set eth0 and LAN port MACs on TP-Link BE450")
Signed-off-by: Semih Baskan <strst.gs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24325
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
;;
tplink,be450)
addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
- ip link set dev eth0 address "$addr"
ip link set dev lan1 address "$addr"
ip link set dev lan2 address "$addr"
ip link set dev lan3 address "$addr"