From 24ed8712422db8f157f10385ca972529c05ac2d9 Mon Sep 17 00:00:00 2001 From: kb-light Date: Thu, 6 Jul 2017 19:20:01 +0200 Subject: [PATCH 1/3] gluon-core: lib/gluon/upgrade/150-poe-passthrough: fix indentation --- .../luasrc/lib/gluon/upgrade/150-poe-passthrough | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/150-poe-passthrough b/package/gluon-core/luasrc/lib/gluon/upgrade/150-poe-passthrough index 1ee362b8..ab35dec0 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/150-poe-passthrough +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/150-poe-passthrough @@ -6,8 +6,8 @@ local site = require 'gluon.site_config' if (not sysconfig.gluon_version) and site.poe_passthrough then local uci = require('simple-uci').cursor() - if uci:get('system', 'gpio_switch_poe_passthrough') then - uci:set('system', 'gpio_switch_poe_passthrough', 'value', true) - uci:save('system') - end + if uci:get('system', 'gpio_switch_poe_passthrough') then + uci:set('system', 'gpio_switch_poe_passthrough', 'value', true) + uci:save('system') + end end From d51f2098a3be6ec0f9efb33705b0a13114327b1f Mon Sep 17 00:00:00 2001 From: kb-light Date: Thu, 6 Jul 2017 22:03:40 +0200 Subject: [PATCH 2/3] gluon-core: update lib/gluon/upgrade/150-poe-passthrough for naming within lede --- .../gluon-core/luasrc/lib/gluon/upgrade/150-poe-passthrough | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/150-poe-passthrough b/package/gluon-core/luasrc/lib/gluon/upgrade/150-poe-passthrough index ab35dec0..ded75509 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/150-poe-passthrough +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/150-poe-passthrough @@ -6,8 +6,8 @@ local site = require 'gluon.site_config' if (not sysconfig.gluon_version) and site.poe_passthrough then local uci = require('simple-uci').cursor() - if uci:get('system', 'gpio_switch_poe_passthrough') then - uci:set('system', 'gpio_switch_poe_passthrough', 'value', true) + if uci:get('system', 'poe_passthrough') then + uci:set('system', 'poe_passthrough', 'value', true) uci:save('system') end end From 05a56d1c46fc50fe27b51725c69e9520bd391409 Mon Sep 17 00:00:00 2001 From: kb-light Date: Sat, 15 Jul 2017 09:09:58 +0200 Subject: [PATCH 3/3] gluon-web-network: accept .*poe_passthough.* as uci section for PoE passthrough --- .../luasrc/lib/gluon/web/model/admin/network.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package/gluon-web-network/luasrc/lib/gluon/web/model/admin/network.lua b/package/gluon-web-network/luasrc/lib/gluon/web/model/admin/network.lua index e634512e..542c3b79 100644 --- a/package/gluon-web-network/luasrc/lib/gluon/web/model/admin/network.lua +++ b/package/gluon-web-network/luasrc/lib/gluon/web/model/admin/network.lua @@ -122,13 +122,14 @@ if sysconfig.lan_ifname then end end -if uci:get('system', 'gpio_switch_poe_passthrough') then +local poe_section = uci:get_first("system", "gpio_switch") +if poe_section:match("poe_passthrough") then local s = f:section(Section) local poe_passthrough = s:option(Flag, "poe_passthrough", translate("Enable PoE passthrough")) - poe_passthrough.default = uci:get_bool("system", "gpio_switch_poe_passthrough", "value") + poe_passthrough.default = uci:get_bool("system", poe_section, "value") function poe_passthrough:write(data) - uci:set('system', 'gpio_switch_poe_passthrough', 'value', data) + uci:set('system', poe_section, 'value', data) end end