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>
master
Vittorio Gambaletta (VittGam) 9 years ago committed by Jo-Philipp Wich
parent a3531f1986
commit 40f933d7ff
  1. 4
      package/base-files/files/bin/config_generate

@ -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…
Cancel
Save