diff --git a/map-agent/files/etc/uci-defaults/100-mapagent-config-migrate.sh b/map-agent/files/etc/uci-defaults/100-mapagent-config-migrate.sh new file mode 100644 index 000000000..c77e3a6ad --- /dev/null +++ b/map-agent/files/etc/uci-defaults/100-mapagent-config-migrate.sh @@ -0,0 +1,53 @@ +#!/bin/sh +. /lib/functions.sh + +cfg=mapagent +config_load $cfg + +if uci -q get $cfg.agent.partial_wifi_reload >/dev/null; then + uci -q set $cfg.agent.partial_wifi_reload='0' +fi + +if uci -q get $cfg.agent.chan_ch_relay_mcast >/dev/null; then + uci -q set $cfg.agent.chan_ch_relay_mcast='0' +fi + +rename_dpp_uri() { + local section="$1" + local type device ifname band + local ch_list="" + + config_get type "$section" type + config_get device "$section" device + config_get ifname "$section" ifname + config_get band "$section" band + config_get chirp_interval "$section" chirp_interval + + append_chan() { + local val="$1" + local chan_num="${val#*/}" + ch_list="$ch_list $chan_num" + } + config_list_foreach "$section" chan append_chan + + new_section=$(uci add "$cfg" dpp_chirp) + [ -n "$type" ] && uci set "$cfg.$new_section.type=$type" + [ -n "$device" ] && uci set "$cfg.$new_section.device=$device" + [ -n "$ifname" ] && uci set "$cfg.$new_section.ifname=$ifname" + [ -n "$band" ] && uci set "$cfg.$new_section.band=$band" + + if [ -n "$chirp_interval" ]; then + uci set "${cfg}.${new_section}.chirp_interval=$chirp_interval" + fi + + for ch in $ch_list; do + uci add_list "$cfg.$new_section.channel=$ch" + done + uci delete "$cfg.$section" +} + +uci -q delete "$cfg.@dpp_controller[0]" + +config_foreach rename_dpp_uri dpp_uri + +exit 0 diff --git a/map-controller/files/etc/uci-defaults/100-mapcntlr-config-migrate.sh b/map-controller/files/etc/uci-defaults/100-mapcntlr-config-migrate.sh new file mode 100644 index 000000000..a4f07f6cd --- /dev/null +++ b/map-controller/files/etc/uci-defaults/100-mapcntlr-config-migrate.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +. /lib/functions.sh + +cfg=mapcontroller +config_load $cfg + +uci -q get $cfg.controller.debug >/dev/null 2>&1 && \ + uci set $cfg.controller.debug='2' + +allow_bgdfs=$(uci -q get $cfg.controller.allow_bgdfs || echo "0") +channel_plan_val=$(uci -q get $cfg.controller.channel_plan || echo "0") + +uci -q delete $cfg.controller.allow_bgdfs +uci -q delete $cfg.controller.channel_plan + +uci -q get $cfg.controller.stale_sta_timeout >/dev/null 2>&1 || \ + uci set $cfg.controller.stale_sta_timeout='30d' + +uci -q del_list $cfg.controller.plugin='zerotouch' +uci -q add_list $cfg.controller.plugin='zerotouch' + +if ! uci show $cfg 2>/dev/null | grep -q "=channel_plan"; then + section=$(uci add $cfg channel_plan) + uci set $cfg.$section.preclear_dfs="$allow_bgdfs" + uci set $cfg.$section.acs="$channel_plan_val" +fi + +exit 0 diff --git a/map-controller/files/etc/uci-defaults/99-mapcontroller-sta-steering b/map-controller/files/etc/uci-defaults/99-mapcontroller-sta-steering index 270ff2858..daf51b2b1 100644 --- a/map-controller/files/etc/uci-defaults/99-mapcontroller-sta-steering +++ b/map-controller/files/etc/uci-defaults/99-mapcontroller-sta-steering @@ -24,6 +24,10 @@ adapt_sta_steering() { uci del_list $cfg.@sta_steering[0].plugins="rcpi" uci add_list $cfg.@sta_steering[0].plugins="rcpi" + uci del_list $cfg.@sta_steering[0].plugins="rate" + uci add_list $cfg.@sta_steering[0].plugins="rate" + uci del_list $cfg.@sta_steering[0].plugins="bsteer" + uci add_list $cfg.@sta_steering[0].plugins="bsteer" uci -q set $cfg.@sta_steering[0].plugins_enabled="1" uci -q set $cfg.@sta_steering[0].plugins_policy="any"