base-files: support passing mode to ucidef_set_led_netdev()
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 26 Feb 2016 14:49:17 +0000 (14:49 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 26 Feb 2016 14:49:17 +0000 (14:49 +0000)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
SVN-Revision: 48806

package/base-files/Makefile
package/base-files/files/bin/config_generate
package/base-files/files/lib/functions/uci-defaults.sh

index 8c75b91940b1e78a7e7f22d4b6d01b5c06084aaa..8bb622552747dc184fdca779adb3e2bc1f4240a3 100644 (file)
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/version.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=167
+PKG_RELEASE:=168
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_BUILD_DEPENDS:=usign/host
index 865dccc450b15c4fcca0d3048e05abab7b9ee244..550de0eebf80e5a95cf63bcdf86bf9ab196321e4 100755 (executable)
@@ -263,11 +263,11 @@ generate_led() {
                ;;
 
                netdev)
-                       local device
-                       json_get_vars device
+                       local device mode
+                       json_get_vars device mode
                        uci -q batch <<-EOF
                                set system.$cfg.trigger='netdev'
-                               set system.$cfg.mode='link tx rx'
+                               set system.$cfg.mode='$mode'
                                set system.$cfg.dev='$device'
                        EOF
                ;;
index d556844e95c021ce23d5cbc7cb60e975abb5035e..512e0ed8bd9c15dd82560a847dde3420fcaa9b2c 100755 (executable)
@@ -355,6 +355,7 @@ ucidef_set_led_netdev() {
        local name="$2"
        local sysfs="$3"
        local dev="$4"
+       local mode="${5:-link tx rx}"
 
        json_select_object led
 
@@ -363,6 +364,7 @@ ucidef_set_led_netdev() {
        json_add_string type netdev
        json_add_string sysfs "$sysfs"
        json_add_string device "$dev"
+       json_add_string mode "$mode"
        json_select ..
 
        json_select ..