[OpenWrt-Devel] [PATCH] ipq40xx: add label MAC address for FritzBox 4040

Adrian Schmutzler freifunk at adrianschmutzler.de
Mon Sep 23 10:31:38 EDT 2019


This adds label MAC address for the AVM FritzBox 4040, the first
device in ipq40xx target.

Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ipq40xx/base-files/etc/board.d/02_network | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index e5ba7260f3..082724ebfc 100755
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -77,6 +77,9 @@ ipq40xx_setup_macs()
 		wan_mac=$(mtd_get_mac_binary_ubi Factory 0x5006)
 		lan_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
 		;;
+	avm,fritzbox-4040)
+		label_mac=$(cat /sys/class/net/eth0/address)
+		;;
 	engenius,ens620ext)
 		wan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
 		lan_mac=$(macaddr_add "$wan_mac" 1)
@@ -89,6 +92,7 @@ ipq40xx_setup_macs()
 
 	[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
 	[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
+	[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
 }
 
 board_config_update
-- 
2.20.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list