Skip to content

Commit

Permalink
falter-berlin-migration: add migration for rssileds
Browse files Browse the repository at this point in the history
set the rssiled device to the wireless mesh interface.  If
there are no rssid_$WLAN sections, then nothing happens.

While at it, fix a typo in function r1_1_0_ffwizard

Signed-off-by: pmelange <[email protected]>
  • Loading branch information
pmelange authored and Akira25 committed Apr 8, 2021
1 parent bdc0485 commit b0db9f0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/falter-berlin-migration/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=falter-berlin-migration
PKG_VERSION:=2
PKG_VERSION:=3

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ r1_1_0_ffwizard() {

reset_cb
config_load wireless
config_foreach handle_wifi-iface wifi-iface
config_foreach handle_wifi_iface wifi-iface
}

r1_1_0_statistics() {
Expand All @@ -632,6 +632,35 @@ r1_1_0_sharenet_setup() {
fi
}

r1_1_1_rssiled() {
# make sure that the rssileds are set properly to the mesh interface
log "setting rssidleds to the wireless mesh interface"
handle_wifi_iface_rssiled() {
local config=$1
local mode=''
local ifname=''
config_get mode $config mode
config_get ifname $config ifname
[ $mode != "adhoc" ] && [ $mode != "mesh"] && return

local rssidev=${ifname%%-*}
local result = $(uci -q get system.rssid_${rssidev}.dev)
if [ "X${result}X" != "XX" ]; then
# we need to stop the rssileds service before making the new setting
/etc/init.d/rssileds stop
uci set system.rssid_${rssiddev}.dev=${ifname}
# we need to commit the system changes early if we want the
# rssileds service to start correctly
uci commit system
/etc/init.d/rssileds start
fi
}

reset_cb
config_load wireless
config_foreach handle_wifi_iface_rssiled wifi-iface
}

migrate () {
log "Migrating from ${OLD_VERSION} to ${VERSION}."

Expand Down Expand Up @@ -711,6 +740,10 @@ migrate () {
r1_1_0_nosharenet_setup
fi

if semverLT ${OLD_VERSION} "1.1.1"; then
r1_1_1_rssiled
fi

# overwrite version with the new version
log "Setting new system version to ${VERSION}."
uci set system.@system[0].version=${VERSION}
Expand Down

0 comments on commit b0db9f0

Please sign in to comment.