From 76444a386f652a9800f968c98cc56c87aecd7456 Mon Sep 17 00:00:00 2001 From: Thomas Kaiser Date: Fri, 11 Nov 2016 20:46:40 +0100 Subject: [PATCH] Permanent MAC address for xradio_wlan This is a workaround for now, we should patch driver to derive MAC address from SID. Also needs firmware included in image to work. --- scripts/firstrun | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/firstrun b/scripts/firstrun index d7cad549f5..51866eaad4 100644 --- a/scripts/firstrun +++ b/scripts/firstrun @@ -120,6 +120,12 @@ adjust_sunxi_settings() { sed -i "s/^MAC_ADDR=.*/MAC_ADDR=${MACADDR}/" /etc/default/ap6212 \ echo -e "\n### [firstrun] Use MAC address ${MACADDR} for Bluetooth from now" >>${Log}) + # set current OPi Zero WiFi address permanently + [[ "$(lsmod | grep xradio_wlan)" != "" ]] && \ + (MACADDR=$(ifconfig wlan0 | awk -F" " '/^wlan0/ {print $5}' | tr '[:lower:]' '[:upper:]') ; \ + echo "options xradio_wlan macaddr=${MACADDR}" > /etc/modprobe.d/xradio_wlan.conf ; \ + echo -e "\n### [firstrun] Use MAC address ${MACADDR} for Wi-Fi from now" >>${Log}) + # change serial port for BT on NanoPi Air # relink /etc/network/interfaces on OPi Lite and NanoPi Air case ${BOARD_NAME} in