base-files: skip LEDs handled by rssileds in led init-script
authorFlorian Fainelli <florian@openwrt.org>
Thu, 11 Oct 2012 06:45:02 +0000 (06:45 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Thu, 11 Oct 2012 06:45:02 +0000 (06:45 +0000)
Without this, /etc/init.d/led will try to set the non-existing 'rssi' trigger.
This doesn't harm as the kernel will refuse this setting, but it outputs some
ugly log-lines:
Jun 24 10:15:19 OpenWrt user.info sysinit: setting up led RSSILOW
Jun 24 10:15:19 OpenWrt user.info sysinit: sh: write error: Invalid argument
...

In order to avoid this, skip LEDs with trigger = "rssi" in /etc/init.d/led

Signed-off-by: Daniel Golle <dgolle@allnet.de>
SVN-Revision: 33717

package/base-files/Makefile
package/base-files/files/etc/init.d/led

index 1d56e9fc784fb71e4373c62f3ec14e0d21d6c92f..27ce05164a52909ed5338b04ef2a310dc5d65211 100644 (file)
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/version.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=117
+PKG_RELEASE:=118
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_BUILD_DEPENDS:=opkg/host
index 43964bf0bbe6f3f58d4928e91c5cdee3bfaefe79..f3f3c3f8a7c99ac73f4e3368671f02f011970a03 100755 (executable)
@@ -25,6 +25,11 @@ load_led() {
        config_get interval $1 interval "50"
        config_get port_state $1 port_state
 
+       if [ "$trigger" = "rssi" ]; then
+               # handled by rssileds userspace process
+               return
+       fi
+
        [ -e /sys/class/leds/${sysfs}/brightness ] && {
                echo "setting up led ${name}"
                [ "$default" != nil ] && {