From ad9436f7338d73b0ea283b35a932847489fdf083 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Fri, 25 Jan 2013 13:54:17 +0100 Subject: [PATCH] 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 --- .../recipes-kernel/kernel-module-atheros/files/atheros | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/meta-digi-arm/recipes-kernel/kernel-module-atheros/files/atheros b/meta-digi-arm/recipes-kernel/kernel-module-atheros/files/atheros index dfcb1abfa..9f6944034 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-atheros/files/atheros +++ b/meta-digi-arm/recipes-kernel/kernel-module-atheros/files/atheros @@ -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)"