blob: 5fd7d003beffbc123f71ced28df30bedfd70954b [file] [log] [blame]
developerfd40db22021-04-29 10:08:25 +08001diff --git a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
2index 3a409c8..4b19c0d 100755
3--- a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
4+++ b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
5@@ -29,9 +29,25 @@ mediatek_setup_interfaces()
6 mediatek_setup_macs()
7 {
8 local board="$1"
9+ local part_name="Factory"
10+ local lan_mac=""
11+ local wan_mac=""
12+ local lan_mac_offset=""
13+ local wan_mac_offset=""
14
15 case $board in
16+ *)
17+ #512k - 12 byte
18+ lan_mac_offset="0x7FFF4"
19+ wan_mac_offset="0x7FFFA"
20+ ;;
21 esac
22+
23+ lan_mac=$(mtd_get_mac_binary $part_name $lan_mac_offset)
24+ wan_mac=$(mtd_get_mac_binary $part_name $wan_mac_offset)
25+
26+ [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
27+ [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
28 }
29
30 board_config_update