Compare commits

...

10 Commits

Author SHA1 Message Date
Robert Langhammer 7fb9260b4f Add support for usbstorages
USB tools and kmods

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
2024-03-06 21:48:51 +01:00
Fabian Bläse 7c0a24a80c layer3-config: Add DSA migration script for migrated devices
Because of to the switch from swconfig to DSA, the switchport names
have to be migrated for a few devices. Due to past migrations, we
already have developed a migration script for that.

Duplicate and adjust the script for the newly migrated devices. While at
it, rename the old script to reflect the configuration version bump.

Fixes: #301

Signed-off-by: Fabian Bläse <fabian@blaese.de>
2024-02-16 22:54:44 +01:00
Fabian Bläse ecc590cbaa mpc85xx: retain old compat_version for sysupgrade compatibility
OpenWrt images contain a compat_version, which is used to block upgrades
to newer versions with incompatible configuration, if the configuration
cannot be migrated.

As we maintain our own configuration and all OpenWrt configuration files
are dropped on an upgrade, this upgrade block is not required.

To simplify the upgrade process, retain the old compat_version for the
next sysupgrade release. The compat_version will then be bumped
automatically by the `05_compat-version` board.d script.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
2024-02-16 22:54:44 +01:00
Fabian Bläse fc1c0c39ae fff-network: adjust network configuration of TP-Link TL-WDR4900 for DSA
the TL-WDR4900 was migrated to a DSA driver with OpenWrt 23.05. Adjust
our network configuration accordingly.

Fixes: #302

Signed-off-by: Fabian Bläse <fabian@blaese.de>
2024-02-16 22:54:44 +01:00
Fabian Bläse dfb892d4ac fff-network: add missing cpuport case for the FritzBox 4040
When adjusting our configuration for the DSA migration of the FritzBox
4040, the cpuport was forgotten. The cpuport has to be removed for DSA
devices.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
2024-02-16 22:54:44 +01:00
Fabian Bläse 1677a35624 fff-layer3-config: bump config_version
With OpenWrt 23.05 a few more devices have been migrated to DSA. Bump
the config_version of layer3-config to reflect the necessary migration.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
2024-02-16 22:54:44 +01:00
Fabian Bläse d20b081498 profile: include full hostname in shell prompt
All of our devices are routers. Because they all serve the same purpose,
it is quite common that the first part of the hostname is the same for
multiple devices, and the location of the device is only included in
subsequent parts of the hostname.

Include the full hostname in the shell prompt, so it is easier to
determine the devices location.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
2024-02-16 22:53:51 +01:00
Felix 0280e0d3de README: add missing build prerequisites
The packages rsync and python3-distutils are required for a successful
build, but missing in the prerequisites of the README. Add them.

Reviewed-by: Fabian Bläse <fabian@blaese.de>
2024-01-25 17:48:41 +01:00
Johannes Kimmel 5a6a0a39d7 buildscript: add color to the root warning
Use color output when the `tput` command is available.
`tput` handles terminal-dependant capabilities, so the script should
remain portable.

Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2024-01-25 17:48:41 +01:00
Johannes Kimmel de15c71c53 buildscript: print warning instead of failing build
Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2024-01-25 17:48:38 +01:00
11 changed files with 149 additions and 11 deletions

View File

@ -8,7 +8,7 @@ Weitere Informationen gibt es auf <https://freifunk.net/> und auf <https://wiki.
# Firmware selbst kompilieren
## Voraussetzungen
* `apt-get install zlib1g-dev lua5.2 build-essential unzip libncurses-dev gawk git subversion libssl-dev` (Sicherlich müssen noch mehr Abhängigkeiten installiert werden, diese Liste wird sich hoffentlich nach und nach füllen. Ein erster Ansatzpunkt sind die Abhängigkeiten von OpenWrt selbst)
* `apt-get install zlib1g-dev lua5.2 build-essential unzip libncurses-dev gawk git subversion libssl-dev rsync python3-distutils` (Sicherlich müssen noch mehr Abhängigkeiten installiert werden, diese Liste wird sich hoffentlich nach und nach füllen. Ein erster Ansatzpunkt sind die Abhängigkeiten von OpenWrt selbst)
* `git clone https://git.freifunk-franken.de/freifunk-franken/firmware.git`
* `cd firmware`

View File

@ -26,4 +26,4 @@ alias ls='ls --color=auto'
alias ip='ip --color=auto'
# and color my prompt
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
export PS1='\[\033[01;32m\]\u@\H\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

View File

@ -0,0 +1,17 @@
From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= <fabian@blaese.de>
Date: Wed, 24 Jan 2024 16:50:12 +0200
Subject: [PATCH] mpc85xx: retain old compat_version
diff --git a/target/linux/mpc85xx/image/p1010.mk b/target/linux/mpc85xx/image/p1010.mk
index c0de19f6c6..5aa580300f 100644
--- a/target/linux/mpc85xx/image/p1010.mk
+++ b/target/linux/mpc85xx/image/p1010.mk
@@ -51,8 +51,6 @@ define Device/tplink_tl-wdr4900-v1
DEVICE_VENDOR := TP-Link
DEVICE_MODEL := TL-WDR4900
DEVICE_VARIANT := v1
- DEVICE_COMPAT_VERSION := 1.1
- DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
TPLINK_HEADER_VERSION := 1
TPLINK_HWID := 0x49000001
TPLINK_HWREV := 1

