1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-27 22:47:31 +02:00

base-files: add support for the usbdev LED trigger

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24647 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg 2010-12-17 17:10:14 +00:00
parent f7a210d168
commit 25156f20f7
2 changed files with 11 additions and 5 deletions

View File

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

View File

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