mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-08 03:50:48 +00:00
base-files: Fix config_generate when there are no switch VLANs or ports configured in board.json.
The json_select call fails when there are no roles or ports objects in board.json. "json_select .." must not be executed after failing. This fixes for example LEDs not being set up in /etc/config/system. Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
This commit is contained in:
parent
a3531f1986
commit
40f933d7ff
@ -143,6 +143,7 @@ generate_switch_vlans_ports() {
|
||||
# autogenerate vlans
|
||||
#
|
||||
|
||||
if json_is_a roles array; then
|
||||
json_get_keys roles roles
|
||||
json_select roles
|
||||
|
||||
@ -160,12 +161,14 @@ generate_switch_vlans_ports() {
|
||||
done
|
||||
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# write port specific settings
|
||||
#
|
||||
|
||||
if json_is_a ports array; then
|
||||
json_get_keys ports ports
|
||||
json_select ports
|
||||
|
||||
@ -192,6 +195,7 @@ generate_switch_vlans_ports() {
|
||||
done
|
||||
|
||||
json_select ..
|
||||
fi
|
||||
}
|
||||
|
||||
generate_switch() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user