forked from freifunk-franken/firmware
Compare commits
38 Commits
87d923c1ef
...
0d06be1749
Author | SHA1 | Date |
---|---|---|
Fabian Bläse | 0d06be1749 | |
Fabian Bläse | bdfdbba76a | |
Fabian Bläse | baca28ece3 | |
Johannes Kimmel | 9bc3690cbd | |
Robert Langhammer | e6efc9671a | |
Fabian Bläse | a62f7cdf96 | |
Fabian Bläse | daf4467a8a | |
Fabian Bläse | b81c15d111 | |
Fabian Bläse | f8182af459 | |
Adrian Schmutzler | 0dfa1140ff | |
Fabian Bläse | 20d12f943e | |
Fabian Bläse | 90c58d575b | |
Fabian Bläse | bc3c0b717d | |
Robert Langhammer | f3b1604ff3 | |
Fabian Bläse | 57408f5dfb | |
Fabian Bläse | b26399283a | |
Fabian Bläse | 20ecca34c0 | |
Fabian Bläse | 880d56d52c | |
Robert Langhammer | 0f67aa2504 | |
Fabian Bläse | 4bf14292f7 | |
Robert Langhammer | 25e227c6b9 | |
Robert Langhammer | a317557320 | |
Robert Langhammer | 4cd3b17714 | |
Robert Langhammer | 7947107ed3 | |
Robert Langhammer | 378163d834 | |
Robert Langhammer | 405e0a43d5 | |
Fabian Bläse | 41b4168290 | |
Fabian Bläse | 0234203bed | |
Fabian Bläse | 240a506ee7 | |
Fabian Bläse | f89503660d | |
Robert Langhammer | 7a5bef0d7d | |
Robert Langhammer | 8e127a3936 | |
Christian Dresel | 2bc21aa63f | |
Fabian Bläse | a43b37e9f6 | |
Fabian Bläse | 803e2746df | |
Fabian Bläse | 71d137d4f1 | |
Fabian Bläse | 128a748626 | |
Fabian Bläse | 9a3b499cae |
|
@ -0,0 +1,45 @@
|
|||
clone:
|
||||
git:
|
||||
image: woodpeckerci/plugin-git
|
||||
settings:
|
||||
tags: true
|
||||
|
||||
pipeline:
|
||||
buildall-layer3:
|
||||
image: openwrtorg/imagebuilder
|
||||
commands:
|
||||
- export HOME=/home/build/openwrt
|
||||
- sudo chown -R build:build .
|
||||
- git config --global user.email "ci@fff.community"
|
||||
- git config --global user.name "FFF CI"
|
||||
- ./buildscript selectvariant layer3
|
||||
- ./buildscript selectbsp bsp/ath79-generic.bsp
|
||||
- ./buildscript prepare
|
||||
- ./buildscript buildall
|
||||
|
||||
buildall-node:
|
||||
image: openwrtorg/imagebuilder
|
||||
commands:
|
||||
- export HOME=/home/build/openwrt
|
||||
- sudo chown -R build:build .
|
||||
- git config --global user.email "ci@fff.community"
|
||||
- git config --global user.name "FFF CI"
|
||||
- ./buildscript selectvariant node
|
||||
- ./buildscript selectbsp bsp/ath79-generic.bsp
|
||||
- ./buildscript prepare
|
||||
- ./buildscript buildall
|
||||
|
||||
distribute:
|
||||
image: alpine/git
|
||||
volumes:
|
||||
- /var/lib/woodpecker/artifacts:/var/run/artifacts
|
||||
commands:
|
||||
- rm -rf /var/run/artifacts/$(git describe --tags)
|
||||
- mkdir -p /var/run/artifacts/$(git describe --tags)
|
||||
- cp -r bin/* /var/run/artifacts/$(git describe --tags)/
|
||||
- echo
|
||||
- echo
|
||||
- echo "You can download the built firmware images here:"
|
||||
- echo "https://ci.fff.community/artifacts/$(git describe --tags)"
|
||||
|
||||
branches: [ master ]
|
|
@ -0,0 +1,4 @@
|
|||
chipset=x86
|
||||
subtarget=64
|
||||
images=("openwrt-${chipset}-${subtarget}-generic-squashfs-combined-*"
|
||||
)
|
|
@ -0,0 +1,18 @@
|
|||
# Generated using "./buildscript config openwrt".
|
||||
# Do no edit manually
|
||||
#
|
||||
CONFIG_TARGET_x86=y
|
||||
CONFIG_TARGET_x86_64=y
|
||||
CONFIG_TARGET_x86_64_DEVICE_generic=y
|
||||
# CONFIG_TARGET_ROOTFS_EXT4FS is not set
|
||||
CONFIG_BUSYBOX_CUSTOM=y
|
||||
CONFIG_TARGET_PER_DEVICE_ROOTFS=y
|
||||
# CONFIG_BUSYBOX_CONFIG_BRCTL is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_CROND is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_CRONTAB is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_FAST_TOP is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_SERVER is not set
|
||||
CONFIG_CLEAN_IPKG=y
|
||||
# CONFIG_PACKAGE_ALFRED_VIS is not set
|
||||
CONFIG_PACKAGE_opkg=m
|
||||
CONFIG_STRIP_KERNEL_EXPORTS=y
|
54
buildscript
54
buildscript
|
@ -7,15 +7,15 @@ set -o pipefail
|
|||
builddir=./build
|
||||
|
||||
# OpenWrt: package hashes correspond to core repo version
|
||||
OPENWRTREV="v21.02.2"
|
||||
PACKAGEREV="b0ccc356900f6e1e1dc613d0ea980d5572f553dd"
|
||||
ROUTINGREV="10d3ffd8b30186b49538167bac1fa1bf9c88f860"
|
||||
OPENWRTREV="v21.02.3"
|
||||
PACKAGEREV="78bcd00c13587571b5c79ed2fc3363aa674aaef7"
|
||||
ROUTINGREV="a0d61bddb3ce4ca54bd76af86c28f58feb6cc044"
|
||||
|
||||
# Gluon packages: master from 2020-02-04
|
||||
GLUONREV="12e41d0ff07ec54bbd67a31ab50d12ca04f2238c"
|
||||
|
||||
OPENWRT_PKGS="gpioctl-sysfs libugpio fastd haserl micrond mtr bmon"
|
||||
ROUTING_PKGS="kmod-batman-adv batctl alfred babeld"
|
||||
ROUTING_PKGS="kmod-batman-adv batctl alfred babeld bird2"
|
||||
GLUON_PKGS="simple-tc uradvd"
|
||||
|
||||
FFF_VARIANTS="node layer3"
|
||||
|
@ -126,20 +126,9 @@ prepare() {
|
|||
|
||||
patch_target
|
||||
|
||||
# apply variant to ensure the included file "variant.mk"
|
||||
# exists in builddir.
|
||||
apply_variant
|
||||
|
||||
update_feeds
|
||||
}
|
||||
|
||||
apply_variant() {
|
||||
# set the variant for this build
|
||||
export FFF_VARIANT=$(cat selected_variant)
|
||||
# force the reevaluation of this Makefile to make note of the new variant
|
||||
touch ./src/packages/fff/fff/Makefile
|
||||
}
|
||||
|
||||
update_feeds() {
|
||||
## generate own feeds.conf
|
||||
#this local variable should be globally configure variable used in get_source and here
|
||||
|
@ -174,8 +163,6 @@ update_feeds() {
|
|||
}
|
||||
|
||||
prebuild() {
|
||||
apply_variant
|
||||
|
||||
#create filesdir for our config
|
||||
/bin/rm -rf "$builddir"/files
|
||||
mkdir "$builddir"/files
|
||||
|
@ -193,6 +180,9 @@ prebuild() {
|
|||
version="$variant-$version"
|
||||
fi
|
||||
|
||||
# select variant packages
|
||||
echo "CONFIG_PACKAGE_fff-${variant}=y" >> "$builddir"/.config
|
||||
|
||||
{
|
||||
echo "FIRMWARE_VERSION=\"$version\""
|
||||
echo "VARIANT=\"$variant\""
|
||||
|
@ -218,13 +208,19 @@ build() {
|
|||
|
||||
case "$1" in
|
||||
"debug")
|
||||
make V=99
|
||||
if [ -n "$2" ]; then
|
||||
make V=99 -j $2
|
||||
else
|
||||
make V=99
|
||||
fi
|
||||
;;
|
||||
"fast")
|
||||
ionice -c 2 -- nice -n 1 -- make -j $((cpus*2))
|
||||
[ -n "$2" ] && threads=$2 || threads=$((cpus*2))
|
||||
ionice -c 2 -- nice -n 1 -- make -j $threads
|
||||
;;
|
||||
*)
|
||||
ionice -c 3 -- nice -n 10 -- make -j $((cpus+1))
|
||||
[ -n "$2" ] && threads=$2 || threads=$((cpus+1))
|
||||
ionice -c 3 -- nice -n 10 -- make -j $threads
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -290,8 +286,13 @@ cp_firmware() {
|
|||
filename_build=${f##*/}
|
||||
filename_build=${filename_build//openwrt/fff-${version}}
|
||||
filename_build=${filename_build//squashfs-/}
|
||||
filename_build=${filename_build//${chipset}-/}
|
||||
filename_build=${filename_build//${subtarget}-/}
|
||||
|
||||
# The x86 OpenWrt target does not have a device name,
|
||||
# so keep the target and subtarget for identification.
|
||||
if [ "$chipset" != "x86" ]; then
|
||||
filename_build=${filename_build//${chipset}-/}
|
||||
filename_build=${filename_build//${subtarget}-/}
|
||||
fi
|
||||
cp "$f" "$imagedestpath/$filename_build"
|
||||
done
|
||||
done
|
||||
|
@ -317,8 +318,7 @@ buildrelease() {
|
|||
fi
|
||||
|
||||
cd bin/$variant
|
||||
for binary in *.bin *.img *.tar; do
|
||||
md5sum "$binary" > ./"$binary".md5
|
||||
for binary in *.bin *.img *.img.gz *.tar; do
|
||||
sha256sum "$binary" > ./"$binary".sha256
|
||||
done
|
||||
echo -e "VERSION:$version" > release.nfo
|
||||
|
@ -450,13 +450,13 @@ case "$1" in
|
|||
"build")
|
||||
if [ "$2" = "help" ] || [ "$2" = "x" ]; then
|
||||
echo "This option compiles the firmware"
|
||||
echo "Normaly the build uses lower IO and System priorities, "
|
||||
echo "Normally the build uses lower IO and System priorities, "
|
||||
echo "you can append \"fast\" option, to use normal user priorities"
|
||||
echo
|
||||
echo "Usage: $0 $1 [fast|debug]"
|
||||
echo "Usage: $0 $1 [fast|debug] [numthreads]"
|
||||
echo
|
||||
else
|
||||
build "$2"
|
||||
build "$2" "$3"
|
||||
fi
|
||||
;;
|
||||
"config")
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fff-babel-bird2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fff-babel-bird2
|
||||
SECTION:=base
|
||||
CATEGORY:=Freifunk
|
||||
TITLE:=Freifunk-Franken babel-bird2
|
||||
URL:=https://www.freifunk-franken.de
|
||||
DEPENDS:=+bird2 +bird2c +owipcalc
|
||||
PROVIDES:=fff-babel-implementation
|
||||
endef
|
||||
|
||||
define Package/fff-babel-bird2/description
|
||||
This is the Freifunk Franken Firmware babel-bird2 package.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
# nothing
|
||||
endef
|
||||
|
||||
define Package/fff-babel-bird2/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fff-babel-bird2))
|
|
@ -0,0 +1,123 @@
|
|||
# router id is not required for babeld, but necessary for bird startup
|
||||
router id 192.0.2.0;
|
||||
|
||||
ipv4 table fff4;
|
||||
ipv6 sadr table fff6;
|
||||
|
||||
protocol device {
|
||||
scan time 15;
|
||||
}
|
||||
|
||||
# device routes for ipv4 peering address
|
||||
protocol direct {
|
||||
ipv4 {
|
||||
table fff4;
|
||||
import filter {
|
||||
include "/tmp/bird/include/nat-filter.conf";
|
||||
|
||||
if (net ~ 10.50.0.0/16 || net ~ 10.83.0.0/16) && net.len = 32 then {
|
||||
accept;
|
||||
}
|
||||
reject;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
# device routes on loopback interface
|
||||
protocol direct {
|
||||
ipv4 {
|
||||
table fff4;
|
||||
import filter {
|
||||
include "/tmp/bird/include/nat-filter.conf";
|
||||
|
||||
if net ~ 10.50.0.0/16 || net ~ 10.83.0.0/16 then {
|
||||
accept;
|
||||
}
|
||||
reject;
|
||||
};
|
||||
};
|
||||
|
||||
ipv6 sadr {
|
||||
table fff6;
|
||||
import filter {
|
||||
if net ~ fdff::/64 from ::/0 then {
|
||||
reject;
|
||||
}
|
||||
|
||||
# only import GUA + ULA addresses
|
||||
if net !~ 2000::/3 from ::/0 && net !~ fc00::/7 from ::/0 then {
|
||||
reject;
|
||||
}
|
||||
|
||||
accept;
|
||||
};
|
||||
import keep filtered;
|
||||
};
|
||||
|
||||
interface "lo";
|
||||
}
|
||||
|
||||
# ipv6 kernel route interface
|
||||
protocol kernel {
|
||||
ipv6 sadr {
|
||||
table fff6;
|
||||
import filter {
|
||||
# only import routes from kernel with proto static
|
||||
if krt_source != 4 then {
|
||||
reject;
|
||||
}
|
||||
|
||||
if net ~ fdff::/64 from ::/0 then {
|
||||
reject;
|
||||
}
|
||||
|
||||
accept;
|
||||
};
|
||||
export all;
|
||||
preference 200;
|
||||
};
|
||||
kernel table 10;
|
||||
scan time 15;
|
||||
learn yes;
|
||||
}
|
||||
|
||||
# ipv4 kernel route interface
|
||||
protocol kernel {
|
||||
ipv4 {
|
||||
table fff4;
|
||||
import filter {
|
||||
include "/tmp/bird/include/nat-filter.conf";
|
||||
|
||||
# only import routes from kernel with proto static
|
||||
if krt_source = 4 then {
|
||||
accept;
|
||||
}
|
||||
reject;
|
||||
};
|
||||
export all;
|
||||
preference 200;
|
||||
};
|
||||
kernel table 10;
|
||||
scan time 15;
|
||||
learn yes;
|
||||
}
|
||||
|
||||
protocol babel {
|
||||
# required due to static configuration of global router id.
|
||||
# also improves reconnect speed after restart.
|
||||
randomize router id yes;
|
||||
|
||||
ipv4 {
|
||||
table fff4;
|
||||
import all;
|
||||
export all;
|
||||
};
|
||||
|
||||
ipv6 sadr {
|
||||
table fff6;
|
||||
import all;
|
||||
export all;
|
||||
};
|
||||
|
||||
include "/tmp/bird/include/babelpeers.conf";
|
||||
};
|
|
@ -0,0 +1,45 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2010-2017 OpenWrt.org
|
||||
|
||||
USE_PROCD=1
|
||||
START=70
|
||||
|
||||
BIRD_BIN="/usr/sbin/bird"
|
||||
BIRD_CONF="/etc/bird.conf"
|
||||
BIRD_PID_FILE="/var/run/bird.pid"
|
||||
|
||||
start_service() {
|
||||
mkdir -p /var/run
|
||||
|
||||
set_include_path
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command $BIRD_BIN -f -c $BIRD_CONF -P $BIRD_PID_FILE
|
||||
procd_set_param file "$BIRD_CONF"
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
set_include_path
|
||||
procd_send_signal fff-bird
|
||||
}
|
||||
|
||||
set_include_path() {
|
||||
# Change include file path, so bird uses the correct configuration, depending on the configuration state:
|
||||
# - If test mode is active (and /tmp/bird/fff exists), switch to the temporary configuration to be tested.
|
||||
# - If new settings are applied or the old settings are restored after an unsuccessful test (and /tmp/bird/fff does not exist),
|
||||
# switch back to the permanent configuration (/etc/bird/fff).
|
||||
|
||||
mkdir -p /tmp/bird/include
|
||||
|
||||
if [ -d /tmp/bird/fff ]; then
|
||||
echo 'include "/tmp/bird/fff/babelpeers/*.conf";' > /tmp/bird/include/babelpeers.conf
|
||||
echo 'include "/tmp/bird/fff/nat-filter.conf";' > /tmp/bird/include/nat-filter.conf
|
||||
else
|
||||
echo 'include "/etc/bird/fff/babelpeers/*.conf";' > /tmp/bird/include/babelpeers.conf
|
||||
echo 'include "/etc/bird/fff/nat-filter.conf";' > /tmp/bird/include/nat-filter.conf
|
||||
fi
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
/etc/init.d/bird disable
|
||||
rm -f /etc/init.d/bird
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,5 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
mv /etc/bird-fff.conf /etc/bird.conf
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,72 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
babel_get_version() {
|
||||
/usr/sbin/bird --version 2>&1 | sed "s/BIRD version /bird-/"
|
||||
}
|
||||
|
||||
babel_add_interface() {
|
||||
[ "$#" -ne "4" ] && return 1
|
||||
|
||||
local name="$1"
|
||||
local interface="$2"
|
||||
local type="$3"
|
||||
local rxcost="$4"
|
||||
|
||||
mkdir -p /tmp/bird/fff/babelpeers
|
||||
echo "interface \"$interface\" { type $type; rxcost $rxcost; };" > /tmp/bird/fff/babelpeers/$name.conf
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_delete_interface() {
|
||||
[ "$#" -ne "1" ] && return 1
|
||||
|
||||
local name="$1"
|
||||
|
||||
# Removing peers from /etc is not necessary, as all peers are generated into /tmp on every configuration run,
|
||||
# which completely overwrites existing peers in /etc in the apply step.
|
||||
rm -f /tmp/bird/fff/babelpeers/$name.conf
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_add_redistribute_filter() {
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_add_private_prefix_filter() {
|
||||
[ "$#" -ne "1" ] && return 1
|
||||
|
||||
local prefix="$1"
|
||||
prefix=$(owipcalc "$prefix" network prefix "$prefix")
|
||||
|
||||
mkdir -p /tmp/bird/fff
|
||||
echo "if net ~ $prefix then reject;" > /tmp/bird/fff/nat-filter.conf
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_remove_custom_redistribute_filters() {
|
||||
mkdir -p /tmp/bird/fff
|
||||
> /tmp/bird/fff/nat-filter.conf
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_apply_implementation() {
|
||||
# error output hidden because apply might be executed without a preceding configure step.
|
||||
if [ -d /tmp/bird/fff ]; then
|
||||
rm -rf /etc/bird/fff
|
||||
mv /tmp/bird/fff /etc/bird/fff
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_reload_implementation() {
|
||||
/etc/init.d/fff-bird reload
|
||||
}
|
||||
|
||||
babel_revert() {
|
||||
rm -r /tmp/bird/fff
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
|
||||
if ! birdc show status >/dev/null 2>&1; then
|
||||
# bird daemon not running or unavailable. exit.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
neighbours="$(birdc -r show babel neighbors |
|
||||
tail -n +5 |
|
||||
awk '{ printf "<neighbour><ip>%s</ip><outgoing_interface>%s</outgoing_interface><link_cost>%s</link_cost></neighbour>", $1, $2, $3 }'
|
||||
)"
|
||||
|
||||
echo -n "<babel_neighbours>$neighbours</babel_neighbours>"
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,28 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fff-babel
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fff-babel
|
||||
SECTION:=base
|
||||
CATEGORY:=Freifunk
|
||||
TITLE:=Freifunk-Franken babel
|
||||
URL:=https://www.freifunk-franken.de
|
||||
DEPENDS:=+fff-babel-implementation
|
||||
endef
|
||||
|
||||
define Package/fff-babel/description
|
||||
This is the Freifunk Franken Firmware babel package.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
# nothing
|
||||
endef
|
||||
|
||||
define Package/fff-babel/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fff-babel))
|
|
@ -26,7 +26,7 @@ configure() {
|
|||
fi
|
||||
}
|
||||
|
||||
config_load babeld
|
||||
config_load network
|
||||
config_foreach remove_babelpeer interface
|
||||
|
||||
#add new peers
|
||||
|
@ -75,14 +75,14 @@ configure() {
|
|||
babel_add_peer6addr "network.$prefixname.ip6addr"
|
||||
|
||||
# add babel interface
|
||||
babel_add_interface "$prefixname" "$iface" "$type" "$rxcost" || { echo "Could not add babeld interface for babelpeer $name"; exit 1; }
|
||||
babel_add_interface "$prefixname" "$iface" "$type" "$rxcost" || { echo "Could not add babel interface for babelpeer $name"; exit 1; }
|
||||
}
|
||||
|
||||
config_load gateway
|
||||
config_foreach add_babelpeer babelpeer
|
||||
|
||||
|
||||
# configure babeld filters for custom ipv6 addresses
|
||||
# configure babel filters for custom ipv6 addresses
|
||||
## remove old filters
|
||||
babel_remove_custom_redistribute_filters
|
||||
|
||||
|
@ -90,14 +90,25 @@ configure() {
|
|||
for prefix in $(uci -q get gateway.@client[0].ip6addr); do
|
||||
babel_add_redistribute_filter "$prefix"
|
||||
done
|
||||
|
||||
## add deny filters for client prefixes used with snat
|
||||
if [ "$(uci -q get gateway.@client[0].snat)" = "1" ]; then
|
||||
for prefix in $(uci -q get gateway.@client[0].ipaddr); do
|
||||
babel_add_private_prefix_filter "$prefix"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
apply() {
|
||||
uci commit network
|
||||
uci commit babeld
|
||||
babel_apply
|
||||
}
|
||||
|
||||
reload() {
|
||||
babel_reload
|
||||
}
|
||||
|
||||
revert() {
|
||||
uci revert network
|
||||
uci revert babeld
|
||||
babel_revert
|
||||
}
|
|
@ -1,3 +1,9 @@
|
|||
|
||||
implementation=$(uci -q get babelimpl.impl.impl)
|
||||
[ -z "$implementation" ] && implementation=babeld
|
||||
|
||||
. /lib/functions/fff/babeldaemon/$implementation
|
||||
|
||||
babel_add_iifrules() {
|
||||
[ "$#" -ne "1" ] && return 1
|
||||
|
||||
|
@ -72,61 +78,39 @@ babel_add_peer6addr() {
|
|||
return 0
|
||||
}
|
||||
|
||||
babel_add_interface() {
|
||||
[ "$#" -ne "4" ] && return 1
|
||||
babel_reload() {
|
||||
# switch implementation temporarily
|
||||
case $implementation in
|
||||
bird2)
|
||||
/etc/init.d/babeld stop 2>/dev/null
|
||||
/etc/init.d/fff-bird start
|
||||
;;
|
||||
babeld)
|
||||
/etc/init.d/fff-bird stop 2>/dev/null
|
||||
/etc/init.d/babeld start
|
||||
;;
|
||||
esac
|
||||
|
||||
local name="$1"
|
||||
local interface="$2"
|
||||
local type="$3"
|
||||
local rxcost="$4"
|
||||
|
||||
uci set babeld.$name=interface
|
||||
uci set babeld.$name.ifname="$interface"
|
||||
uci set babeld.$name.type="$type"
|
||||
uci set babeld.$name.rxcost="$rxcost"
|
||||
# call implementation-specific reload commands
|
||||
babel_reload_implementation
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_delete_interface() {
|
||||
[ "$#" -ne "1" ] && return 1
|
||||
babel_apply() {
|
||||
# switch implementation persistently
|
||||
case $implementation in
|
||||
bird2)
|
||||
/etc/init.d/babeld disable
|
||||
/etc/init.d/fff-bird enable
|
||||
;;
|
||||
babeld)
|
||||
/etc/init.d/fff-bird disable
|
||||
/etc/init.d/babeld enable
|
||||
;;
|
||||
esac
|
||||
|
||||
local name="$1"
|
||||
|
||||
uci -q del babeld.$name
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_add_redistribute_filter() {
|
||||
[ "$#" -ne "1" ] && return 1
|
||||
|
||||
local prefix="$1"
|
||||
|
||||
config=$(uci add babeld filter)
|
||||
uci set babeld.$config.type='redistribute'
|
||||
uci set babeld.$config.ip="$prefix"
|
||||
uci set babeld.$config.addedbyautoconfig='true'
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_remove_custom_redistribute_filters() {
|
||||
[ "$#" -ne "0" ] && return 1
|
||||
|
||||
remove_filters() {
|
||||
local name="$1"
|
||||
|
||||
# check if filter was added by configuregateway
|
||||
if ! [ "$(uci -q get babeld.$name.addedbyautoconfig)" = 'true' ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
uci -q del babeld.$name
|
||||
}
|
||||
|
||||
config_load babeld
|
||||
config_foreach remove_filters filter
|
||||
babel_apply_implementation
|
||||
|
||||
return 0
|
||||
}
|
|
@ -11,6 +11,7 @@ define Package/fff-babeld
|
|||
TITLE:=Freifunk-Franken babeld configuration example
|
||||
URL:=https://www.freifunk-franken.de
|
||||
DEPENDS:=+babeld
|
||||
PROVIDES:=fff-babel-implementation
|
||||
endef
|
||||
|
||||
define Package/fff-babeld/description
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
/etc/init.d/babeld disable
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,103 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
babel_get_version() {
|
||||
/usr/sbin/babeld -V 2>&1
|
||||
}
|
||||
|
||||
babel_add_interface() {
|
||||
[ "$#" -ne "4" ] && return 1
|
||||
|
||||
local name="$1"
|
||||
local interface="$2"
|
||||
local type="$3"
|
||||
local rxcost="$4"
|
||||
|
||||
uci set babeld.$name=interface
|
||||
uci set babeld.$name.ifname="$interface"
|
||||
uci set babeld.$name.type="$type"
|
||||
uci set babeld.$name.rxcost="$rxcost"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_delete_interface() {
|
||||
[ "$#" -ne "1" ] && return 1
|
||||
|
||||
local name="$1"
|
||||
|
||||
uci -q del babeld.$name
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_add_redistribute_filter() {
|
||||
[ "$#" -ne "1" ] && return 1
|
||||
|
||||
local prefix="$1"
|
||||
|
||||
config=$(uci add babeld filter)
|
||||
uci set babeld.$config.type='redistribute'
|
||||
uci set babeld.$config.ip="$prefix"
|
||||
uci set babeld.$config.addedbyautoconfig='true'
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_add_private_prefix_filter() {
|
||||
[ "$#" -ne "1" ] && return 1
|
||||
|
||||
local prefix="$1"
|
||||
|
||||
config=$(uci add babeld filter)
|
||||
uci set babeld.$config.type='redistribute'
|
||||
uci set babeld.$config.ip="$prefix"
|
||||
uci set babeld.$config.addedbyautoconfig='true'
|
||||
uci set babeld.$config.action='deny'
|
||||
|
||||
# move to top, so filter rule has precedence over all other rules
|
||||
uci reorder babeld.$config=0
|
||||
|
||||
config=$(uci add babeld filter)
|
||||
uci set babeld.$config.type='redistribute'
|
||||
uci set babeld.$config.ip="$prefix"
|
||||
uci set babeld.$config.addedbyautoconfig='true'
|
||||
uci set babeld.$config.local='true'
|
||||
uci set babeld.$config.action='deny'
|
||||
|
||||
# move to top, so filter rule has precedence over all other rules
|
||||
uci reorder babeld.$config=0
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_remove_custom_redistribute_filters() {
|
||||
[ "$#" -ne "0" ] && return 1
|
||||
|
||||
remove_filters() {
|
||||
local name="$1"
|
||||
|
||||
# check if filter was added by configuregateway
|
||||
if ! [ "$(uci -q get babeld.$name.addedbyautoconfig)" = 'true' ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
uci -q del babeld.$name
|
||||
}
|
||||
|
||||
config_load babeld
|
||||
config_foreach remove_filters filter
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_apply_implementation() {
|
||||
uci commit babeld
|
||||
}
|
||||
|
||||
babel_reload_implementation() {
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_revert() {
|
||||
uci revert babeld
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fff-base
|
||||
PKG_RELEASE:=$(COMMITCOUNT)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fff-base
|
||||
SECTION:=base
|
||||
CATEGORY:=Freifunk
|
||||
TITLE:=Freifunk-Franken base dependencies
|
||||
URL:=https://www.freifunk-franken.de
|
||||
DEFAULT:=y
|
||||
DEPENDS:= \
|
||||
+iptables \
|
||||
+ip6tables \
|
||||
+micrond \
|
||||
+odhcp6c \
|
||||
+fff-config \
|
||||
+fff-network \
|
||||
+fff-nodewatcher \
|
||||
+fff-simple-tc \
|
||||
+fff-support \
|
||||
+fff-sysupgrade \
|
||||
+fff-timeserver \
|
||||
+fff-web-ui \
|
||||
+fff-wireless
|
||||
endef
|
||||
|
||||
define Package/fff-variant/description
|
||||
This package includes base packages used in the Freifunk-Franken firmware
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fff-base))
|
|
@ -1,5 +1,9 @@
|
|||
BOARD=$(cat /var/sysinfo/board_name)
|
||||
|
||||
if uname -a | grep x86_64 > /dev/null; then
|
||||
BOARD="x86_64"
|
||||
fi
|
||||
|
||||
uci set board.model.name=$BOARD
|
||||
uci commit board
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
protocol=fastd
|
||||
|
||||
fastd_clear() {
|
||||
rm /tmp/fastd_fff_peers/*
|
||||
rm /tmp/fastd_fff_peers/* 2>/dev/null
|
||||
}
|
||||
|
||||
fastd_addpeer() {
|
||||
|
@ -21,14 +21,9 @@ fastd_addpeer() {
|
|||
}
|
||||
|
||||
fastd_start_stop() {
|
||||
/etc/init.d/fastd reload # does nothing if fastd was not running
|
||||
|
||||
# fastd start/stop for various situations
|
||||
# this is needed for first start and if fastd comes up or disappears in hoodfile
|
||||
pidfile="/tmp/run/fastd.fff.pid"
|
||||
if [ "$(ls /etc/fastd/fff/peers/* 2>/dev/null)" ]; then
|
||||
([ -s "$pidfile" ] && [ -d "/proc/$(cat "$pidfile")" ]) || /etc/init.d/fastd start
|
||||
if ls /etc/fastd/fff/peers/* &>/dev/null; then
|
||||
/etc/init.d/fastd reload
|
||||
else
|
||||
([ -s "$pidfile" ] && [ -d "/proc/$(cat "$pidfile")" ]) && /etc/init.d/fastd stop
|
||||
/etc/init.d/fastd stop
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
configure() {
|
||||
# check if gateway config exists
|
||||
if ! uci -q show gateway > /dev/null; then
|
||||
if ! uci show gateway > /dev/null; then
|
||||
echo "ERROR: Gateway config could not be parsed or does not exist."
|
||||
|
||||
return 1
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
execute_subshell() {
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage:" "$0" "<function>"
|
||||
return 1
|
||||
fi
|
||||
|
||||
for script in /etc/layer3.d/*; do
|
||||
|
@ -23,7 +24,7 @@ execute_subshell() {
|
|||
if [ $? -ne 0 ]; then
|
||||
echo
|
||||
echo "Error when executing" "$1" "from" "$(basename "$script")"
|
||||
exit 1
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
@ -32,29 +33,33 @@ configure() {
|
|||
echo "This script might remove existing vlans, interfaces, addresses, etc."
|
||||
read -r -p "Do you really want to continue? (y/n) " response
|
||||
if ! ( [ "$response" == "y" ] || [ "$response" == "Y" ] ); then
|
||||
exit 1
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo
|
||||
execute_subshell configure
|
||||
execute_subshell configure || return $?
|
||||
|
||||
exit 0
|
||||
return 0
|
||||
}
|
||||
|
||||
reload_services() {
|
||||
execute_subshell reload
|
||||
reload_config
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
apply_changes() {
|
||||
execute_subshell apply
|
||||
reload_services
|
||||
exit 0
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
revert_changes() {
|
||||
execute_subshell revert
|
||||
exit 0
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
keep_changes() {
|
||||
|
|
|
@ -11,7 +11,9 @@ define Package/fff-layer3
|
|||
TITLE:=Freifunk-Franken gateway configuration
|
||||
URL:=https://www.freifunk-franken.de
|
||||
DEPENDS:=+fff-alfred-monitoring-proxy \
|
||||
+fff-babel \
|
||||
+fff-babeld \
|
||||
+fff-babel-bird2 \
|
||||
+fff-boardname \
|
||||
+fff-dhcp \
|
||||
+fff-layer3-config \
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
ipv4dest=$(uci -q get fff.latency.ipv4)
|
||||
ipv6dest=$(uci -q get fff.latency.ipv6)
|
||||
if [ -n "$ipv4dest" ] || [ -n "$ipv6dest" ] ; then
|
||||
printf "<latency>"
|
||||
|
||||
if [ -n "$ipv4dest" ] ; then
|
||||
ipv4latency=$(ping -qc3 -4 $ipv4dest 2>&1 | awk -F'/' 'END{ print (/^round-trip/? $4:"0") }')
|
||||
printf "<ipv4latency>$ipv4latency</ipv4latency><ipv4dest>$ipv4dest</ipv4dest>"
|
||||
fi
|
||||
|
||||
if [ -n "$ipv6dest" ] ; then
|
||||
ipv6latency=$(ping -qc3 -6 $ipv6dest 2>&1 | awk -F'/' 'END{ print (/^round-trip/? $4:"0") }')
|
||||
printf "<ipv6latency>$ipv6latency</ipv6latency><ipv6dest>$ipv6dest</ipv6dest>"
|
||||
fi
|
||||
|
||||
printf "</latency>"
|
||||
fi
|
||||
exit 0
|
|
@ -14,8 +14,8 @@ define Package/fff-mqtt
|
|||
URL:=https://www.freifunk-franken.de
|
||||
DEPENDS:= \
|
||||
+fff-config \
|
||||
+libmosquitto-ssl \
|
||||
+mosquitto-client-ssl
|
||||
+libmosquitto-nossl \
|
||||
+mosquitto-client-nossl
|
||||
endef
|
||||
|
||||
define Package/fff-mqtt/description
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
# The GL-AR150 was converted from ONEPORT to TWOPORT.
|
||||
# Copy ETHMODE to LAN1MODE ("LAN"-Port) and set LAN0MODE ("WAN"-Port) to WAN to retain the configured behaviour for upgraded devices.
|
||||
if [ -s /etc/network.config ] ; then
|
||||
. /etc/network.config
|
||||
|
||||
# Ensure ETHMODE contains a sensible value. Use default behaviour (CLIENT) otherwise.
|
||||
[ "$ETHMODE" != "BATMAN" ] && [ "$ETHMODE" != "CLIENT" ] && [ "$ETHMODE" != "WAN" ] && ETHMODE="CLIENT"
|
||||
|
||||
echo "LAN0MODE='WAN' # use BATMAN, CLIENT or WAN" > /etc/network.config
|
||||
echo "LAN1MODE='$ETHMODE' # use BATMAN, CLIENT or WAN" >> /etc/network.config
|
||||
echo "FORCEPARSE='2' # Parse at: 0=first boot only, 1=every reboot, 2=next reboot (once)" >> /etc/network.config
|
||||
fi
|
|
@ -71,7 +71,7 @@ if [ "$DSA" = "1" ]; then
|
|||
set network.${SWITCHDEV}_2.ports="$WAN_PORTS"
|
||||
__EOF__
|
||||
fi
|
||||
elif [ -n "$SWITCHHW" ]; then
|
||||
elif [ -n "$SWITCHHW" ] && [ -z "$ONE_PORT" ] && [ -z "$TWO_PORT" ]; then
|
||||
uci batch <<-__EOF__
|
||||
set network.$SWITCHDEV=switch
|
||||
set network.$SWITCHDEV.name=$SWITCHHW
|
||||
|
|
|
@ -24,6 +24,7 @@ get_cpu_port() {
|
|||
ubnt,nanostation-loco-m-xw|\
|
||||
ubnt,unifi|\
|
||||
ubnt,unifiac-mesh|\
|
||||
x86_64|\
|
||||
xiaomi,mi-router-4a-gigabit)
|
||||
CPUPORT=""
|
||||
;;
|
||||
|
|
|
@ -11,7 +11,7 @@ if [ -s /etc/network.config ] ; then
|
|||
. /etc/network.config
|
||||
else
|
||||
# Write network.config
|
||||
if [ "$ONE_PORT" = "YES" ] || [ -n "$ETHPORT" ] ; then
|
||||
if [ "$ONE_PORT" = "YES" ] ; then
|
||||
echo "ETHMODE='$ETHMODE' # use BATMAN, CLIENT or WAN" >> /etc/network.config
|
||||
fi
|
||||
if [ -n "$TWO_PORT" ] ; then
|
||||
|
|
|
@ -2,12 +2,8 @@
|
|||
|
||||
WANDEV=eth1
|
||||
SWITCHDEV=eth0
|
||||
WAN_PORTS=
|
||||
BATMAN_PORTS="0t"
|
||||
CLIENT_PORTS="0t"
|
||||
TWO_PORT=YES
|
||||
|
||||
ETHMESHMAC="$(macFlipLocalBit $(cat /sys/class/net/eth0/address))"
|
||||
|
||||
. /etc/network.mode
|
||||
|
||||
ETHPORT=1
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
ETHMODE="CLIENT"
|
|
@ -0,0 +1,7 @@
|
|||
WANDEV=eth0
|
||||
SWITCHDEV=eth0
|
||||
ONE_PORT="YES"
|
||||
|
||||
. /etc/network.mode
|
||||
|
||||
ROUTERMAC=$(cat /sys/class/net/eth0/address)
|
|
@ -74,8 +74,12 @@ if [ -x /usr/bin/fastd ]; then
|
|||
SYSTEM_DATA="$SYSTEM_DATA<fastd_version>$(/usr/bin/fastd -v | awk '{ print $2 }')</fastd_version>"
|
||||
fi
|
||||
|
||||
if [ -x /usr/sbin/babeld ]; then
|
||||
SYSTEM_DATA="$SYSTEM_DATA<babel_version>$(/usr/sbin/babeld -V 2>&1)</babel_version>"
|
||||
if [ -e /lib/functions/fff/babel ]; then
|
||||
. /lib/functions/fff/babel
|
||||
babel_version=$(babel_get_version)
|
||||
if [ $? -eq 0 ]; then
|
||||
SYSTEM_DATA="$SYSTEM_DATA<babel_version>$babel_version</babel_version>"
|
||||
fi
|
||||
fi
|
||||
|
||||
# example for /etc/openwrt_release:
|
||||
|
@ -112,6 +116,7 @@ fi
|
|||
# Checks if fastd is running
|
||||
vpn_active=0
|
||||
pidof fastd >/dev/null && vpn_active=1
|
||||
bridge fdb show brport vxlan0 state permanent &>/dev/null && vpn_active=1
|
||||
SYSTEM_DATA="$SYSTEM_DATA<vpn_active>$vpn_active</vpn_active>"
|
||||
|
||||
echo -n "<system_data>$SYSTEM_DATA</system_data>"
|
||||
|
|
|
@ -4,6 +4,13 @@ uci batch <<EOF
|
|||
set dhcp.client.ra='server'
|
||||
set dhcp.client.ra_default='2'
|
||||
set dhcp.client.ra_management='0'
|
||||
set dhcp.client.ra_useleasetime='1'
|
||||
|
||||
# Work around unexpected behavior of odhcpd (see #238).
|
||||
#
|
||||
# This value has to be less then or equal to
|
||||
# dhcp.client.leasetime (set in fff-dhcp).
|
||||
set dhcp.client.preferred_lifetime='1h'
|
||||
EOF
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -221,7 +221,7 @@ if swconfig list | grep -q switch0 ; then
|
|||
done
|
||||
else
|
||||
echo "-> PORT ASSIGNMENT"
|
||||
if grep -q "ONE_PORT" "/etc/network.$board_name" || grep -q "ETHPORT" "/etc/network.$board_name" ; then
|
||||
if grep -q "ONE_PORT" "/etc/network.$board_name" ; then
|
||||
# Device has a port set by $ETHMODE
|
||||
. /etc/network.mode
|
||||
. /etc/network.config
|
||||
|
|
|
@ -24,19 +24,21 @@ done
|
|||
|
||||
# configure vpn
|
||||
|
||||
if [ -n "$hoodfile" ] && [ -s "$hoodfile" ] ; then
|
||||
json_load "$(cat "$hoodfile")"
|
||||
json_select hood
|
||||
json_get_var id id
|
||||
json_select ".."
|
||||
json_select vpn
|
||||
json_get_keys vpn_keys
|
||||
for key in $vpn_keys; do
|
||||
json_select $key
|
||||
json_get_var protocol protocol
|
||||
"${protocol}_addpeer"
|
||||
json_select ".." # back to vpn
|
||||
done
|
||||
if [ "$0" != "/usr/sbin/vpn-stop" ] ; then
|
||||
if [ -n "$hoodfile" ] && [ -s "$hoodfile" ] ; then
|
||||
json_load "$(cat "$hoodfile")"
|
||||
json_select hood
|
||||
json_get_var id id
|
||||
json_select ".."
|
||||
json_select vpn
|
||||
json_get_keys vpn_keys
|
||||
for key in $vpn_keys; do
|
||||
json_select $key
|
||||
json_get_var protocol protocol
|
||||
"${protocol}_addpeer"
|
||||
json_select ".." # back to vpn
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
# start/restart/stop vpnservices
|
||||
|
|
|
@ -8,9 +8,11 @@ uci batch <<EOF
|
|||
set network.vxlan0.ageing=30
|
||||
set network.vxlan0.mtu=1422
|
||||
set network.vxlan0.vid=0
|
||||
set network.vxlan0.disabled=1
|
||||
|
||||
set network.vxbat=interface
|
||||
set network.vxbat.proto=batadv_hardif
|
||||
set network.vxbat.master=bat0
|
||||
set network.vxbat.ifname=vxlan0
|
||||
set network.vxbat.disabled=1
|
||||
EOF
|
||||
|
|
|
@ -2,26 +2,23 @@ protocol=vxlan
|
|||
|
||||
vxlan_clear() {
|
||||
while uci -q delete network.@vxlan_peer[0]; do :; done
|
||||
uci set network.vxlan0.vid="0"
|
||||
uci set network.vxlan0.disabled="1"
|
||||
uci set network.vxbat.disabled="1"
|
||||
}
|
||||
|
||||
vxlan_addpeer() {
|
||||
uci set network.vxlan0.vid="$id"
|
||||
json_get_var address address
|
||||
address=$(ping6 -w1 -c1 "$address" | awk '/from/ {print substr($4, 1, length($4)-1); exit}')
|
||||
[ -z $address ] && return ## address not reachable
|
||||
uci set network.vxlan0.vid="$id"
|
||||
uci set network.vxlan0.disabled="0"
|
||||
uci set network.vxbat.disabled="0"
|
||||
uci add network vxlan_peer
|
||||
uci set network.@vxlan_peer[-1].vxlan="vxlan0"
|
||||
uci set network.@vxlan_peer[-1].dst="$address"
|
||||
}
|
||||
|
||||
vxlan_start_stop() {
|
||||
uci commit network
|
||||
# reload_config will not add new peers. A ifup is needed
|
||||
ifup vxlan0
|
||||
|
||||
# this workaround is cleaning up old fdb entries
|
||||
# and can be removed if someday netifd will do that
|
||||
bridge fdb show dev vxlan0 state permanent | while read mac dst ip rest ; do
|
||||
grep -q "$ip" /etc/config/network || bridge fdb del $mac dev vxlan0 dst $ip
|
||||
done
|
||||
reload_config
|
||||
}
|
||||
|
|
|
@ -65,9 +65,12 @@ fi
|
|||
if [ -s /tmp/isupdate ] ; then
|
||||
VERSION=$(cat /tmp/isupdate)
|
||||
%>
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td><span style="font-size: 16pt; color:#FF0000">Es ist eine neue Firmware für deinen Freifunkrouter verfügbar.<br />Alte Version: <%= ${FIRMWARE_VERSION} %> - Neue Version: <%= ${VERSION} %> <br /><a href="upgrade.html">Firmware jetzt updaten</a></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="updatenotification" style="padding: 15px; margin: 4px; background-color: #cfcfcf; margin-bottom: 15px;">
|
||||
<h3 style="font-size: 14pt; font-weight: bold; margin-bottom: 10px;">Es ist eine neue Firmware für deinen Freifunkrouter verfügbar!</h3>
|
||||
<table style="margin-bottom: 10px;">
|
||||
<tr><td>Installierte Version: </td><td><b><%= ${FIRMWARE_VERSION} %></b></td></tr>
|
||||
<tr><td>Neue Version: </td><td><b><%= ${VERSION} %></b></td></tr>
|
||||
</table>
|
||||
<a href="https://dev.freifunk-franken.de" target="_blank">Zum Download</a> | <a href="upgrade.html">Zur Upgradeseite</a>
|
||||
</div>
|
||||
<% fi %>
|
||||
|
|
|
@ -61,8 +61,8 @@ contact="$(uci -q get "fff.system.contact")"
|
|||
<legend>Status</legend>
|
||||
<table>
|
||||
<tr><th>Hood:</th><td><% echo "$hood" %></td></tr>
|
||||
<tr><th>Bekannte Knoten:</th><td><% echo -n $(($(batctl tg -H | cut -b 40-56 | sort | uniq | wc -l 2> /dev/null)+1)) %></td></tr>
|
||||
<tr><th>Nachbarknoten:</th><td><% echo -n $(batctl o -H | cut -b 40-56 | sort | uniq | wc -l 2> /dev/null) %></td></tr>
|
||||
<tr><th>Bekannte Knoten:</th><td><% echo -n $(($(batctl tg -H 2>/dev/null | cut -b 40-56 | sort | uniq | wc -l)+1)) %></td></tr>
|
||||
<tr><th>Nachbarknoten:</th><td><% echo -n $(batctl o -H 2>/dev/null | cut -b 40-56 | sort | uniq | wc -l) %></td></tr>
|
||||
<tr><th>Lokale Clients:</th><td><% echo -n $(batctl tl -H 2> /dev/null | grep -c 'W') %></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
|
|
@ -59,8 +59,8 @@ fi
|
|||
<tr><th>Name:</th><td><%= ${HOSTNAME} %></td></tr>
|
||||
<tr><th>Modell:</th><td><% cat /tmp/sysinfo/model 2>/dev/null %></td></tr>
|
||||
<tr><th>MAC-Adresse:</th><td><%= $(cat /sys/class/net/br-client/address) %></td></tr>
|
||||
<tr><th>Bekannte Knoten:</th><td><%= $(($(batctl tg -H | cut -b 40-56 | sort | uniq | wc -l 2>/dev/null)+1)) %></td></tr>
|
||||
<tr><th>Nachbarknoten:</th><td><%= $(batctl o -H | cut -b 40-56 | sort | uniq | wc -l 2>/dev/null) %></td></tr>
|
||||
<tr><th>Bekannte Knoten:</th><td><%= $(($(batctl tg -H 2>/dev/null | cut -b 40-56 | sort | uniq | wc -l)+1)) %></td></tr>
|
||||
<tr><th>Nachbarknoten:</th><td><%= $(batctl o -H 2>/dev/null | cut -b 40-56 | sort | uniq | wc -l) %></td></tr>
|
||||
<tr><th>VPN via fastd:</th><td><%= ${vpn_active} %></td></tr>
|
||||
<tr><th>fastd public key:</th><td><%= ${fastd_pub} %></td></tr>
|
||||
<tr><th>Laufzeit:</th><td><%= ${uptime} %></td></tr>
|
||||
|
|
|
@ -9,8 +9,8 @@ if [ "$REQUEST_METHOD" = "POST" ] ; then
|
|||
echo "ETHMODE=\"${POST_mode}\" # set via WebUI" >> /etc/network.config
|
||||
sed -i '/^FORCEPARSE/d' /etc/network.config
|
||||
echo "FORCEPARSE='2'" >> /etc/network.config
|
||||
do_reboot=1
|
||||
MSG='<span class="green">Port Modus geändert! Router startet neu...</span>'
|
||||
do_reconfigure=1
|
||||
MSG='<span class="green">Port Modus wird geändert!</span>'
|
||||
fi
|
||||
if [ "$POST_change_twoport" != "" ] ; then
|
||||
sed -i '/^.*# set via WebUI/d' /etc/network.config
|
||||
|
@ -18,8 +18,8 @@ if [ "$REQUEST_METHOD" = "POST" ] ; then
|
|||
echo "LAN1MODE=\"${POST_mode1}\" # set via WebUI" >> /etc/network.config
|
||||
sed -i '/^FORCEPARSE/d' /etc/network.config
|
||||
echo "FORCEPARSE='2'" >> /etc/network.config
|
||||
do_reboot=1
|
||||
MSG='<span class="green">Port Modus geändert! Router startet neu...</span>'
|
||||
do_reconfigure=1
|
||||
MSG='<span class="green">Port Modus wird geändert!</span>'
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -151,7 +151,7 @@ format_port() {
|
|||
</fieldset>
|
||||
</td></tr>
|
||||
<% fi %>
|
||||
<% if grep -q "ONE_PORT" "/etc/network.$board_name" || grep -q "ETHPORT" "/etc/network.$board_name" ; then %>
|
||||
<% if grep -q "ONE_PORT" "/etc/network.$board_name" ; then %>
|
||||
<%
|
||||
# Device has a port set by $ETHMODE
|
||||
. /etc/network.mode
|
||||
|
@ -182,13 +182,12 @@ format_port() {
|
|||
|
||||
Wenn diese Einstellung verändert wird, wird eine evtl. vorhandene manuelle Netzwerkkonfiguration in der
|
||||
<tt>/etc/config/network</tt> überschrieben.<br />
|
||||
Anschließend wird der Router neugestartet.
|
||||
</td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</td></tr>
|
||||
<% fi %>
|
||||
<% if grep -q "LAN0PORT" "/etc/network.$board_name" || grep -q "LAN1PORT" "/etc/network.$board_name" ; then %>
|
||||
<% if grep -q "TWO_PORT" "/etc/network.$board_name" ; then %>
|
||||
<%
|
||||
# Device has two ports
|
||||
. /etc/network.mode
|
||||
|
@ -228,7 +227,6 @@ format_port() {
|
|||
|
||||
Wenn diese Einstellung verändert wird, wird eine evtl. vorhandene manuelle Netzwerkkonfiguration in der
|
||||
<tt>/etc/config/network</tt> überschrieben.<br />
|
||||
Anschließend wird der Router neugestartet.
|
||||
</td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
@ -239,7 +237,7 @@ format_port() {
|
|||
<%in /www/include/footer %>
|
||||
<%
|
||||
# write
|
||||
if [ "$do_reboot" = "1" ] ; then
|
||||
reboot
|
||||
if [ "$do_reconfigure" = "1" ] ; then
|
||||
configurenetwork
|
||||
fi
|
||||
%>
|
||||
|
|
|
@ -61,7 +61,7 @@ if [ "$REQUEST_METHOD" = "POST" ] ; then
|
|||
|
||||
uci -q commit
|
||||
|
||||
MSG='<span class="green">Daten gespeichert! - Bitte Router neustarten.</span>'
|
||||
MSG='<span class="green">Daten gespeichert!</span>'
|
||||
fi
|
||||
fi
|
||||
%>
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -14,7 +14,7 @@ define Package/fff-wireguard
|
|||
+kmod-wireguard \
|
||||
+owipcalc \
|
||||
+wireguard-tools \
|
||||
+fff-babeld \
|
||||
+fff-babel \
|
||||
+fff-network
|
||||
endef
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ configure() {
|
|||
fi
|
||||
}
|
||||
|
||||
config_load babeld
|
||||
config_load network
|
||||
config_foreach remove_wgpeer interface
|
||||
|
||||
|
||||
|
@ -128,7 +128,7 @@ configure() {
|
|||
babel_add_iifrules "$prefixname" || { echo "ERROR: Could not add iif-rules for wgpeer $name"; exit 1; }
|
||||
|
||||
# add babel interface
|
||||
babel_add_interface "$prefixname" "$prefixname" 'wired' "$rxcost" || { echo "ERROR: Could not add babeld interface for wgpeer $name"; exit 1; }
|
||||
babel_add_interface "$prefixname" "$prefixname" 'wired' "$rxcost" || { echo "ERROR: Could not add babel interface for wgpeer $name"; exit 1; }
|
||||
}
|
||||
|
||||
config_load gateway
|
||||
|
@ -137,12 +137,16 @@ configure() {
|
|||
|
||||
apply() {
|
||||
uci commit network
|
||||
uci commit babeld
|
||||
uci commit gateway
|
||||
babel_apply
|
||||
}
|
||||
|
||||
reload() {
|
||||
babel_reload
|
||||
}
|
||||
|
||||
revert() {
|
||||
uci revert network
|
||||
uci revert babeld
|
||||
uci revert gateway
|
||||
babel_revert
|
||||
}
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fff
|
||||
PKG_RELEASE:=$(COMMITCOUNT)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fff-variant/default
|
||||
SECTION:=base
|
||||
CATEGORY:=Freifunk
|
||||
URL:=https://www.freifunk-franken.de
|
||||
DEFAULT:=$(if $(filter fff-variant-$(FFF_VARIANT),$(1)),y,n)
|
||||
DEPENDS:= \
|
||||
+iptables \
|
||||
+ip6tables \
|
||||
+micrond \
|
||||
+odhcp6c \
|
||||
+fff-config \
|
||||
+fff-network \
|
||||
+fff-nodewatcher \
|
||||
+fff-simple-tc \
|
||||
+fff-support \
|
||||
+fff-sysupgrade \
|
||||
+fff-timeserver \
|
||||
+fff-web-ui \
|
||||
+fff-wireless
|
||||
endef
|
||||
|
||||
define Package/fff-variant/default/description
|
||||
This package is used to switch one of the variants on by default
|
||||
endef
|
||||
|
||||
define Package/fff-variant-layer3
|
||||
$(Package/fff-variant/default)
|
||||
TITLE:=Freifunk-Franken Layer3 Variant
|
||||
DEPENDS+=+fff-layer3
|
||||
VARIANT:=layer3
|
||||
endef
|
||||
|
||||
define Package/fff-variant-layer3/description
|
||||
$(Package/fff-variant/default/description)
|
||||
endef
|
||||
|
||||
define Package/fff-variant-node
|
||||
$(Package/fff-variant/default)
|
||||
TITLE:=Freifunk-Franken Node Variant
|
||||
DEPENDS+=+fff-node
|
||||
VARIANT:=node
|
||||
endef
|
||||
|
||||
define Package/fff-variant-node/description
|
||||
$(Package/fff-variant/default/description)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fff-variant-layer3))
|
||||
$(eval $(call BuildPackage,fff-variant-node))
|
Loading…
Reference in New Issue