diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2021-06-22 00:45:19 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2021-06-22 23:52:09 +0200 |
commit | c0fdfd15fc8f1ad8c75c60a8393a6d8b5c2b3b19 (patch) | |
tree | cd0b3f8aebbf71aa53f8cfbffe44672f9437fbf8 | |
parent | 98b1a6435fdf076f0dbd7cfac31ba73795cc6b23 (diff) | |
download | upstream-c0fdfd15fc8f1ad8c75c60a8393a6d8b5c2b3b19.tar.gz upstream-c0fdfd15fc8f1ad8c75c60a8393a6d8b5c2b3b19.tar.bz2 upstream-c0fdfd15fc8f1ad8c75c60a8393a6d8b5c2b3b19.zip |
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)
-rw-r--r-- | package/base-files/files/lib/preinit/10_indicate_preinit | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit index 3c59929790..56e96c63ba 100644 --- a/package/base-files/files/lib/preinit/10_indicate_preinit +++ b/package/base-files/files/lib/preinit/10_indicate_preinit @@ -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 |