fix up mac address setting on ixp4xx for devices that store this info in the RedBoot...
authorImre Kaloz <kaloz@openwrt.org>
Wed, 28 May 2008 19:54:47 +0000 (19:54 +0000)
committerImre Kaloz <kaloz@openwrt.org>
Wed, 28 May 2008 19:54:47 +0000 (19:54 +0000)
SVN-Revision: 11285

target/linux/ixp4xx/Makefile
target/linux/ixp4xx/base-files/etc/preinit.arch [new file with mode: 0755]

index e6b15e537bae52316edb5c960a5cd13fcd35193c..7b95752cbe34880f53841fc596d7e9472d83b513 100644 (file)
@@ -22,6 +22,6 @@ define Kernel/Configure
        $(if $(CONFIG_EABI_SUPPORT),echo '# CONFIG_OABI_COMPAT is not set' >> $(LINUX_DIR)/.config)
 endef
 
-DEFAULT_PACKAGES += ixp4xx-microcode
+DEFAULT_PACKAGES += ixp4xx-microcode fconfig
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/ixp4xx/base-files/etc/preinit.arch b/target/linux/ixp4xx/base-files/etc/preinit.arch
new file mode 100755 (executable)
index 0000000..1ee1d74
--- /dev/null
@@ -0,0 +1,8 @@
+RB_CONFIG="$(grep "RedBoot config" /proc/mtd | cut -d: -f1)"
+
+for npe in eth0 eth1
+do
+       if [ "$(ifconfig $npe 2>/dev/null | grep -c 00:00:00:00:00:00)" == "1" ]; then
+               ifconfig $npe hw ether $(fconfig -s -r -d /dev/$RB_CONFIG -n npe_"$npe"_esa)
+       fi
+done