From 5e50515fa6b3e2ddfd7ffb478b2111dc589dfd4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20VAR=C3=88NE?= Date: Mon, 20 Apr 2020 14:35:57 +0200 Subject: ramips/mt7621: mikrotik: don't use mtd-mac-address in DTS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As evidenced here[1] the device MAC address can be stored at a random offset in the hard_config partition. Rely on sysfs to update the MAC address correctly. Adjust config so that WAN is base MAC and LAN is base MAC +1 to better match label and vendor OS. [1] https://github.com/openwrt/openwrt/pull/2850#issuecomment-610809021 Signed-off-by: Thibaut VARĂˆNE --- target/linux/ramips/mt7621/base-files/etc/board.d/02_network | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'target/linux/ramips/mt7621/base-files') diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 43db9c6f64..34be067085 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -91,9 +91,12 @@ ramips_setup_macs() wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) label_mac=$wan_mac ;; + mikrotik,routerboard-750gr3|\ mikrotik,routerboard-m11g|\ mikrotik,routerboard-m33g) - label_mac=$(mtd_get_mac_binary hard_config 0x10) + label_mac=$(cat "/sys/firmware/mikrotik/hard_config/mac_base") + wan_mac=$label_mac + lan_mac=$(macaddr_add $label_mac 1) ;; zbtlink,zbt-we1326|\ zbtlink,zbt-wg3526-16m|\ -- cgit v1.2.3