Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chunkeey/510fa670636a759c381cbd17eebb9383 to your computer and use it in GitHub Desktop.
Save chunkeey/510fa670636a759c381cbd17eebb9383 to your computer and use it in GitHub Desktop.
wndr4700-customization
From 2db8b954372fbf06e286e50e57281b392484766c Mon Sep 17 00:00:00 2001
From: Your Name <your@place.world>
Date: Fri, 7 Apr 2017 22:32:05 +0200
Subject: wndr4700 customization package
---
package/firmware/wndr4700-custom/BTN_0 | 3 +++
package/firmware/wndr4700-custom/Makefile | 37 +++++++++++++++++++++++++++++++
package/firmware/wndr4700-custom/wps | 16 +++++++++++++
3 files changed, 56 insertions(+)
create mode 100644 package/firmware/wndr4700-custom/BTN_0
create mode 100644 package/firmware/wndr4700-custom/Makefile
create mode 100644 package/firmware/wndr4700-custom/wps
diff --git a/package/firmware/wndr4700-custom/BTN_0 b/package/firmware/wndr4700-custom/BTN_0
new file mode 100644
index 0000000000..9e5e8baea6
--- /dev/null
+++ b/package/firmware/wndr4700-custom/BTN_0
@@ -0,0 +1,3 @@
+#/bin/sh
+
+/sbin/reboot
diff --git a/package/firmware/wndr4700-custom/Makefile b/package/firmware/wndr4700-custom/Makefile
new file mode 100644
index 0000000000..692a0cba5f
--- /dev/null
+++ b/package/firmware/wndr4700-custom/Makefile
@@ -0,0 +1,37 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=wndr4700-custom
+PKG_RELEASE:=1
+PKG_VERSION:=2017-04-07
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/wndr4700-custom
+ SECTION:=firmware
+ CATEGORY:=Firmware
+ DEPENDS:=@TARGET_apm821xx_nand_DEVICE_WNDR4700 +hostapd-utils
+ TITLE:=Special customization for the WNDR4700
+endef
+
+define Package/wndr4700-custom/description
+This package contains:various scripts to support the various buttons
+and LEDs the WNDR4700 has to offer.
+endef
+
+# For existing scripts that need to be overwritten
+define Package/wndr4700-custom/install-overlay
+ $(INSTALL_DIR) $(1)/etc/rc.button/
+ $(INSTALL_BIN) ./wps $(1)/etc/rc.button/
+endef
+
+# For new scripts
+define Package/wndr4700-custom/install
+ $(INSTALL_DIR) $(1)/etc/rc.button/
+ $(INSTALL_BIN) ./BTN_0 $(1)/etc/rc.button/
+endef
+
+define Build/Compile
+
+endef
+
+$(eval $(call BuildPackage,wndr4700-custom))
diff --git a/package/firmware/wndr4700-custom/wps b/package/firmware/wndr4700-custom/wps
new file mode 100644
index 0000000000..e50eca2da9
--- /dev/null
+++ b/package/firmware/wndr4700-custom/wps
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+if [ "$ACTION" = "pressed" -a "$BUTTON" = "wps" ]; then
+ WPSLED="/sys/class/leds/wndr4700:white:logo/brightness"
+ echo 1 > $WPSLED
+ cd /var/run/hostapd
+ for socket in *; do
+ [ -S "$socket" ] || continue
+ hostapd_cli -i "$socket" wps_pbc
+ done
+ sleep 119
+ wait
+ echo 0 > $WPSLED
+fi
+
+return 0
--
2.11.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment