summaryrefslogtreecommitdiff
path: root/target/linux/ipq40xx/base-files/etc/board.d/02_network
blob: 03e0c0e16c33f43fafcbba9c5af4baf6dd73e425 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
#
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
# Copyright (c) 2011-2015 OpenWrt.org
#

. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh

board_config_update

board=$(board_name)

case "$board" in
8dev,jalapeno)
	ucidef_set_interfaces_lan_wan "eth0" "eth1"
	;;
asus,rt-ac58u)
	CI_UBIPART=UBI_DEV
	wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 20486)
	lan_mac_addr=$(mtd_get_mac_binary_ubi Factory 4102)
	ucidef_set_interfaces_lan_wan "eth0" "eth1"
	ucidef_add_switch "switch0" \
		"0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
	ucidef_set_interface_macaddr "lan" "$lan_mac_addr"
	ucidef_set_interface_macaddr "wan" "$wan_mac_addr"
	;;
avm,fritzbox-4040)
	ucidef_set_interfaces_lan_wan "eth0" "eth1"
	ucidef_add_switch "switch0" \
		"0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
	;;
compex,wpj428)
	ucidef_set_interface_lan "eth0 eth1"
	;;
glinet,gl-b1300)
	ucidef_set_interfaces_lan_wan "eth0" "eth1"
	ucidef_add_switch "switch0" \
		"0u@eth0" "3:lan" "4:lan"
	;;
openmesh,a42 |\
openmesh,a62)
	ucidef_set_interfaces_lan_wan "eth1" "eth0"
	;;
meraki,mr33 |\
netgear,ex6100v2 |\
netgear,ex6150v2 |\
zyxel,wre6606)
	ucidef_set_interface_lan "eth0"
	;;
*)
	echo "Unsupported hardware. Network interfaces not intialized"
	;;
esac

board_config_flush

exit 0