aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh
blob: cfddd9cedcccc53128b359d13c49ff98030e9355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
. /lib/functions/system.sh

preinit_set_mac_address() {
	case $(board_name) in
	asus,tuf-ax4200)
		CI_UBIPART="UBI_DEV"
		addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
		ip link set dev eth0 address "$addr"
		ip link set dev eth1 address "$addr"
		;;
	mercusys,mr90x-v1)
		addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
		ip link set dev eth1 address "$(macaddr_add $addr 1)"
		;;
	*)
		;;
	esac
}

boot_hook_add preinit_main preinit_set_mac_address