mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-09 02:43:53 +08:00
base-files: failsafe: Fix IP configuration
Adapt the preinit_config_board() to the board.json network changes. It now looks for the device and the ports variables to configure the LAN network. This works with swconfig configurations. Fixes: FS#3866 Fixes: d42640e389a8 ("base-files: use "ports" array in board.json network for bridges") Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Reviewed-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit 467cd378db3359814866ec4121fdb4417783241e)
This commit is contained in:
parent
98b1a6435f
commit
c0fdfd15fc
@ -72,14 +72,20 @@ preinit_config_board() {
|
||||
|
||||
json_select network
|
||||
json_select "lan"
|
||||
json_get_vars ifname
|
||||
json_get_vars device
|
||||
json_get_values ports ports
|
||||
json_select ..
|
||||
json_select ..
|
||||
|
||||
[ -n "$ifname" ] || return
|
||||
[ -n "$device" -o -n "$ports" ] || return
|
||||
|
||||
# swconfig uses $device and DSA uses ports
|
||||
[ -z "$ports" ] && {
|
||||
ports="$device"
|
||||
}
|
||||
|
||||
# only use the first one
|
||||
ifname=${ifname%% *}
|
||||
ifname=${ports%% *}
|
||||
|
||||
if [ -x /sbin/swconfig ]; then
|
||||
# configure the switch, if present
|
||||
|
Loading…
x
Reference in New Issue
Block a user