new file mode 100644
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+[ ! -e /etc/config/wireless ] && exit 0
+
+. /lib/functions.sh
+
+PATH_CHANGED=0
+
+rename_wifi_path() {
+ local path_old=$(uci get wireless.${1}.path)
+ local path_new=$(echo ${path_old} | sed "s/pcie-controller/pcie/")
+
+ if [ -e "/sys/devices/${path_new}" ] && [ ${path_old} != ${path_new} ]
+ then
+ uci set wireless.${1}.path=${path_new}
+ PATH_CHANGED=1
+ fi
+}
+
+config_load wireless
+config_foreach rename_wifi_path wifi-device
+
+[ "$PATH_CHANGED" = "1" ] && uci commit wireless
The name of the PCIe controller node in device tree changed between kernel 4.9 and kernel 4.14. Migrate the configuration when an update from kernel 4.9 to 4.14 is done to the new name to make the existing wifi configuration compatible with the new names. This replaces the "pcie-controller" part with "pcie" on all nodes if the file exists in sys fs. This will not do anything with on kernel 4.9. The configuration will not be fixed when migrating back from kernel 4.14 to kernel 4.9. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> --- .../base-files/etc/uci-defaults/05-migrate-wifi | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 target/linux/mvebu/base-files/etc/uci-defaults/05-migrate-wifi