kernel-module-atheros: Set mac address from kernel command line.

The bootloader is passing the mac address in the kernel command line.

The driver startup script reads it and sets it.

Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
This commit is contained in:
Alex Gonzalez 2013-01-25 13:54:17 +01:00
parent ccab60099b
commit ad9436f733
1 changed files with 4 additions and 5 deletions

View File

@ -24,15 +24,14 @@ RAM_DRIVE="/var/run"
MAC_FILENAME="softmac"
#
# Get the wlan MAC address from NVRAM. Use a default
# Get the wlan MAC address from kernel command line. Use a default
# value if the address has not been set.
#
# TODO: Hardcoded until passed to kernel command line from U-Boot.
#MAC_ADDR="$(nvram print module ethaddr2 | sed 's,ethaddr2=,,g')"
#if [ -z "${MAC_ADDR}" -o "${MAC_ADDR}" = "00:00:00:00:00:00" ]; then
MAC_ADDR=`cat /proc/cmdline | sed 's/\s/\n/g' | awk '/ethaddr2/ {print}' | sed 's/ethaddr2=//g'`
if [ -z "${MAC_ADDR}" -o "${MAC_ADDR}" = "00:00:00:00:00:00" ]; then
MAC_ADDR="00:04:F3:4C:B1:D3"
#fi
fi
mac1="$(echo ${MAC_ADDR} | cut -d':' -f1)"
mac2="$(echo ${MAC_ADDR} | cut -d':' -f2)"