oxnas: rework 02_network

Just like other targets do, introduce two setup functions for interfaces and
MAC addresses.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
master
Sungbo Eo 2020-03-16 02:42:38 +09:00
parent 9559a3304e
commit 8adcfe289c
1 changed files with 25 additions and 9 deletions

View File

@ -3,10 +3,6 @@
. /lib/functions/uci-defaults.sh . /lib/functions/uci-defaults.sh
. /lib/functions/system.sh . /lib/functions/system.sh
board_config_update
lan_mac=""
bootloader_cmdline_var() { bootloader_cmdline_var() {
local param local param
local pval local pval
@ -31,15 +27,35 @@ legacy_boot_mac_adr() {
IFS="$oIFS" IFS="$oIFS"
} }
case "$(board_name)" in oxnas_setup_interfaces()
"shuttle,kd20") {
local board="$1"
case $board in
*)
ucidef_set_interface_lan "eth0" "dhcp"
;;
esac
}
oxnas_setup_macs()
{
local board="$1"
local lan_mac=""
case $board in
shuttle,kd20)
lan_mac="$(legacy_boot_mac_adr)" lan_mac="$(legacy_boot_mac_adr)"
;; ;;
esac esac
ucidef_set_interface_lan "eth0" "dhcp" [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac" }
board_config_update
board=$(board_name)
oxnas_setup_interfaces $board
oxnas_setup_macs $board
board_config_flush board_config_flush
exit 0 exit 0