To make use of MCS 8 and 9 which have been introduced with
802.11ac, htmode has to be set to VHTxx.
By checking if the radio supports it, the htmode is configured
to the appropriate HT/VHT setting.
Fixes: #130
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
The script for setting up wXsta (/etc/uci-defaults/24c-fff-wXsta) runs
before the main WiFi config script (/etc/uci-defaults/60-fff-wireless),
so the wXsta config is deleted again by
config_foreach removeWifiIface wifi-iface
This moves the latter script (and another script for WiFi config)
before the wXsta setup, so the WiFi config will be set up correctly.
Fixes: #128
Fixes: 3d9eb1db2e ("fff-hoods/fff-wireless: Reconfigure instead of
delete and create")
Reported-by: Christian Dresel <fff@chrisi01.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Some output and exit status are hidden, as they are a valid behaviour
if the device doesn't have any radios.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
The builds for all BSPs have been merged into a single OpenWRT buildroot.
A prepare between builds cleans everything that has already been built,
including host tools. Building for multiple targets therefore takes quite
a bit longer than it has to.
This removes the prepare command between builds in the buildall command.
It now behaves exactly like multiple conscutive "selectbsp, build" commands,
which speeds up the build for multiple devices a lot.
This now means, that prepare has to be executed before buildall can be used,
just like with the 'build' command.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
If no hoodfile is present or hoodfile support is not compiled
into the firmware, no upgrade path is available. This currently
is the case for layer3 variant.
A fallback to our default firmware host is added. At the moment
both variants don't have a trust anchor for TLS and the wget, that
is currently used, doesn't support TLS. Therefore it is currently
necessary to use a unencrypted http URL.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
As we now have multiple variants, the binaries on the update server
should be seperated into different directories.
To allow the firmware to decide which variant it wants to download,
the "$VARIANT/current" part is removed from the hoodfiles. Instead
it is added inside the upgrade path function in fff-hoodutils.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
This simplifies and shortens filenames quite significantly.
A rewrite script will be installed on the update servers
to allow updating routers with older firmwares.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
This also introduces a variant variable in our buildscript, as
it is necessery multiple times in the build process.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
For some reason sysupgrade seems to return exit status != 0
even on successful calls. As the binary is removed if
sysupgrade exists with a failure status, it is possible that
it got deleted while a sysupgrade has been in progress.
This removal was added to ensure that only one binary occupies
space in tmpfs (which is stored in memory) when upgrading.
If sysupgrade fails and the user starts another try, the old
binary is overwritten by moving the new one to the same location.
Therefore the removal of binaries on sysupgrade failure can be
removed completely.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
With the current OpenWrt patches, both CPE210 v2 and v3 can be
flashed with each other's images. Introduce a separate entry
in tplink_safeloader.c to prevent crossflashing.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
The rssileds set up by OpenWrt cannot be used in our firmware.
Despite that those are bound to "wlan0" initially, we also cannot
change them to one of our interfaces, as the interface recreation
due to configurehood seems to break something in rssileds, causing
high load.
This patch now disables the rssileds entirely, which has been found
to be the only solution reliably solving the problem of high load
under all circumstances.
While at it, add all remaining devices with rssileds enabled in
openwrt-18.06. (When updating to openwrt-19.07, most of the ubnt
will have to be added.)
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
This merges the wifi.* files into a single script, which improves
overview/manageability and makes merging of cases possible.
While at it, remove suppression of errors with "-q".
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
As the originally used version string did not include
the daemons name, it is changed to versions like:
babeld-1.9.1+fff2
Signed-off-by: Fabian Bläse <fabian@blaese.de>
This introduces the pending upstream fix and a patch to change
babeld version.
This applies the naming scheme as for batman-adv:
openwrt-PKG_VERSION-PKG_REVISION
e.g. openwrt-1.9.1-2
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
The build variant previously only got applied in the prepare
step. Therefore selecting a new variant for a subsequent build
without calling prepare again produced a build with a different
variant than the selected one.
As the filename and version number is evaluated in the prebuild
step, which is called on every build, the version number did use
selected variant, so the build variant did not match the variant
in the version string.
As applying the variant only causes the fff-base package to be
fully rebuilt, this step is moved into a function and also executed
in buildscripts prebuild step. It is therefore always applied when
starting a new build.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
So far, we have meta packages and config packages for the variants
in parallel, e.g. fff-node and fff-variant-node.
Since the sole purpose of the meta packages is to define
dependencies, one can just merge them into the corresponding config
packages to reduce overhead.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
In some cases (mostly for one-port devices) IF_WAN was used
although not set, resulting in not obviously iptables error
messages like
- Bad argument `conntrack'
- Bad argument `REJECT'
Thus, check whether IF_WAN is set to something before using it.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
In OpenWrt commit 055cdab2bb22 ("uclient: add ALTERNATIVES for wget")
uclient is registered as ALTERNATIVES provider for wget. Since
the priority for busybox as provider is lowest, this overwrites
the link set for /usr/bin/wget, now pointing to uclient wget.
However, uclient wget does not support IPv6 link-local addresses,
as it's not aware of the "%" to separate address from link identifier.
To prevent wget from failing when those addresses are used, this
patch explicitly uses busybox wget.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
By running "./buildscript updatefeeds", the feeds in build dir are
recreated without touching the rest of the directory.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
This removes the target variable, as it is just an alias for
builddir now.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
So far, building the firmware happens in parallel subdirectories
of "build", one for each subtarget. However, OpenWrt itself is
capable of hosting several target builds in its directory, so
there is no need for this extra separation.
This patch thus build all targets/subtargets directly in the
"build" folder.
Since most of the time during build is spent for the toolchain,
this will also significantly boost build time if more than one
target is used.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
As odhcpd is used as router advertisement server in layer3 variant,
but configurenetwork is still necessary, the dependency to fff-uradvd has
to be removed.
This is done by first checking, if the fff-uradvd service exists, before it
is restarted.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
On layer3 variant ("gateway firmware"), 60-fff-gateway.conf
changes "forwarding" for all interfaces, overwriting the
changes from 51-fff-network-$iface.conf.
By putting the WAN-specific commands after 60-fff-gateway.conf
this patch should provide the correct device-specific value
for WAN interface now.
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[Rephrased commit title and added message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
So far, if build fails, but images from last successful build are
present in OpenWrt build directory (build/bin/targets/...), those
are copied even after unsuccessful build.
This results in the old images being copied to the bin folder and
being labelled with the new firmware revision. (!)
As our error check also only looks at whether images are there,
the image copying process will look like a success.
This patch deletes old images of the target/subtarget to be built,
so that the copy-firmware step will find nothing if the build
stop to early.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
babeld filters routes before announcing them with the
redistribute filters.
Users might add unknown public subnets to the client interface,
so redistribute filters have to be generated for these addresses.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
This adds two checks:
- Does gateway config exist?
- Does gateway config version match?
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
In d9ec8edb15 ("batman-adv: Move from DEBUGFS to batctl") we
switched from deprecated DEBUGFS to batctl.
Despite debugfs, batctl seems to also have deprecated sysfs
(https://www.open-mesh.org/news/90).
This patch thus replaces a reference to iface_status by the
corresponding batctl command.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
This renames two options for wireguard interfaces in
/etc/config/gateway:
public_key -> remote_public_key
private_key -> local_private_key
Signed-off-by: Alexander Gutzeit <alexander.gutzeit@web.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
[adjusted commit message/title, added version bump, remove
rename for network config]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
"ip" is one of the most essential tools on a gateway. At the moment
there is only one dependency to the metapackage ip from the nodewatcher,
which pulls ip-tiny. Dropping the nodewatcher causes a fallback to the
busybox built-in ip-command.
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
[fabian@blaese.de: rebase onto master]
Signed-off-by: Fabian Bläse <fabian@blaese.de>
This package adds gateway.d scripts which create
peering interfaces using wireguard.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
When the user removes a peer from /etc/config/gateway,
the script has to be able to find any leftover configurations
that have been created for it.
This can be made very easy by prepending a prefix to every
automatically generated configuration.
This also allows to remove the nasty check for the babeld default interface.
Therefore the naming check for cfg* also can be removed.
As a side effect all manually created configuration blocks that do not match a
prefix will not be touched by configuregateway.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Various things have to be done for every interface on
which babeld shall run.
Those procedures are moved into functions to reduce duplicate code.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
This adds a line containing the device name and the current
firmware version to the MOTD shown after logging in via SSH, e.g.
> TP-Link TL-WR1043N/ND v2 @ jubtl9_20190320
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Previously, when configurehood switched status, all WiFi devices
were completely rewritten and all interfaces were deleted and
recreated. This is both unnecessary and ugly.
This patch redesigns WiFi setup to create all interfaces (in
parallel) initially, and then only to enable/disable them as
necessary. Where reconfiguration is necessary, only the variable
parts are changed.
Since most of the wifi-device config is already created by
OpenWrt, this builds based on the existing wifi-devices and
only removes the default wifi-ifaces.
This patch will not change the logic (codeflow) of configurehood,
but only affects how action on the WiFi devices/interfaces is
taken.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
The two different names "wXmesh" and "wXibss" have no functional
purpose and are just for indication. Remove this distinction, so
mesh is just mesh.
This will make further adjustment easier and clearer.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Removing the tunneldigger, this patch is no longer needed.
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>