From 641dc50164d30d4962499e1974fafde9b337faaf Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 22 Sep 2018 00:38:40 +0200 Subject: base-files: make it possible to specify switch led mode The swconfig switch led driver has the ability to switch between a "link, rx and/or tx" mode. However, this feature was not implemented in uci, the led init script and config_generate. This patch adds a seventh parameter to the ucidef_set_led_switch() function. The accepted values for this parameter are: link, rx and tx. Any permutations of these three values are supported, as long as they are properly encased with quotes. If the parameter is not specified it will default to "all" (link rx tx). Signed-off-by: Christian Lamparter --- package/base-files/files/bin/config_generate | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'package/base-files/files/bin') diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index c8b253da5b..df221cc26c 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -366,11 +366,12 @@ generate_led() { ;; switch) - local port_mask speed_mask - json_get_vars port_mask speed_mask + local port_mask speed_mask mode + json_get_vars port_mask speed_mask mode uci -q batch <<-EOF set system.$cfg.port_mask='$port_mask' set system.$cfg.speed_mask='$speed_mask' + set system.$cfg.mode='$mode' EOF ;; -- cgit v1.2.3