summaryrefslogtreecommitdiff
path: root/target/linux/lantiq/base-files
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2011-11-12 23:39:56 +0000
committerJohn Crispin <john@openwrt.org>2011-11-12 23:39:56 +0000
commit3660c51c405f2efe64db9b78d8e5fa0fffea4530 (patch)
treebfb263fc0ade3e4ad7930acf5763fe06991b11e5 /target/linux/lantiq/base-files
parent424870510860306aa38f4a0edba831be068d9fdd (diff)
downloadmtk-20170518-3660c51c405f2efe64db9b78d8e5fa0fffea4530.zip
mtk-20170518-3660c51c405f2efe64db9b78d8e5fa0fffea4530.tar.gz
mtk-20170518-3660c51c405f2efe64db9b78d8e5fa0fffea4530.tar.bz2
lantiq: adds hotplug handler for handling buttons and makes w303v work with it
SVN-Revision: 28999
Diffstat (limited to 'target/linux/lantiq/base-files')
-rw-r--r--target/linux/lantiq/base-files/etc/hotplug.d/button/10-generic.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/button/10-generic.sh b/target/linux/lantiq/base-files/etc/hotplug.d/button/10-generic.sh
new file mode 100644
index 0000000..b2fdda2
--- /dev/null
+++ b/target/linux/lantiq/base-files/etc/hotplug.d/button/10-generic.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+[ "${ACTION}" = "released" ] || exit 0
+
+. /lib/functions.sh
+
+case "${BUTTON}" in
+ BTN_0)
+ logger "reset pressed"
+ sync
+ reboot
+ ;;
+ BTN_1)
+ logger "factory pressed"
+ jffs2_mark_erase "rootfs_data"
+ sync
+ reboot
+ ;;
+ *)
+ logger "unknown button ${BUTTON}"
+ ;;
+esac