From abbcbb92283d8cdb22828122ca476f5d8dd9f782 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 28 Apr 2024 03:00:50 +0100 Subject: [PATCH] mediatek: bpi-r3-mini: persist WiFi and WAN MAC addresses Derive WAN and WiFi MAC addresses from the (random) MAC address stored in the U-Boot environment. Signed-off-by: Daniel Golle --- .../linux/mediatek/filogic/base-files/etc/board.d/02_network | 3 ++- .../filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 51e02efb39..597754da7b 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -119,7 +119,8 @@ mediatek_setup_macs() local label_mac="" case $board in - bananapi,bpi-r3) + bananapi,bpi-r3|\ + bananapi,bpi-r3-mini) wan_mac=$(macaddr_add $(cat /sys/class/net/eth0/address) 1) ;; cmcc,rax3000m) diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index bd6e775963..53c9b7f259 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -36,7 +36,8 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress ;; - bananapi,bpi-r3) + bananapi,bpi-r3|\ + bananapi,bpi-r3-mini) addr=$(cat /sys/class/net/eth0/address) [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress -- 2.30.2