summaryrefslogtreecommitdiffstats
path: root/target/linux/ixp4xx
diff options
context:
space:
mode:
authorkaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-05-28 19:54:47 +0000
committerkaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-05-28 19:54:47 +0000
commit34bf542fa5be40f4363c5b256df997ee86a5fb08 (patch)
treed1971697e738f42a2ed3c1c3d77fba60711cd93d /target/linux/ixp4xx
parent80d7a5ac9fb71a9e9472d1e88c747509b3825e72 (diff)
fix up mac address setting on ixp4xx for devices that store this info in the RedBoot config partition
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11285 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ixp4xx')
-rw-r--r--target/linux/ixp4xx/Makefile2
-rwxr-xr-xtarget/linux/ixp4xx/base-files/etc/preinit.arch8
2 files changed, 9 insertions, 1 deletions
diff --git a/target/linux/ixp4xx/Makefile b/target/linux/ixp4xx/Makefile
index e6b15e537..7b95752cb 100644
--- a/target/linux/ixp4xx/Makefile
+++ b/target/linux/ixp4xx/Makefile
@@ -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
index 000000000..1ee1d7404
--- /dev/null
+++ b/target/linux/ixp4xx/base-files/etc/preinit.arch
@@ -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