[PATCH v11 2/6] fff-support: Update PoE passthrough code

Fabian Bläse fabian at blaese.de
Sa Nov 4 23:52:18 CET 2017


Ein Neustart weniger ist ein Neustart weniger. Wo es sich machen lässt sollte das imo auch angestrebt werden.

Fabian

> On 2. Nov 2017, at 23:27, mail at adrianschmutzler.de wrote:
> 
> Hallo Tim,
> 
> siehe unten.
> 
>> -----Original Message-----
>> From: Tim Niemeyer [mailto:tim at tn-x.org <mailto:tim at tn-x.org>]
>> Sent: Donnerstag, 2. November 2017 23:21
>> To: Adrian Schmutzler <freifunk at adrianschmutzler.de <mailto:freifunk at adrianschmutzler.de>>; franken-
>> dev at freifunk.net <mailto:dev at freifunk.net>
>> Subject: Re: [PATCH v11 2/6] fff-support: Update PoE passthrough code
>> 
>> Hi
>> 
>> Am Mittwoch, den 18.10.2017, 23:30 +0200 schrieb Adrian Schmutzler:
>>> This implements an upgrade safe solution for the PoE passthrough on
>>> multiple devices. Since LEDE already provides the relevant settings, a
>>> check whether those are in place enables both identification of
>>> affected devices and automatic deactivation if parameters are changed.
>>> 
>>> Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
>>> 
>>> Tested-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
>>> ---
>>> .../fff/fff-config/files/etc/uci-defaults/98-configure-fff    |  5 +++++
>>> src/packages/fff/fff-support/Makefile                         |  2 +-
>>> .../ar71xx/usr/lib/fff-support/activate_poe_passthrough.sh    |  8
>> ++++++++
>>> .../usr/lib/fff-support/cpe210_activate_poe_passthrough.sh    |  5 -----
>>> .../ar71xx/usr/lib/fff-support/disable_poe_passthrough.sh     | 11
>> +++++++++++
>>> .../ar71xx/usr/lib/fff-support/permanent_poe_passthrough.sh   |  9
>> +++++++++
>>> 6 files changed, 34 insertions(+), 6 deletions(-)  create mode 100755
>>> src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/activate_poe_p
>>> assthrough.sh  delete mode 100644
>>> src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/cpe210_activat
>>> e_poe_passthrough.sh  create mode 100755
>>> src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/disable_poe_pa
>>> ssthrough.sh  create mode 100755
>>> src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/permanent_poe_
>>> passthrough.sh
>>> 
>>> diff --git
>>> a/src/packages/fff/fff-config/files/etc/uci-defaults/98-configure-fff
>>> b/src/packages/fff/fff-config/files/etc/uci-defaults/98-configure-fff
>>> index e337e88..c39527f 100644
>>> ---
>>> a/src/packages/fff/fff-config/files/etc/uci-defaults/98-configure-fff
>>> +++ b/src/packages/fff/fff-config/files/etc/uci-defaults/98-configure-
>>> +++ fff
>>> @@ -23,3 +23,8 @@ uci -q set "simple-
>> tc.example.limit_ingress=${traffic_in}"
>>> uci -q set "simple-tc.example.limit_egress=${traffic_out}"
>>> 
>>> uci -q commit
>>> +
>>> +poe_passthrough=$(uci -q get "fff.poe_passthrough.enabled") if [
>>> +"$poe_passthrough" = "1" ] && [ -s /usr/lib/fff-
>> support/activate_poe_passthrough.sh ] ; then
>>> +	/usr/lib/fff-support/activate_poe_passthrough.sh
>>> +fi
>>> diff --git a/src/packages/fff/fff-support/Makefile
>>> b/src/packages/fff/fff-support/Makefile
>>> index c255a8f..9fd2d2b 100644
>>> --- a/src/packages/fff/fff-support/Makefile
>>> +++ b/src/packages/fff/fff-support/Makefile
>>> @@ -13,7 +13,7 @@ define Package/$(PKG_NAME)
>>>     CATEGORY:=Freifunk
>>>     TITLE:=Freifunk-Franken Support Scripts
>>>     URL:=http://www.freifunk-franken.de
>>> -    DEPENDS:=+ at BUSYBOX_CONFIG_ASH
>>> +    DEPENDS:=+ at BUSYBOX_CONFIG_ASH +fff-config
>>> endef
>>> 
>>> define Package/$(PKG_NAME)/description diff --git
>>> a/src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/activate_poe
>>> _passthrough.sh
>>> b/src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/activate_poe
>>> _passthrough.sh
>>> new file mode 100755
>>> index 0000000..b29e351
>>> --- /dev/null
>>> +++ b/src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/activate
>>> +++ _poe_passthrough.sh
>>> @@ -0,0 +1,8 @@
>>> +#!/bin/sh
>>> +# This enables PoE passthrough so it is persistent through reboots, #
>>> +but reset after firmware upgrade
>>> +
>>> +if uci -q get "system.poe_passthrough" > /dev/null ; then
>>> +    uci -q set "system.poe_passthrough.value=1"
>>> +    uci -q commit system
>> 
>> Die Gluons machen da noch ein:
>> /etc/init.d/gpio_switch restart
>> 
>> Warum machen wir das nicht? Hängt da ein Config-Hook drauf oder so?
> 
> Habe ich bisher einfach noch nie gehört...
> Ich habe bisher einen Neustart gemacht, ist ja nur einmal nötig. Werde das mal testen.
> 
> Grüße
> 
> Adrian
> 
>> 
>> Tim
>> 
>>> +fi
>>> diff --git
>>> a/src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/cpe210_activ
>>> ate_poe_passthrough.sh
>>> b/src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/cpe210_activ
>>> ate_poe_passthrough.sh
>>> deleted file mode 100644
>>> index cb3508f..0000000
>>> ---
>>> a/src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/cpe210_activ
>>> ate_poe_passthrough.sh
>>> +++ /dev/null
>>> @@ -1,5 +0,0 @@
>>> -if [ "$(cat /var/sysinfo/model)" = "TP-Link CPE210 v1.1" ] ; then
>>> -  echo 20 > /sys/class/gpio/export
>>> -  echo out > /sys/class/gpio/gpio20/direction
>>> -  echo 1 > /sys/class/gpio/gpio20/value -fi diff --git
>>> a/src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/disable_poe_
>>> passthrough.sh
>>> b/src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/disable_poe_
>>> passthrough.sh
>>> new file mode 100755
>>> index 0000000..2c5009c
>>> --- /dev/null
>>> +++ b/src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/disable_
>>> +++ poe_passthrough.sh
>>> @@ -0,0 +1,11 @@
>>> +#!/bin/sh
>>> +# This disables PoE passthrough permanently
>>> +
>>> +uci -q set "fff.poe_passthrough=fff"
>>> +uci -q set "fff.poe_passthrough.active=0"
>>> +uci -q commit fff
>>> +
>>> +if uci -q get "system.poe_passthrough" > /dev/null ; then
>>> +    uci -q set "system.poe_passthrough.value=0"
>>> +    uci -q commit system
>>> +fi
>>> diff --git
>>> a/src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/permanent_po
>>> e_passthrough.sh
>>> b/src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/permanent_po
>>> e_passthrough.sh
>>> new file mode 100755
>>> index 0000000..955a992
>>> --- /dev/null
>>> +++ b/src/packages/fff/fff-support/ar71xx/usr/lib/fff-support/permanen
>>> +++ t_poe_passthrough.sh
>>> @@ -0,0 +1,9 @@
>>> +#!/bin/sh
>>> +# This enables PoE passthrough permanently, so it is persistent #
>>> +during firmware upgrades
>>> +
>>> +uci -q set "fff.poe_passthrough=fff"
>>> +uci -q set "fff.poe_passthrough.active=1"
>>> +uci -q commit fff
>>> +
>>> +/usr/lib/fff-support/activate_poe_passthrough.sh
>>> --
>>> 2.7.4
>>> 
> 
> 
> --
> franken-dev mailing list
> franken-dev at freifunk.net
> http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net

-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20171104/da3bf9ce/attachment.html>
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigröße  : 833 bytes
Beschreibung: Message signed with OpenPGP
URL         : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20171104/da3bf9ce/attachment.sig>


Mehr Informationen über die Mailingliste franken-dev