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
|
# autogenerate vlans
|
||||||
#
|
#
|
||||||
|
|
||||||
|
if json_is_a roles array; then
|
||||||
json_get_keys roles roles
|
json_get_keys roles roles
|
||||||
json_select roles
|
json_select roles
|
||||||
|
|
||||||
@ -160,12 +161,14 @@ generate_switch_vlans_ports() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
json_select ..
|
json_select ..
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# write port specific settings
|
# write port specific settings
|
||||||
#
|
#
|
||||||
|
|
||||||
|
if json_is_a ports array; then
|
||||||
json_get_keys ports ports
|
json_get_keys ports ports
|
||||||
json_select ports
|
json_select ports
|
||||||
|
|
||||||
@ -192,6 +195,7 @@ generate_switch_vlans_ports() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
json_select ..
|
json_select ..
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
generate_switch() {
|
generate_switch() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user