Message ID | 1507210666-20961-6-git-send-email-freifunk@adrianschmutzler.de |
---|---|
State | Superseded |
Headers | show |
diff --git a/src/packages/fff/fff-fastd/files/etc/uci-defaults/55_fff-fastd b/src/packages/fff/fff-fastd/files/etc/uci-defaults/55_fff-fastd index 8ce8425..72970bd 100644 --- a/src/packages/fff/fff-fastd/files/etc/uci-defaults/55_fff-fastd +++ b/src/packages/fff/fff-fastd/files/etc/uci-defaults/55_fff-fastd @@ -1,28 +1,27 @@ -/etc/init.d/fastd disable +#!/bin/sh -. /etc/community.cfg -project="$VPN_PROJECT" +/etc/init.d/fastd disable >/etc/config/fastd uci batch <<EOF - set fastd.${project}='fastd' - set fastd.${project}.enabled='1' - set fastd.${project}.config_peer_dir="/etc/fastd/${project}/peers" - set fastd.${project}.syslog_level='warn' - set fastd.${project}.method='null' - set fastd.${project}.mode='tap' - set fastd.${project}.interface="${project}VPN" - set fastd.${project}.mtu='1426' - set fastd.${project}.on_up="/etc/fastd/${project}/up.sh" - set fastd.${project}.secure_handshakes='0' - set fastd.${project}.secret="generate" + set fastd.fff='fastd' + set fastd.fff.enabled='1' + set fastd.fff.config_peer_dir="/etc/fastd/fff/peers" + set fastd.fff.syslog_level='warn' + set fastd.fff.method='null' + set fastd.fff.mode='tap' + set fastd.fff.interface="fffVPN" + set fastd.fff.mtu='1426' + set fastd.fff.on_up="/etc/fastd/fff/up.sh" + set fastd.fff.secure_handshakes='0' + set fastd.fff.secret="generate" EOF -[ ! -d /etc/fastd/${project} ] && mkdir -p /etc/fastd/${project} -ln -s /tmp/fastd_${project}_peers /etc/fastd/${project}/peers -echo "#!/bin/sh" > /etc/fastd/${project}/up.sh -echo "ip link set up dev ${project}VPN" >> /etc/fastd/${project}/up.sh -echo "echo enable > /sys/devices/virtual/net/${project}VPN/batman_adv/no_rebroadcast" >> /etc/fastd/${project}/up.sh -echo "batctl if add ${project}VPN" >> /etc/fastd/${project}/up.sh -chmod +x /etc/fastd/${project}/up.sh +[ ! -d /etc/fastd/fff ] && mkdir -p /etc/fastd/fff +ln -s /tmp/fastd_fff_peers /etc/fastd/fff/peers +echo "#!/bin/sh" > /etc/fastd/fff/up.sh +echo "ip link set up dev fffVPN" >> /etc/fastd/fff/up.sh +echo "echo enable > /sys/devices/virtual/net/fffVPN/batman_adv/no_rebroadcast" >> /etc/fastd/fff/up.sh +echo "batctl if add fffVPN" >> /etc/fastd/fff/up.sh +chmod +x /etc/fastd/fff/up.sh diff --git a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange new file mode 100644 index 0000000..ddae6b3 --- /dev/null +++ b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange @@ -0,0 +1,15 @@ +#!/bin/sh +# Copyright 2017 Adrian Schmutzler +# License GPLv3 + +getUpgradePath() { + if [ -s /tmp/keyxchangev2data ]; then + json_load "$(cat /tmp/keyxchangev2data)" + json_select hood + json_get_var upath upgrade_path + echo "$upath" + else + return 1 + fi + return 0 +} diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood index 0233056..3886435 100755 --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood @@ -2,6 +2,7 @@ . /usr/share/libubox/jshn.sh . /lib/functions/fff/wireless +. /lib/functions/fff/timeserver rm /tmp/keyxchangev2data @@ -131,6 +132,7 @@ if [ -s /tmp/keyxchangev2data ]; then json_get_var mesh_bssid mesh_bssid json_get_var mesh_essid mesh_essid json_get_var essid essid + json_get_var ntpip ntp_ip # i think the next things we don't active this in the first version! we can do it later #json_get_var channel2 channel2 #json_get_var mode2 mode2 @@ -185,6 +187,10 @@ if [ -s /tmp/keyxchangev2data ]; then echo "Loading wifi" wifi + oldntp="$(uci -q get system.ntp.server)" + newntp="${ntpip}" # requires routable address, no link-local + [ "$newntp" = "$oldntp" ] || setTimeserver "${newntp}" # only rewrite if changed + # copy the file to webroot so that other Meshrouter can download it; # copy only after all other steps so IF can be reentered if something goes wrong cp /tmp/keyxchangev2data /www/public/ diff --git a/src/packages/fff/fff-support/files/usr/sbin/show_info b/src/packages/fff/fff-support/files/usr/sbin/show_info index fc7cffb..3914391 100755 --- a/src/packages/fff/fff-support/files/usr/sbin/show_info +++ b/src/packages/fff/fff-support/files/usr/sbin/show_info @@ -1,6 +1,5 @@ #!/bin/sh -. /etc/community.cfg . /etc/firmware_release board_name=$(uci -q get board.model.name) diff --git a/src/packages/fff/fff-sysupgrade/Makefile b/src/packages/fff/fff-sysupgrade/Makefile index 3224662..f29cf73 100644 --- a/src/packages/fff/fff-sysupgrade/Makefile +++ b/src/packages/fff/fff-sysupgrade/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fff-sysupgrade -PKG_VERSION:=0.0.4 +PKG_VERSION:=5 PKG_RELEASE:=4 PKG_BUILD_DIR:=$(BUILD_DIR)/fff-sysupgrade @@ -13,7 +13,7 @@ define Package/fff-sysupgrade CATEGORY:=Freifunk TITLE:=Freifunk-Franken sysupgrade URL:=http://www.freifunk-franken.de - DEPENDS:=+fff-boardname +@BUSYBOX_CONFIG_WGET + DEPENDS:=+fff-boardname +fff-hoods +@BUSYBOX_CONFIG_WGET endef define Package/fff-sysupgrade/description diff --git a/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh b/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh index df9d519..8aaa924 100755 --- a/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh +++ b/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh @@ -1,9 +1,16 @@ #!/bin/sh cd /tmp/ +. /lib/functions/fff/keyxchange . /etc/firmware_release -. /etc/community.cfg +UPGRADE_PATH="$(getUpgradePath)" + +if [ -z "$UPGRADE_PATH" ]; then + echo "Upgrade path not set! Aborting." + echo "" + exit 1 +fi BOARD=$(uci get board.model.name) diff --git a/src/packages/fff/fff-timeserver/Makefile b/src/packages/fff/fff-timeserver/Makefile index 4a2decd..d88d646 100644 --- a/src/packages/fff/fff-timeserver/Makefile +++ b/src/packages/fff/fff-timeserver/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fff-timeserver -PKG_VERSION:=0.0.1 +PKG_VERSION:=2 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/fff-timeserver diff --git a/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver b/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver old mode 100755 new mode 100644 index aa485ab..fe5979d --- a/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver +++ b/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver @@ -1,9 +1,8 @@ #!/bin/sh . /lib/functions/fff/timeserver -. /etc/community.cfg -setTimeserver "${NTPD_IP}" +# No initialization here, this is done in configurehood uci -q set "system.@system[0].timezone=CET-1CEST,M3.5.0,M10.5.0/3"
Tested on Uplink and Mesh. Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > -----Original Message----- > From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf > Of Adrian Schmutzler > Sent: Donnerstag, 5. Oktober 2017 15:38 > To: franken-dev@freifunk.net > Subject: [PATCH v16 6/6] Remove references to community.cfg > > This removes all references to community.cfg except in the buildscript and > except the file itself. > > Changes in v13: > - Fixed timeserver and upgrade path to be set by keyxchange > > Changes in v14: > - Removed interface ID for timeserver > > Changes in v15/16: > - Nothing (only line numbers) > > Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > --- > .../fff-fastd/files/etc/uci-defaults/55_fff-fastd | 41 > +++++++++++----------- > .../fff-hoods/files/lib/functions/fff/keyxchange | 15 ++++++++ > .../fff/fff-hoods/files/usr/sbin/configurehood | 6 ++++ > .../fff/fff-support/files/usr/sbin/show_info | 1 - > src/packages/fff/fff-sysupgrade/Makefile | 4 +-- > .../fff/fff-sysupgrade/files/etc/sysupgrade.sh | 9 ++++- > src/packages/fff/fff-timeserver/Makefile | 2 +- > .../files/etc/uci-defaults/51-fff-timeserver | 3 +- > 8 files changed, 53 insertions(+), 28 deletions(-) create mode 100644 > src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange > mode change 100755 => 100644 > src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver > > diff --git > a/src/packages/fff/fff-fastd/files/etc/uci-defaults/55_fff-fastd > b/src/packages/fff/fff-fastd/files/etc/uci-defaults/55_fff-fastd > index 8ce8425..72970bd 100644 > --- a/src/packages/fff/fff-fastd/files/etc/uci-defaults/55_fff-fastd > +++ b/src/packages/fff/fff-fastd/files/etc/uci-defaults/55_fff-fastd > @@ -1,28 +1,27 @@ > -/etc/init.d/fastd disable > +#!/bin/sh > > -. /etc/community.cfg > -project="$VPN_PROJECT" > +/etc/init.d/fastd disable > > >/etc/config/fastd > > uci batch <<EOF > - set fastd.${project}='fastd' > - set fastd.${project}.enabled='1' > - set fastd.${project}.config_peer_dir="/etc/fastd/${project}/peers" > - set fastd.${project}.syslog_level='warn' > - set fastd.${project}.method='null' > - set fastd.${project}.mode='tap' > - set fastd.${project}.interface="${project}VPN" > - set fastd.${project}.mtu='1426' > - set fastd.${project}.on_up="/etc/fastd/${project}/up.sh" > - set fastd.${project}.secure_handshakes='0' > - set fastd.${project}.secret="generate" > + set fastd.fff='fastd' > + set fastd.fff.enabled='1' > + set fastd.fff.config_peer_dir="/etc/fastd/fff/peers" > + set fastd.fff.syslog_level='warn' > + set fastd.fff.method='null' > + set fastd.fff.mode='tap' > + set fastd.fff.interface="fffVPN" > + set fastd.fff.mtu='1426' > + set fastd.fff.on_up="/etc/fastd/fff/up.sh" > + set fastd.fff.secure_handshakes='0' > + set fastd.fff.secret="generate" > EOF > > -[ ! -d /etc/fastd/${project} ] && mkdir -p /etc/fastd/${project} -ln -s > /tmp/fastd_${project}_peers /etc/fastd/${project}/peers -echo "#!/bin/sh" > > /etc/fastd/${project}/up.sh -echo "ip link set up dev ${project}VPN" >> > /etc/fastd/${project}/up.sh -echo "echo enable > > /sys/devices/virtual/net/${project}VPN/batman_adv/no_rebroadcast" >> > /etc/fastd/${project}/up.sh -echo "batctl if add ${project}VPN" >> > /etc/fastd/${project}/up.sh -chmod +x /etc/fastd/${project}/up.sh > +[ ! -d /etc/fastd/fff ] && mkdir -p /etc/fastd/fff ln -s > +/tmp/fastd_fff_peers /etc/fastd/fff/peers echo "#!/bin/sh" > > +/etc/fastd/fff/up.sh echo "ip link set up dev fffVPN" >> > +/etc/fastd/fff/up.sh echo "echo enable > > /sys/devices/virtual/net/fffVPN/batman_adv/no_rebroadcast" >> > /etc/fastd/fff/up.sh > +echo "batctl if add fffVPN" >> /etc/fastd/fff/up.sh chmod +x > +/etc/fastd/fff/up.sh > diff --git a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange > b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange > new file mode 100644 > index 0000000..ddae6b3 > --- /dev/null > +++ b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange > @@ -0,0 +1,15 @@ > +#!/bin/sh > +# Copyright 2017 Adrian Schmutzler > +# License GPLv3 > + > +getUpgradePath() { > + if [ -s /tmp/keyxchangev2data ]; then > + json_load "$(cat /tmp/keyxchangev2data)" > + json_select hood > + json_get_var upath upgrade_path > + echo "$upath" > + else > + return 1 > + fi > + return 0 > +} > diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > index 0233056..3886435 100755 > --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > @@ -2,6 +2,7 @@ > > . /usr/share/libubox/jshn.sh > . /lib/functions/fff/wireless > +. /lib/functions/fff/timeserver > > rm /tmp/keyxchangev2data > > @@ -131,6 +132,7 @@ if [ -s /tmp/keyxchangev2data ]; then > json_get_var mesh_bssid mesh_bssid > json_get_var mesh_essid mesh_essid > json_get_var essid essid > + json_get_var ntpip ntp_ip > # i think the next things we don't active this in the first > version! we can do it later > #json_get_var channel2 channel2 > #json_get_var mode2 mode2 > @@ -185,6 +187,10 @@ if [ -s /tmp/keyxchangev2data ]; then > echo "Loading wifi" > wifi > > + oldntp="$(uci -q get system.ntp.server)" > + newntp="${ntpip}" # requires routable address, no > link-local > + [ "$newntp" = "$oldntp" ] || setTimeserver "${newntp}" # > only rewrite if changed > + > # copy the file to webroot so that other Meshrouter can > download it; > # copy only after all other steps so IF can be reentered if > something goes wrong > cp /tmp/keyxchangev2data /www/public/ diff --git > a/src/packages/fff/fff-support/files/usr/sbin/show_info > b/src/packages/fff/fff-support/files/usr/sbin/show_info > index fc7cffb..3914391 100755 > --- a/src/packages/fff/fff-support/files/usr/sbin/show_info > +++ b/src/packages/fff/fff-support/files/usr/sbin/show_info > @@ -1,6 +1,5 @@ > #!/bin/sh > > -. /etc/community.cfg > . /etc/firmware_release > > board_name=$(uci -q get board.model.name) diff --git > a/src/packages/fff/fff-sysupgrade/Makefile > b/src/packages/fff/fff-sysupgrade/Makefile > index 3224662..f29cf73 100644 > --- a/src/packages/fff/fff-sysupgrade/Makefile > +++ b/src/packages/fff/fff-sysupgrade/Makefile > @@ -1,7 +1,7 @@ > include $(TOPDIR)/rules.mk > > PKG_NAME:=fff-sysupgrade > -PKG_VERSION:=0.0.4 > +PKG_VERSION:=5 > PKG_RELEASE:=4 > > PKG_BUILD_DIR:=$(BUILD_DIR)/fff-sysupgrade > @@ -13,7 +13,7 @@ define Package/fff-sysupgrade > CATEGORY:=Freifunk > TITLE:=Freifunk-Franken sysupgrade > URL:=http://www.freifunk-franken.de > - DEPENDS:=+fff-boardname +@BUSYBOX_CONFIG_WGET > + DEPENDS:=+fff-boardname +fff-hoods +@BUSYBOX_CONFIG_WGET > endef > > define Package/fff-sysupgrade/description > diff --git a/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh > b/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh > index df9d519..8aaa924 100755 > --- a/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh > +++ b/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh > @@ -1,9 +1,16 @@ > #!/bin/sh > cd /tmp/ > > +. /lib/functions/fff/keyxchange > . /etc/firmware_release > > -. /etc/community.cfg > +UPGRADE_PATH="$(getUpgradePath)" > + > +if [ -z "$UPGRADE_PATH" ]; then > + echo "Upgrade path not set! Aborting." > + echo "" > + exit 1 > +fi > > BOARD=$(uci get board.model.name) > > diff --git a/src/packages/fff/fff-timeserver/Makefile > b/src/packages/fff/fff-timeserver/Makefile > index 4a2decd..d88d646 100644 > --- a/src/packages/fff/fff-timeserver/Makefile > +++ b/src/packages/fff/fff-timeserver/Makefile > @@ -1,7 +1,7 @@ > include $(TOPDIR)/rules.mk > > PKG_NAME:=fff-timeserver > -PKG_VERSION:=0.0.1 > +PKG_VERSION:=2 > PKG_RELEASE:=1 > > PKG_BUILD_DIR:=$(BUILD_DIR)/fff-timeserver > diff --git > a/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver > b/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver > old mode 100755 > new mode 100644 > index aa485ab..fe5979d > --- > a/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver > +++ > b/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver > @@ -1,9 +1,8 @@ > #!/bin/sh > > . /lib/functions/fff/timeserver > -. /etc/community.cfg > > -setTimeserver "${NTPD_IP}" > +# No initialization here, this is done in configurehood > > uci -q set "system.@system[0].timezone=CET-1CEST,M3.5.0,M10.5.0/3" > > -- > 2.7.4 > > -- > franken-dev mailing list > franken-dev@freifunk.net > http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net
hi ich bin das Patch noch nicht komplett durch, hab aber eben in den keyxchangev2 mal einen brauchbaren ntp Server eingetragen und auf den ersten Blick scheint es so, als würden die Router den fressen ;) Hab das mal für alle Hoods eingetragen da es ja eine geroutete ULA v6 ist, daher sollte das auch in jeder Hood funktionieren wenn das v6 Routing klappt. mfg Christian On 06.10.2017 00:20, mail@adrianschmutzler.de wrote: > Tested on Uplink and Mesh. > > Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > >> -----Original Message----- >> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf >> Of Adrian Schmutzler >> Sent: Donnerstag, 5. Oktober 2017 15:38 >> To: franken-dev@freifunk.net >> Subject: [PATCH v16 6/6] Remove references to community.cfg >> >> This removes all references to community.cfg except in the buildscript and >> except the file itself. >> >> Changes in v13: >> - Fixed timeserver and upgrade path to be set by keyxchange >> >> Changes in v14: >> - Removed interface ID for timeserver >> >> Changes in v15/16: >> - Nothing (only line numbers) >> >> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> >> --- >> .../fff-fastd/files/etc/uci-defaults/55_fff-fastd | 41 >> +++++++++++----------- >> .../fff-hoods/files/lib/functions/fff/keyxchange | 15 ++++++++ >> .../fff/fff-hoods/files/usr/sbin/configurehood | 6 ++++ >> .../fff/fff-support/files/usr/sbin/show_info | 1 - >> src/packages/fff/fff-sysupgrade/Makefile | 4 +-- >> .../fff/fff-sysupgrade/files/etc/sysupgrade.sh | 9 ++++- >> src/packages/fff/fff-timeserver/Makefile | 2 +- >> .../files/etc/uci-defaults/51-fff-timeserver | 3 +- >> 8 files changed, 53 insertions(+), 28 deletions(-) create mode 100644 >> src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange >> mode change 100755 => 100644 >> src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver >> >> diff --git >> a/src/packages/fff/fff-fastd/files/etc/uci-defaults/55_fff-fastd >> b/src/packages/fff/fff-fastd/files/etc/uci-defaults/55_fff-fastd >> index 8ce8425..72970bd 100644 >> --- a/src/packages/fff/fff-fastd/files/etc/uci-defaults/55_fff-fastd >> +++ b/src/packages/fff/fff-fastd/files/etc/uci-defaults/55_fff-fastd >> @@ -1,28 +1,27 @@ >> -/etc/init.d/fastd disable >> +#!/bin/sh >> >> -. /etc/community.cfg >> -project="$VPN_PROJECT" >> +/etc/init.d/fastd disable >> >> >/etc/config/fastd >> >> uci batch <<EOF >> - set fastd.${project}='fastd' >> - set fastd.${project}.enabled='1' >> - set fastd.${project}.config_peer_dir="/etc/fastd/${project}/peers" >> - set fastd.${project}.syslog_level='warn' >> - set fastd.${project}.method='null' >> - set fastd.${project}.mode='tap' >> - set fastd.${project}.interface="${project}VPN" >> - set fastd.${project}.mtu='1426' >> - set fastd.${project}.on_up="/etc/fastd/${project}/up.sh" >> - set fastd.${project}.secure_handshakes='0' >> - set fastd.${project}.secret="generate" >> + set fastd.fff='fastd' >> + set fastd.fff.enabled='1' >> + set fastd.fff.config_peer_dir="/etc/fastd/fff/peers" >> + set fastd.fff.syslog_level='warn' >> + set fastd.fff.method='null' >> + set fastd.fff.mode='tap' >> + set fastd.fff.interface="fffVPN" >> + set fastd.fff.mtu='1426' >> + set fastd.fff.on_up="/etc/fastd/fff/up.sh" >> + set fastd.fff.secure_handshakes='0' >> + set fastd.fff.secret="generate" >> EOF >> >> -[ ! -d /etc/fastd/${project} ] && mkdir -p /etc/fastd/${project} -ln -s >> /tmp/fastd_${project}_peers /etc/fastd/${project}/peers -echo "#!/bin/sh" >>> /etc/fastd/${project}/up.sh -echo "ip link set up dev ${project}VPN" >> >> /etc/fastd/${project}/up.sh -echo "echo enable > >> /sys/devices/virtual/net/${project}VPN/batman_adv/no_rebroadcast" >> >> /etc/fastd/${project}/up.sh -echo "batctl if add ${project}VPN" >> >> /etc/fastd/${project}/up.sh -chmod +x /etc/fastd/${project}/up.sh >> +[ ! -d /etc/fastd/fff ] && mkdir -p /etc/fastd/fff ln -s >> +/tmp/fastd_fff_peers /etc/fastd/fff/peers echo "#!/bin/sh" > >> +/etc/fastd/fff/up.sh echo "ip link set up dev fffVPN" >> >> +/etc/fastd/fff/up.sh echo "echo enable > >> /sys/devices/virtual/net/fffVPN/batman_adv/no_rebroadcast" >> >> /etc/fastd/fff/up.sh >> +echo "batctl if add fffVPN" >> /etc/fastd/fff/up.sh chmod +x >> +/etc/fastd/fff/up.sh >> diff --git a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange >> b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange >> new file mode 100644 >> index 0000000..ddae6b3 >> --- /dev/null >> +++ b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange >> @@ -0,0 +1,15 @@ >> +#!/bin/sh >> +# Copyright 2017 Adrian Schmutzler >> +# License GPLv3 >> + >> +getUpgradePath() { >> + if [ -s /tmp/keyxchangev2data ]; then >> + json_load "$(cat /tmp/keyxchangev2data)" >> + json_select hood >> + json_get_var upath upgrade_path >> + echo "$upath" >> + else >> + return 1 >> + fi >> + return 0 >> +} >> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >> index 0233056..3886435 100755 >> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood >> @@ -2,6 +2,7 @@ >> >> . /usr/share/libubox/jshn.sh >> . /lib/functions/fff/wireless >> +. /lib/functions/fff/timeserver >> >> rm /tmp/keyxchangev2data >> >> @@ -131,6 +132,7 @@ if [ -s /tmp/keyxchangev2data ]; then >> json_get_var mesh_bssid mesh_bssid >> json_get_var mesh_essid mesh_essid >> json_get_var essid essid >> + json_get_var ntpip ntp_ip >> # i think the next things we don't active this in the first >> version! we can do it later >> #json_get_var channel2 channel2 >> #json_get_var mode2 mode2 >> @@ -185,6 +187,10 @@ if [ -s /tmp/keyxchangev2data ]; then >> echo "Loading wifi" >> wifi >> >> + oldntp="$(uci -q get system.ntp.server)" >> + newntp="${ntpip}" # requires routable address, no >> link-local >> + [ "$newntp" = "$oldntp" ] || setTimeserver "${newntp}" # >> only rewrite if changed >> + >> # copy the file to webroot so that other Meshrouter can >> download it; >> # copy only after all other steps so IF can be reentered if >> something goes wrong >> cp /tmp/keyxchangev2data /www/public/ diff --git >> a/src/packages/fff/fff-support/files/usr/sbin/show_info >> b/src/packages/fff/fff-support/files/usr/sbin/show_info >> index fc7cffb..3914391 100755 >> --- a/src/packages/fff/fff-support/files/usr/sbin/show_info >> +++ b/src/packages/fff/fff-support/files/usr/sbin/show_info >> @@ -1,6 +1,5 @@ >> #!/bin/sh >> >> -. /etc/community.cfg >> . /etc/firmware_release >> >> board_name=$(uci -q get board.model.name) diff --git >> a/src/packages/fff/fff-sysupgrade/Makefile >> b/src/packages/fff/fff-sysupgrade/Makefile >> index 3224662..f29cf73 100644 >> --- a/src/packages/fff/fff-sysupgrade/Makefile >> +++ b/src/packages/fff/fff-sysupgrade/Makefile >> @@ -1,7 +1,7 @@ >> include $(TOPDIR)/rules.mk >> >> PKG_NAME:=fff-sysupgrade >> -PKG_VERSION:=0.0.4 >> +PKG_VERSION:=5 >> PKG_RELEASE:=4 >> >> PKG_BUILD_DIR:=$(BUILD_DIR)/fff-sysupgrade >> @@ -13,7 +13,7 @@ define Package/fff-sysupgrade >> CATEGORY:=Freifunk >> TITLE:=Freifunk-Franken sysupgrade >> URL:=http://www.freifunk-franken.de >> - DEPENDS:=+fff-boardname +@BUSYBOX_CONFIG_WGET >> + DEPENDS:=+fff-boardname +fff-hoods +@BUSYBOX_CONFIG_WGET >> endef >> >> define Package/fff-sysupgrade/description >> diff --git a/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh >> b/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh >> index df9d519..8aaa924 100755 >> --- a/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh >> +++ b/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh >> @@ -1,9 +1,16 @@ >> #!/bin/sh >> cd /tmp/ >> >> +. /lib/functions/fff/keyxchange >> . /etc/firmware_release >> >> -. /etc/community.cfg >> +UPGRADE_PATH="$(getUpgradePath)" >> + >> +if [ -z "$UPGRADE_PATH" ]; then >> + echo "Upgrade path not set! Aborting." >> + echo "" >> + exit 1 >> +fi >> >> BOARD=$(uci get board.model.name) >> >> diff --git a/src/packages/fff/fff-timeserver/Makefile >> b/src/packages/fff/fff-timeserver/Makefile >> index 4a2decd..d88d646 100644 >> --- a/src/packages/fff/fff-timeserver/Makefile >> +++ b/src/packages/fff/fff-timeserver/Makefile >> @@ -1,7 +1,7 @@ >> include $(TOPDIR)/rules.mk >> >> PKG_NAME:=fff-timeserver >> -PKG_VERSION:=0.0.1 >> +PKG_VERSION:=2 >> PKG_RELEASE:=1 >> >> PKG_BUILD_DIR:=$(BUILD_DIR)/fff-timeserver >> diff --git >> a/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver >> b/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver >> old mode 100755 >> new mode 100644 >> index aa485ab..fe5979d >> --- >> a/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver >> +++ >> b/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver >> @@ -1,9 +1,8 @@ >> #!/bin/sh >> >> . /lib/functions/fff/timeserver >> -. /etc/community.cfg >> >> -setTimeserver "${NTPD_IP}" >> +# No initialization here, this is done in configurehood >> >> uci -q set "system.@system[0].timezone=CET-1CEST,M3.5.0,M10.5.0/3" >> >> -- >> 2.7.4 >> >> -- >> franken-dev mailing list >> franken-dev@freifunk.net >> http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net >
This removes all references to community.cfg except in the buildscript and except the file itself. Changes in v13: - Fixed timeserver and upgrade path to be set by keyxchange Changes in v14: - Removed interface ID for timeserver Changes in v15/16: - Nothing (only line numbers) Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> --- .../fff-fastd/files/etc/uci-defaults/55_fff-fastd | 41 +++++++++++----------- .../fff-hoods/files/lib/functions/fff/keyxchange | 15 ++++++++ .../fff/fff-hoods/files/usr/sbin/configurehood | 6 ++++ .../fff/fff-support/files/usr/sbin/show_info | 1 - src/packages/fff/fff-sysupgrade/Makefile | 4 +-- .../fff/fff-sysupgrade/files/etc/sysupgrade.sh | 9 ++++- src/packages/fff/fff-timeserver/Makefile | 2 +- .../files/etc/uci-defaults/51-fff-timeserver | 3 +- 8 files changed, 53 insertions(+), 28 deletions(-) create mode 100644 src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange mode change 100755 => 100644 src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver