Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
64 lines
1.2 KiB
Bash
64 lines
1.2 KiB
Bash
#!/bin/sh
|
|
|
|
# This must run before 10-wifi-detect
|
|
|
|
|
|
[ "${ACTION}" = "add" ] || return
|
|
|
|
|
|
. /lib/functions.sh
|
|
|
|
|
|
check_radio()
|
|
{
|
|
local cfg="$1" to="$2"
|
|
|
|
config_get path "$cfg" path
|
|
|
|
[ "$path" = "$to" ] && PATH_EXISTS=true
|
|
}
|
|
|
|
do_migrate_radio()
|
|
{
|
|
local cfg="$1" from="$2" to="$3"
|
|
|
|
config_get path "$cfg" path
|
|
|
|
[ "$path" = "$from" ] || return
|
|
|
|
uci set "wireless.${cfg}.path=${to}"
|
|
WIRELESS_CHANGED=true
|
|
|
|
logger -t wifi-migrate "Updated path of wireless.${cfg} from '${from}' to '${to}'"
|
|
}
|
|
|
|
migrate_radio()
|
|
{
|
|
local from="$1" to="$2"
|
|
|
|
config_load wireless
|
|
|
|
# Check if there is already a section with the target path: In this case, the system
|
|
# was already upgraded to a version without this migration script before; better bail out,
|
|
# as we can't be sure we don't break more than we fix.
|
|
PATH_EXISTS=false
|
|
config_foreach check_radio wifi-device "$to"
|
|
$PATH_EXISTS && return
|
|
|
|
config_foreach do_migrate_radio wifi-device "$from" "$to"
|
|
}
|
|
|
|
|
|
WIRELESS_CHANGED=false
|
|
|
|
case "$(board_name)" in
|
|
*)
|
|
migrate_radio 'platform/18000000.wifi' 'platform/soc/18000000.wifi'
|
|
migrate_radio 'platform/18000000.wifi+1' 'platform/soc/18000000.wifi+1'
|
|
;;
|
|
esac
|
|
|
|
$WIRELESS_CHANGED && uci commit wireless
|
|
|
|
exit 0
|