aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/bin/config_generate
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-12-04 15:02:32 +0000
committerJo-Philipp Wich <jow@openwrt.org>2015-12-04 15:02:32 +0000
commit08078df83dc2ec61e2272c2abf105d28ae44681c (patch)
treea7e8f92f9936aed540864f15a8ef1cceb45ec4bf /package/base-files/files/bin/config_generate
parentba8a44995fe321bfc57a61fdb2a82cabd7605e94 (diff)
downloadupstream-08078df83dc2ec61e2272c2abf105d28ae44681c.tar.gz
upstream-08078df83dc2ec61e2272c2abf105d28ae44681c.tar.bz2
upstream-08078df83dc2ec61e2272c2abf105d28ae44681c.zip
board.d: add support for gpio_switch sections
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47762
Diffstat (limited to 'package/base-files/files/bin/config_generate')
-rwxr-xr-xpackage/base-files/files/bin/config_generate21
1 files changed, 21 insertions, 0 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 49784ebfae..9218788b5e 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -312,6 +312,24 @@ generate_led() {
json_select ..
}
+generate_gpioswitch() {
+ local cfg="$1"
+
+ json_select gpioswitch
+ json_select "$cfg"
+ local name pin default
+ json_get_vars name pin default
+ uci -q batch <<-EOF
+ delete system.$cfg
+ set system.$cfg='gpio_switch'
+ set system.$cfg.name='$name'
+ set system.$cfg.gpio_pin='$pin'
+ set system.$cfg.default='$default'
+ EOF
+ json_select ..
+ json_select ..
+}
+
json_init
json_load "$(cat ${CFG})"
@@ -326,6 +344,9 @@ for key in $keys; do generate_switch $key; done
json_get_keys keys rssimon
for key in $keys; do generate_rssimon $key; done
+json_get_keys keys gpioswitch
+for key in $keys; do generate_gpioswitch $key; done
+
json_get_keys keys led
for key in $keys; do generate_led $key; done