lede/target/linux/ipq60xx/base-files/etc/board.d/02_network

45 lines
826 B
Bash

#!/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
ipq60xx_setup_interfaces()
{
local board="$1"
case "$board" in
qihoo,v6)
ucidef_set_interfaces_lan_wan "eth1 eth2 eth3" "eth0"
;;
*)
echo "Unsupported hardware. Network interfaces not initialized"
;;
esac
}
ipq60xx_setup_macs()
{
local board="$1"
case "$board" in
qihoo,v6)
lan_mac=$(mtd_get_mac_ascii factory lanMac)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
}
board_config_update
board=$(board_name)
ipq60xx_setup_interfaces $board
ipq60xx_setup_macs $board
board_config_flush
exit 0