diff options
| author | Linus Walleij | 2024-12-20 23:59:27 +0000 |
|---|---|---|
| committer | Linus Walleij | 2025-01-02 01:29:51 +0000 |
| commit | d15da125eb14858ff68c33c0dcdf5aaeb7d3a004 (patch) | |
| tree | ff2b46ec8703c65b08b327b6268c2be138347ad8 | |
| parent | 6e2a842d624ae5a6852232dc860a012c22db2bb9 (diff) | |
| download | openwrt-d15da125eb14858ff68c33c0dcdf5aaeb7d3a004.tar.gz | |
ixp4xx: Support single zcom_npe_esa hw address
Some ixp4xx platforms with a proper RedBoot config do not
contain the per-ethernet interface npe_eth0_esa, but rather
a single entry named zcom_npe_esa.
Let's use this if fconfig can't find the primary key.
This is needed on the Netgear WG302 v1.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| -rw-r--r-- | target/linux/ixp4xx/base-files/lib/preinit/05_set_ether_mac_ixp4xx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/target/linux/ixp4xx/base-files/lib/preinit/05_set_ether_mac_ixp4xx b/target/linux/ixp4xx/base-files/lib/preinit/05_set_ether_mac_ixp4xx index 9e7ff46298..c58eb96f2a 100644 --- a/target/linux/ixp4xx/base-files/lib/preinit/05_set_ether_mac_ixp4xx +++ b/target/linux/ixp4xx/base-files/lib/preinit/05_set_ether_mac_ixp4xx @@ -5,8 +5,12 @@ set_from_redboot () { for npe in eth0 eth1 eth2 do + mac="$(fconfig -s -r -d /dev/$1 -n npe_"$npe"_esa)" + if [ -z $mac ] ; then + mac="$(fconfig -s -r -d /dev/$1 -n zcom_npe_esa)" + fi if ip link show dev $npe > /dev/null 2>&1; then - ip link set dev $npe address $(fconfig -s -r -d /dev/$1 -n npe_"$npe"_esa) + ip link set dev $npe address $mac fi done |