brcm63xx: move preinit ifname detection to the preinit script
authorJonas Gorski <jogo@openwrt.org>
Mon, 16 Mar 2015 11:53:06 +0000 (11:53 +0000)
committerJonas Gorski <jogo@openwrt.org>
Mon, 16 Mar 2015 11:53:06 +0000 (11:53 +0000)
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
SVN-Revision: 44839

target/linux/brcm63xx/base-files/lib/brcm63xx.sh
target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx

index 52e4f96fa1d91124dc7f2494716c7f45083d2a33..058833963fa34fc6ee391d298b2b60c2f1794ea4 100755 (executable)
@@ -255,105 +255,6 @@ brcm63xx_detect() {
                board_name=$(brcm63xx_legacy_detect "$board_id")
        fi
 
-       case "$board_name" in
-       bcm963281tan)
-               ifname=eth0
-               ;;
-       a4001n1)
-               ifname=eth0
-               ;;
-       bcm96328avng)
-               ifname=eth0
-               ;;
-       a4001n)
-               ifname="eth0"
-               ;;
-       ar-5381u)
-               ifname=eth0
-               ;;
-       ar-5387un)
-               ifname=eth0
-               ;;
-       bcm96348gw)
-               ifname=eth1
-               ;;
-       bcm96348gw-11)
-               ifname=eth1
-               ;;
-       spw303v)
-               ifname=eth0
-               ;;
-       vr-3025un)
-               ifname="eth0"
-               ;;
-       vr-3025u)
-               ifname="eth0"
-               ;;
-       wap-5813n)
-               ifname="eth0"
-               ;;
-       dsl-274xb-c)
-               ifname=eth0
-               ;;
-       dsl-275xb-d)
-               ifname=eth0
-               ;;
-       cpva642)
-               ifname=eth0
-               ;;
-       ct536_ct5621)
-               ifname=eth0
-               ;;
-       cvg834g)
-               ifname=eth0
-               ;;
-       dsl-2640b-b)
-               ifname=eth0
-               ;;
-       dgnd3700v1_dgnd3800b)
-               ifname="eth0"
-               ;;
-       fast2504n)
-               ifname=eth0
-               ;;
-       fast2704v2)
-               ifname=eth0
-               ;;
-       gw6000)
-               ifname=eth1
-               ;;
-       gw6200)
-               ifname=eth1
-               ;;
-       hg553)
-               ifname=eth0
-               ;;
-       hg556a_*)
-               ifname=eth0
-               ;;
-       hg520)
-               ifname="eth0"
-               ;;
-       neufbox6)
-               ifname=eth0
-               ;;
-       p870hw-51a_v2)
-               ifname="eth0"
-               ;;
-       rta770bw)
-               ifname=eth0
-               ;;
-       rta770w)
-               ifname=eth0
-               ;;
-       spw500v)
-               ifname=eth0
-               ;;
-       v2110)
-               ifname=eth0
-               ;;
-       esac
-
        [ -e "/tmp/sysinfo" ] || mkdir -p "/tmp/sysinfo"
 
        echo "$board_name" > /tmp/sysinfo/board_name
index 1de59b79c0665be47971c1357fc22aea7534921e..a8bf6c621eb7b5a8a5a69d40edbc96c6448bc90d 100644 (file)
@@ -1,7 +1,46 @@
 #!/bin/sh
 
+. /lib/brcm63xx.sh
+
 set_preinit_iface() {
-       ifconfig $ifname 0.0.0.0 up
+       case "$(brcm63xx_board_name)" in
+       a4001n |\
+       a4001n1 |\
+       ar-5381u |\
+       ar-5387un |\
+       bcm963281tan |\
+       bcm96328avng |\
+       cpva642 |\
+       ct536_ct5621 |\
+       cvg834g |\
+       dgnd3700v1_dgnd3800b |\
+       dsl-2640b-b |\
+       dsl-274xb-c |\
+       dsl-275xb-d |\
+       fast2504n |\
+       fast2704v2 |\
+       hg553 |\
+       hg556a_* |\
+       hg520 |\
+       neufbox6 |\
+       p870hw-51a_v2 |\
+       rta770bw |\
+       rta770w |\
+       spw303v |\
+       spw500v |\
+       v2110 |\
+       vr-3025un |\
+       vr-3025u |\
+       wap-5813n)
+               ifname=eth0
+               ;;
+       bcm96348gw |\
+       bcm96348gw-11 |\
+       gw6000 |\
+       gw6200)
+               ifname=eth1
+               ;;
+       esac
 }
 
 boot_hook_add preinit_main set_preinit_iface