diff options
Diffstat (limited to 'packages')
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 |