Message ID | 20210621224522.633341-3-hauke@hauke-m.de |
---|---|
State | Accepted |
Delegated to: | Hauke Mehrtens |
Headers | show |
Series | Fix failsafe mode | expand |
On 22.06.2021 00:45, Hauke Mehrtens wrote: > 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> Looks great, it fixes failsafe on bcm53xx (swconfig) and bcm4908 (DSA). Reviewed-by: Rafał Miłecki <rafal@milecki.pl>
diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit index 3c5992979016..56e96c63baab 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
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> --- .../base-files/files/lib/preinit/10_indicate_preinit | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)