From: David Bauer Date: Mon, 3 Apr 2023 00:17:51 +0000 (+0200) Subject: base-files: led board init X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7edd9f7ab51f671afc9f255ce65432d75562b673;p=openwrt%2Fstaging%2Fblocktrron.git base-files: led board init --- diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index 0001f88746..9072086a27 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -408,12 +408,15 @@ generate_led() { netdev) local device mode - json_get_vars device mode + json_get_vars mode + json_get_values device device uci -q batch <<-EOF set system.$cfg.trigger='netdev' set system.$cfg.mode='$mode' - set system.$cfg.dev='$device' EOF + for dev in $device; do + uci add_list system.$cfg.dev=$dev + done ;; usb) diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index a37e8cf824..ba06d9afa1 100644 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -455,13 +455,17 @@ ucidef_set_led_ide() { } ucidef_set_led_netdev() { - local dev="$4" + local devices="$4" local mode="${5:-link tx rx}" _ucidef_set_led_common "$1" "$2" "$3" json_add_string type netdev - json_add_string device "$dev" + json_select_array device + for netdev in $devices; do + json_add_string "device" "$netdev" + done + json_select .. json_add_string mode "$mode" json_select ..