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.
This commit is contained in:
Thomas Kaiser 2016-11-11 20:46:40 +01:00 committed by GitHub
parent 6f70bd974b
commit 76444a386f

View File

@ -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