2
0
forked from Ivasoft/openwrt

lantiq: reorganize 02_network board.d files

This reorganizes 02_network board.d files based on what's done for
ath79 and ramips: Instead of putting all settings into a single big
case, the interface/dsl/MAC address setup is put into separate
functions with a specific switch case for each of them. This makes
grouping of devices much easier and should be easier to read, too.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler
2019-12-17 14:37:26 +01:00
parent 18e089aaed
commit 2fe464a712
5 changed files with 393 additions and 291 deletions

View File

@@ -7,21 +7,46 @@
. /lib/functions/system.sh
. /lib/functions/lantiq.sh
lantiq_setup_interfaces()
{
local board="$1"
case "$board" in
*)
ucidef_set_interface_lan 'eth0'
;;
esac
}
lantiq_setup_dsl()
{
local board="$1"
local annex="a"
case "$board" in
esac
lantiq_setup_dsl_helper "$annex"
}
lantiq_setup_macs()
{
local board="$1"
local lan_mac=""
local wan_mac=""
case "$board" in
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
}
board_config_update
annex="a"
lan_mac=""
wan_mac=""
ucidef_set_interface_lan 'eth0'
lantiq_setup_dsl_helper "$annex"
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
board=$(board_name)
lantiq_setup_interfaces $board
lantiq_setup_dsl $board
lantiq_setup_macs $board
board_config_flush
exit 0