View File

@ -381,8 +381,12 @@ buildall() {
}
if [ "$(/usr/bin/id -u)" -eq 0 ]; then
echo "don't run buildscript as root"
exit 1
TPUT=$(command -v tput || echo ":")
textWarn="$($TPUT bold setaf 1)" # bold + red
textReset="$($TPUT sgr0)" # be a good citizen
printf "${textWarn}WARNING: buildscript is running as root${textReset}\n"
printf "${textWarn}WARNING: build may fail at a later stage${textReset}\n"
fi
if [ "$1" != "selectbsp" -a "$1" != "selectvariant" ]; then

View File

@ -26,7 +26,8 @@ define Package/fff-base
+fff-sysupgrade \
+fff-timeserver \
+fff-web-ui \
+fff-wireless
+fff-wireless \
+fff-usbstorage
endef
define Package/fff-variant/description

View File

@ -7,7 +7,7 @@ configure() {
fi
# check version of configuration
local expected_version=2
local expected_version=3
local config_version=$(uci -q get gateway.meta.config_version)
if ! [ -n "$config_version" ]; then

View File

@ -0,0 +1,76 @@
## this script migrates configs from version 2 to 3.
##
## with version 2 the switchport names of some devices changed
## due to the switch to DSA
BOARD="$(uci get board.model.name)"
# only migrate appropriate config versions
[ "$(uci -q get gateway.meta.config_version)" = "2" ] || exit 1
translate_ports() {
local vlan="$1"
local oldports="$(uci -q get gateway.$vlan.ports)"
local newports
local name
local tag
for port in $oldports; do
# generate new tagged/untagged syntax
if [ -z "${port##*t}" ]; then
# port is tagged
tag=":t"
else
# port is untagged
tag=":*"
fi
# generate new name
case "$BOARD" in
avm,fritzbox-4040)
case "${port%%t}" in
1) name="lan1" ;;
2) name="lan2" ;;
3) name="lan3" ;;
4) name="lan4" ;;
5) name="wan" ;;
*) name="" ;;
esac
;;
tplink,tl-wdr4900-v1)
case "${port%%t}" in
1) name="wan" ;;
2) name="lan1" ;;
3) name="lan2" ;;
4) name="lan3" ;;
5) name="lan4" ;;
*) name="" ;;
esac
;;
esac
# catch empty name (invalid entry or old cpuport)
[ -z "$name" ] && continue
# assemble new port name
newports="$newports ${name}${tag}"
done
# cleanup unnecessary spaces
newports=$(echo "$newports" | xargs)
uci set gateway.$vlan.ports="$newports"
}
case "$BOARD" in
avm,fritzbox-4040|\
tplink,tl-wdr4900-v1)
config_load gateway
config_foreach translate_ports vlan
;;
esac
uci set gateway.meta.config_version='3'
uci commit gateway

View File

@ -15,9 +15,11 @@ get_cpu_port() {
xiaomi,mi-router-4a-100m)
CPUPORT="6t"
;;
avm,fritzbox-4040|\
netgear,r6220|\
tplink,cpe210-v2|\
tplink,cpe210-v3|\
tplink,tl-wdr4900-v1|\
ubnt,edgerouter-4|\
ubnt,edgerouter-x|\
ubnt,edgerouter-x-sfp|\

View File

@ -1,10 +1,11 @@
. /lib/functions/fff/network
WANDEV=eth0
SWITCHDEV=eth0
CLIENT_PORTS="0t 4 5"
WAN_PORTS="0t 1"
BATMAN_PORTS="0t 2 3"
WANDEV=switch0
SWITCHDEV=switch0
CLIENT_PORTS="lan3 lan4"
WAN_PORTS="wan"
BATMAN_PORTS="lan1 lan2"
DSA=1
# use mac address from phy1 with 'locally administered' bit set to '1'
# only possible, because wXmesh is created first and therefore gets the 'universally administered address'

View File

@ -0,0 +1,37 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-usbstorage
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk
define Package/fff-usbstorage
SECTION:=base
CATEGORY:=Freifunk
TITLE:=Freifunk-Franken usb-storage
URL:=https://www.freifunk-franken.de
DEPENDS:=+kmod-usb-storage \
+kmod-usb-storage-uas \
+usbutils \
+block-mount \
+libblkid \
+e2fsprogs \
+kmod-fs-ext4 \
+kmod-fs-exfat \
+f2fs-tools \
+kmod-fs-f2fs
endef
define Package/fff-usbstorage/description
This package adds usbstorage support
endef
define Build/Compile
# nothing
endef
define Package/fff-usbstorage/install
# nothing
endef
$(eval $(call BuildPackage,fff-usbstorage))