diff options
author | Hauke Mehrtens <hauke@openwrt.org> | 2014-07-05 12:15:03 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@openwrt.org> | 2014-07-05 12:15:03 +0000 |
commit | 8b171622cd25e15f5015c29f4a8da49e9dab4249 (patch) | |
tree | 56265b8e2fdc01d6b256c7eac16c8e5a60876046 /target/linux | |
parent | fd84efb1699892f5a2e0b545e3b12bbe66dd9a08 (diff) | |
download | upstream-8b171622cd25e15f5015c29f4a8da49e9dab4249.tar.gz upstream-8b171622cd25e15f5015c29f4a8da49e9dab4249.tar.bz2 upstream-8b171622cd25e15f5015c29f4a8da49e9dab4249.zip |
brcm47xx: get switch name from swconfig first
Without this patch the switch config for the adm switch did not worked,
because hey are not names eth0.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41512 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rwxr-xr-x | target/linux/brcm47xx/base-files/etc/init.d/netconfig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/target/linux/brcm47xx/base-files/etc/init.d/netconfig b/target/linux/brcm47xx/base-files/etc/init.d/netconfig index ced2a42e70..3500058ff6 100755 --- a/target/linux/brcm47xx/base-files/etc/init.d/netconfig +++ b/target/linux/brcm47xx/base-files/etc/init.d/netconfig @@ -45,6 +45,8 @@ start() { local cpuport=5 [ -e /sbin/swconfig ] && cpuport=$(swconfig dev switch0 help 2>/dev/null | sed -ne "s|.*cpu @ \([0-9]*\).*|\1|p") + local switchname=eth0 + [ -e /sbin/swconfig ] && switchname=$(swconfig dev switch0 help 2>/dev/null | sed -ne "s|switch0: \([^\\\\(]*\).*|\1|p") local model=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo) local network_defs=`( @@ -224,14 +226,14 @@ start() { eval "$network_defs" [ -n "$vlan1ports" -o -n "$vlan2ports" ] && { - local cfg=`ucidef_add_switch "eth0" 1 1` + local cfg=`ucidef_add_switch "$switchname" 1 1` [ -n "$cfg" ] && uci rename network.$cfg=eth0 [ -n "$vlan1ports" ] && { - cfg=`ucidef_add_switch_vlan "eth0" 1 "$vlan1ports"` + cfg=`ucidef_add_switch_vlan "$switchname" 1 "$vlan1ports"` [ -n "$cfg" ] && uci rename network.$cfg=eth0_1 } [ -n "$vlan2ports" ] && { - cfg=`ucidef_add_switch_vlan "eth0" 2 "$vlan2ports"` + cfg=`ucidef_add_switch_vlan "$switchname" 2 "$vlan2ports"` [ -n "$cfg" ] && uci rename network.$cfg=eth0_2 } } |