Merge pull request #2560 from blocktrron/dsa-migration
ramips-mt7621: enable swconfig to DSA migration
This commit is contained in:
		
						commit
						a1ce26be8f
					
				
							
								
								
									
										2
									
								
								modules
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								modules
									
									
									
									
									
								
							@ -13,4 +13,4 @@ PACKAGES_ROUTING_BRANCH=openwrt-22.03
 | 
				
			|||||||
PACKAGES_ROUTING_COMMIT=173576829bc19b66d46667b8b270b6adcddd4119
 | 
					PACKAGES_ROUTING_COMMIT=173576829bc19b66d46667b8b270b6adcddd4119
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PACKAGES_GLUON_REPO=https://github.com/freifunk-gluon/packages.git
 | 
					PACKAGES_GLUON_REPO=https://github.com/freifunk-gluon/packages.git
 | 
				
			||||||
PACKAGES_GLUON_COMMIT=308166e3c6b2d571606dd1dbfadd2bb8e31d8f90
 | 
					PACKAGES_GLUON_COMMIT=b80428166454d184f356e5a14a144911d9ee11aa
 | 
				
			||||||
 | 
				
			|||||||
@ -0,0 +1,72 @@
 | 
				
			|||||||
 | 
					From: David Bauer <mail@david-bauer.net>
 | 
				
			||||||
 | 
					Date: Sun, 5 Jun 2022 23:43:38 +0200
 | 
				
			||||||
 | 
					Subject: ramips-mt7621: make DSA images swconfig upgradable
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
 | 
				
			||||||
 | 
					index bdaeac2cb16e3d27931c0a54d691d834bf274cbb..ac2c84a435c49fb30c21ad2cb6c71a1e94c24192 100644
 | 
				
			||||||
 | 
					--- a/target/linux/ramips/image/mt7621.mk
 | 
				
			||||||
 | 
					+++ b/target/linux/ramips/image/mt7621.mk
 | 
				
			||||||
 | 
					@@ -171,7 +171,6 @@ endef
 | 
				
			||||||
 | 
					 TARGET_DEVICES += asiarf_ap7621-nv1
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					 define Device/asus_rt-ac57u
 | 
				
			||||||
 | 
					-  $(Device/dsa-migration)
 | 
				
			||||||
 | 
					   DEVICE_VENDOR := ASUS
 | 
				
			||||||
 | 
					   DEVICE_MODEL := RT-AC57U
 | 
				
			||||||
 | 
					   DEVICE_ALT0_VENDOR := ASUS
 | 
				
			||||||
 | 
					@@ -400,7 +399,6 @@ endef
 | 
				
			||||||
 | 
					 TARGET_DEVICES += dlink_dir-853-r1
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					 define Device/dlink_dir-860l-b1
 | 
				
			||||||
 | 
					-  $(Device/dsa-migration)
 | 
				
			||||||
 | 
					   $(Device/seama)
 | 
				
			||||||
 | 
					   SEAMA_SIGNATURE := wrgac13_dlink.2013gui_dir860lb
 | 
				
			||||||
 | 
					   LOADER_TYPE := bin
 | 
				
			||||||
 | 
					@@ -1185,7 +1183,6 @@ endef
 | 
				
			||||||
 | 
					 TARGET_DEVICES += mtc_wr1201
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					 define Device/netgear_ex6150
 | 
				
			||||||
 | 
					-  $(Device/dsa-migration)
 | 
				
			||||||
 | 
					   DEVICE_VENDOR := NETGEAR
 | 
				
			||||||
 | 
					   DEVICE_MODEL := EX6150
 | 
				
			||||||
 | 
					   DEVICE_PACKAGES := kmod-mt76x2
 | 
				
			||||||
 | 
					@@ -1197,7 +1194,6 @@ endef
 | 
				
			||||||
 | 
					 TARGET_DEVICES += netgear_ex6150
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					 define Device/netgear_sercomm_nand
 | 
				
			||||||
 | 
					-  $(Device/dsa-migration)
 | 
				
			||||||
 | 
					   $(Device/uimage-lzma-loader)
 | 
				
			||||||
 | 
					   BLOCKSIZE := 128k
 | 
				
			||||||
 | 
					   PAGESIZE := 2048
 | 
				
			||||||
 | 
					@@ -1357,7 +1353,6 @@ endef
 | 
				
			||||||
 | 
					 TARGET_DEVICES += netgear_wac124
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					 define Device/netgear_wndr3700-v5
 | 
				
			||||||
 | 
					-  $(Device/dsa-migration)
 | 
				
			||||||
 | 
					   $(Device/netgear_sercomm_nor)
 | 
				
			||||||
 | 
					   $(Device/uimage-lzma-loader)
 | 
				
			||||||
 | 
					   IMAGE_SIZE := 15232k
 | 
				
			||||||
 | 
					@@ -1681,7 +1676,6 @@ endef
 | 
				
			||||||
 | 
					 TARGET_DEVICES += tplink_tl-wpa8631p-v3
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					 define Device/ubnt_edgerouter_common
 | 
				
			||||||
 | 
					-  $(Device/dsa-migration)
 | 
				
			||||||
 | 
					   $(Device/uimage-lzma-loader)
 | 
				
			||||||
 | 
					   DEVICE_VENDOR := Ubiquiti
 | 
				
			||||||
 | 
					   IMAGE_SIZE := 256768k
 | 
				
			||||||
 | 
					@@ -2067,7 +2061,6 @@ endef
 | 
				
			||||||
 | 
					 TARGET_DEVICES += zbtlink_zbt-wg2626
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					 define Device/zbtlink_zbt-wg3526-16m
 | 
				
			||||||
 | 
					-  $(Device/dsa-migration)
 | 
				
			||||||
 | 
					   $(Device/uimage-lzma-loader)
 | 
				
			||||||
 | 
					   IMAGE_SIZE := 16064k
 | 
				
			||||||
 | 
					   DEVICE_VENDOR := Zbtlink
 | 
				
			||||||
 | 
					@@ -2080,7 +2073,6 @@ endef
 | 
				
			||||||
 | 
					 TARGET_DEVICES += zbtlink_zbt-wg3526-16m
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					 define Device/zbtlink_zbt-wg3526-32m
 | 
				
			||||||
 | 
					-  $(Device/dsa-migration)
 | 
				
			||||||
 | 
					   $(Device/uimage-lzma-loader)
 | 
				
			||||||
 | 
					   IMAGE_SIZE := 32448k
 | 
				
			||||||
 | 
					   DEVICE_VENDOR := Zbtlink
 | 
				
			||||||
