Quantcast
Channel: Linux Device Hacking
Viewing all articles
Browse latest Browse all 3247

Armada: Setting persistent MAC address. (1 reply)

$
0
0
The default Armada rootfs has a script /root/set_persistent_mac_address which is called from /etc/rc.local to read the MAC address of the NIC from u-boot environment, and set it to the NIC.
Problem is that it is called after the networking is already up, which means the NAS first requests an IP address by DHCP on a random MAC address, and then another time using the 'real' MAC address, littering the logs of the DHCP server.

After adding a line
[ "${IFACE}" != "eth0" ] && exit 0
as first command, and removing the ifup and ifdown line, the script can placed in /etc/network/if-pre-up.d/, and will be called just before eth0 will go up.

(BTW, the call in /etc/rc.local
# Work around to set persistent MAC address in Armada boxes
if [ -f /root/set_persistent_mac_address ]; then
	/root/set_persistent_mac_address
fi
has a bug, -f should be -x)

Viewing all articles
Browse latest Browse all 3247

Trending Articles