Revert "mvebu: simplify etc/board.d/02_network"
[openwrt/openwrt.git] / target / linux / mvebu / base-files / etc / board.d / 02_network
1 #!/bin/sh
2 #
3 # Copyright (C) 2014-2016 OpenWrt.org
4 # Copyright (C) 2016 LEDE-Project.org
5 #
6
7 . /lib/functions/uci-defaults.sh
8 . /lib/mvebu.sh
9
10 board_config_update
11
12 board=$(mvebu_board_name)
13
14 case "$board" in
15 armada-385-linksys-caiman|\
16 armada-385-linksys-cobra|\
17 armada-385-linksys-rango|\
18 armada-385-linksys-shelby)
19 ucidef_set_interfaces_lan_wan "eth1" "eth0"
20 ucidef_add_switch "switch0" \
21 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "6@eth1" "4:wan" "5@eth0"
22 ;;
23 armada-xp-linksys-mamba)
24 ucidef_set_interfaces_lan_wan "eth0" "eth1"
25 ucidef_add_switch "switch0" \
26 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0" "4:wan" "6@eth1"
27 ;;
28 armada-385-db-ap)
29 ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
30 ;;
31 armada-xp-gp)
32 ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
33 ;;
34 armada-388-clearfog)
35 ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
36 swconfig list 2>&1 | grep -q switch0 && \
37 ucidef_add_switch "switch0" \
38 "0:lan:5" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5@eth0" "6:lan:6"
39 ;;
40 *)
41 ucidef_set_interface_lan "eth0"
42 ;;
43 esac
44
45 board_config_flush
46
47 exit 0