@ -0,0 +1,53 @@
 | 
				
			|||||||
 | 
					From: David Bauer <mail@david-bauer.net>
 | 
				
			||||||
 | 
					Date: Sat, 18 Jun 2022 02:37:56 +0200
 | 
				
			||||||
 | 
					Subject: ramips: add MT7621 WiFi devpath migration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Add a migration script to migrate the device path of PCIe WiFi hardware
 | 
				
			||||||
 | 
					from OpenWrt 19.07 to the one used with OpenWrt 21.02+.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Signed-off-by: David Bauer <mail@david-bauer.net>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/00-wifi-migration b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/00-wifi-migration
 | 
				
			||||||
 | 
					new file mode 100644
 | 
				
			||||||
 | 
					index 0000000000000000000000000000000000000000..17fd4a58ff2d56694743e149292746c136b6f27a
 | 
				
			||||||
 | 
					--- /dev/null
 | 
				
			||||||
 | 
					+++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/00-wifi-migration
 | 
				
			||||||
 | 
					@@ -0,0 +1,38 @@
 | 
				
			||||||
 | 
					+#!/bin/sh
 | 
				
			||||||
 | 
					+
 | 
				
			||||||
 | 
					+# Migrate WiFi path from 19.07 to 21.02+
 | 
				
			||||||
 | 
					+
 | 
				
			||||||
 | 
					+WIFI_PATH_CHANGED=0
 | 
				
			||||||
 | 
					+
 | 
				
			||||||
 | 
					+. /lib/functions.sh
 | 
				
			||||||
 | 
					+
 | 
				
			||||||
 | 
					+migrate_wifi_path() {
 | 
				
			||||||
 | 
					+	local section="$1"
 | 
				
			||||||
 | 
					+	local path
 | 
				
			||||||
 | 
					+
 | 
				
			||||||
 | 
					+	config_get path ${section} path
 | 
				
			||||||
 | 
					+	case ${path} in
 | 
				
			||||||
 | 
					+		"pci0000:00/0000:00:00.0/0000:01:00.0")
 | 
				
			||||||
 | 
					+			path="1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0"
 | 
				
			||||||
 | 
					+			WIFI_PATH_CHANGED=1
 | 
				
			||||||
 | 
					+		;;
 | 
				
			||||||
 | 
					+		"pci0000:00/0000:00:01.0/0000:02:00.0")
 | 
				
			||||||
 | 
					+			path="1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0"
 | 
				
			||||||
 | 
					+			WIFI_PATH_CHANGED=1
 | 
				
			||||||
 | 
					+		;;
 | 
				
			||||||
 | 
					+		*)
 | 
				
			||||||
 | 
					+			return 0
 | 
				
			||||||
 | 
					+		;;
 | 
				
			||||||
 | 
					+	esac
 | 
				
			||||||
 | 
					+
 | 
				
			||||||
 | 
					+	uci set wireless.${section}.path=${path}
 | 
				
			||||||
 | 
					+}
 | 
				
			||||||
 | 
					+
 | 
				
			||||||
 | 
					+[ "${ACTION}" = "add" ] && {
 | 
				
			||||||
 | 
					+	[ ! -e /etc/config/wireless ] && return 0
 | 
				
			||||||
 | 
					+
 | 
				
			||||||
 | 
					+	config_load wireless
 | 
				
			||||||
 | 
					+	config_foreach migrate_wifi_path wifi-device
 | 
				
			||||||
 | 
					+
 | 
				
			||||||
 | 
					+	[ "${WIFI_PATH_CHANGED}" = "1" ] && uci commit wireless
 | 
				
			||||||
 | 
					+}
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user