ath79: add mikrotik subtarget
[openwrt/staging/chunkeey.git] / target / linux / ath79 / mikrotik / base-files / etc / board.d / 02_network
1 #!/bin/sh
2
3 . /lib/functions/system.sh
4 . /lib/functions/uci-defaults.sh
5
6 ath79_setup_interfaces()
7 {
8 local board="$1"
9
10 case "$board" in
11 mikrotik,routerboard-922uags-5hpacd|\
12 mikrotik,routerboard-wap-g-5hact2hnd)
13 ucidef_set_interface_lan "eth0"
14 ;;
15 *)
16 ucidef_set_interfaces_lan_wan "eth0" "eth1"
17 ;;
18 esac
19 }
20
21 ath79_setup_macs()
22 {
23 local board="$1"
24
25 case "$board" in
26 esac
27
28 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
29 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
30 [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
31 }
32
33 board_config_update
34 board=$(board_name)
35 ath79_setup_interfaces $board
36 ath79_setup_macs $board
37 board_config_flush
38
39 exit 0