summaryrefslogtreecommitdiff
path: root/packages/angstrom
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2008-06-04 14:55:31 +0000
committerKoen Kooi <koen@openembedded.org>2008-06-04 14:55:31 +0000
commit8f52b3e590811ca645c13219d9b9a9191476aec3 (patch)
treebc268a64a90ee6b21bac6c21c1ccd1ad30c421d7 /packages/angstrom
parent2d0ed5c61d9bb342721c32c220ff2b4b53452446 (diff)
angstrom led config: initscript that applies led config from /etc/default/leds
Diffstat (limited to 'packages/angstrom')
-rw-r--r--packages/angstrom/angstrom-led-config.bb30
-rw-r--r--packages/angstrom/angstrom-led-config/.mtn2git_empty0
-rw-r--r--packages/angstrom/angstrom-led-config/beagleboard/.mtn2git_empty0
-rw-r--r--packages/angstrom/angstrom-led-config/beagleboard/leds3
-rwxr-xr-xpackages/angstrom/angstrom-led-config/led-config31
-rw-r--r--packages/angstrom/angstrom-led-config/leds1
6 files changed, 65 insertions, 0 deletions
diff --git a/packages/angstrom/angstrom-led-config.bb b/packages/angstrom/angstrom-led-config.bb
new file mode 100644
index 0000000000..a0a29cbb3c
--- /dev/null
+++ b/packages/angstrom/angstrom-led-config.bb
@@ -0,0 +1,30 @@
+DESCRIPTION = "Configuration files for runtime LED configuration"
+
+#PV = "${DISTRO_VERSION}"
+PR = "r0"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit update-rc.d
+INITSCRIPT_NAME = "led-config"
+
+SRC_URI = "file://led-config \
+ file://leds \
+ "
+
+do_compile() {
+ :
+}
+
+
+do_install () {
+ install -d ${D}/${sysconfdir}/default
+ install -d ${D}/${INIT_D_DIR}
+
+ install -m 0644 ${WORKDIR}/leds ${D}/${sysconfdir}/default/
+ install -m 0755 ${WORKDIR}/led-config ${D}/${INIT_D_DIR}
+}
+
+CONFFILES_${PN} += "${sysconfdir}/default/leds \
+ ${INIT_D_DIR}/led-config \
+ "
+
diff --git a/packages/angstrom/angstrom-led-config/.mtn2git_empty b/packages/angstrom/angstrom-led-config/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/angstrom/angstrom-led-config/.mtn2git_empty
diff --git a/packages/angstrom/angstrom-led-config/beagleboard/.mtn2git_empty b/packages/angstrom/angstrom-led-config/beagleboard/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/angstrom/angstrom-led-config/beagleboard/.mtn2git_empty
diff --git a/packages/angstrom/angstrom-led-config/beagleboard/leds b/packages/angstrom/angstrom-led-config/beagleboard/leds
new file mode 100644
index 0000000000..19c73ebcf3
--- /dev/null
+++ b/packages/angstrom/angstrom-led-config/beagleboard/leds
@@ -0,0 +1,3 @@
+#file format: name trigger
+beagleboard::led0 mmc0
+beagleboard::led1 nand-disk
diff --git a/packages/angstrom/angstrom-led-config/led-config b/packages/angstrom/angstrom-led-config/led-config
new file mode 100755
index 0000000000..63d52d6cd0
--- /dev/null
+++ b/packages/angstrom/angstrom-led-config/led-config
@@ -0,0 +1,31 @@
+#! /bin/sh
+
+if [ -e /sys/class/leds/ ] ; then
+
+case "$1" in
+ start)
+ echo "Configuring leds:"
+ for led in /sys/class/leds/* ; do
+ trigger=$(grep "$(basename $led)" /etc/default/leds | awk '{print $2}')
+ if [ "x$trigger" = "x" ] ; then trigger="none" ; fi
+ echo " $(basename $led): $trigger"
+ echo "$trigger" > "$led/trigger"
+ done
+;;
+ stop)
+ echo "Deconfiguring leds:"
+ for led in /sys/class/leds/* ; do
+ echo " $(basename $led): no trigger"
+ echo "none" > "$led/trigger"
+ done
+ ;;
+ *)
+ echo "Usage: /etc/init.d/led-config {start|stop}"
+ exit 1
+esac
+
+else
+ echo "No LEDs detected"
+fi
+
+exit 0
diff --git a/packages/angstrom/angstrom-led-config/leds b/packages/angstrom/angstrom-led-config/leds
new file mode 100644
index 0000000000..7de8a2e3ae
--- /dev/null
+++ b/packages/angstrom/angstrom-led-config/leds
@@ -0,0 +1 @@
+#file format: name trigger