base-files: add support for the usbdev LED trigger

SVN-Revision: 24647
This commit is contained in:
Gabor Juhos 2010-12-17 17:10:14 +00:00
parent a059a11ee1
commit 63c786dde7
2 changed files with 11 additions and 5 deletions
package/base-files
Makefile
files/etc/init.d

View file

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=base-files
PKG_RELEASE:=62
PKG_RELEASE:=63
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
PKG_BUILD_DEPENDS:=opkg/host

View file

@ -12,6 +12,7 @@ load_led() {
local default
local delayon
local delayoff
local interval
config_get sysfs $1 sysfs
config_get name $1 name "$sysfs"
@ -21,6 +22,7 @@ load_led() {
config_get_bool default $1 default "nil"
config_get delayon $1 delayon
config_get delayoff $1 delayoff
config_get interval $1 interval "50"
[ -e /sys/class/leds/${sysfs}/brightness ] && {
echo "setting up led ${name}"
@ -39,6 +41,10 @@ load_led() {
[ -n "$delayon" ] && echo $delayon > /sys/class/leds/${sysfs}/delay_on
[ -n "$delayoff" ] && echo $delayoff > /sys/class/leds/${sysfs}/delay_off
}
[ "$trigger" == "usbdev" -a -n "$dev" ] && {
echo $dev > /sys/class/leds/${sysfs}/device_name
echo $interval > /sys/class/leds/${sysfs}/activity_interval
}
}
}