From 42e77e6f5a53d842ca89531f2bb476a1181f362d Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 16 Jan 2023 12:57:15 +0100 Subject: [PATCH] ipq807x: fix MAC assignment on WF188n Fixes: WIFI-12090 Signed-off-by: John Crispin --- .../ipq807x/ipq807x/base-files/etc/board.d/02_network | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network b/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network index e8bf0d09a..7d1ccdc65 100755 --- a/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network +++ b/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network @@ -96,9 +96,13 @@ qcom_setup_macs() local board="$1" case $board in + cig,wf188n|\ cig,wf194c|\ cig,wf194c4) - mac=$(grep BaseMacAddress= /dev/mtd14 | cut -dx -f2) + mtd=$(find_mtd_chardev "0:APPSBLENV") + [ -z "$mtd" ] && return; + mac=$(grep BaseMacAddress= $mtd | cut -dx -f2) + [ -z "$mac" ] && return; wan_mac=$(macaddr_canonicalize $mac) lan_mac=$(macaddr_add "$wan_mac" 1) ucidef_set_network_device_mac eth0 $lan_mac @@ -108,7 +112,10 @@ qcom_setup_macs() ucidef_set_label_macaddr $wan_mac ;; cig,wf196) - mac=$(grep BaseMacAddress= /dev/mtd14 | cut -dx -f2) + mtd=$(find_mtd_chardev "0:APPSBLENV") + [ -z "$mtd" ] && return; + mac=$(grep BaseMacAddress= $mtd | cut -dx -f2) + [ -z "$mac" ] && return; wan_mac=$(macaddr_canonicalize $mac) lan_mac=$(macaddr_add "$wan_mac" 1) ucidef_set_network_device_mac eth1 $lan_mac