[PATCH 1/3] base-files: failsafe: Fix IP configuration

Hauke Mehrtens hauke at hauke-m.de
Mon Jun 21 11:24:04 PDT 2021


On 6/21/21 3:58 PM, Rafał Miłecki wrote:
> On 19.06.2021 20:36, 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 at hauke-m.de>
> 
> This fixes failsafe on bcm53xx (swconfig target). Thanks a lot.
> 
> Reviewed-by: Rafał Miłecki <rafal at milecki.pl>
> 
> [see 1 inline comment below]
> 
> 
>>   .../files/lib/preinit/10_indicate_preinit      | 18 ++++++++++++------
>>   1 file changed, 12 insertions(+), 6 deletions(-)
>>
>> diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit 
>> b/package/base-files/files/lib/preinit/10_indicate_preinit
>> index 3c5992979016..ae9fcfecc89e 100644
>> --- a/package/base-files/files/lib/preinit/10_indicate_preinit
>> +++ b/package/base-files/files/lib/preinit/10_indicate_preinit
>> @@ -72,28 +72,34 @@ 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%% *}
>> +    ports=${ports%% *}
> 
> Using "ports" variable up to this point is perfectly fine. Here however 
> I think ifname would be more clear. What about:
> ifname=${ports%% *}

I will change it to ifname

Hauke
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x93DD20630910B515.asc
Type: application/pgp-keys
Size: 9895 bytes
Desc: OpenPGP public key
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20210621/8788e707/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20210621/8788e707/attachment.sig>


More information about the openwrt-devel mailing list