kiddin9 3 mesi fa
parent
commit
2842f0e383

+ 0 - 4
devices/common/.config

@@ -38,10 +38,6 @@ CONFIG_IPV6=y
 
 CONFIG_PACKAGE_luci-theme-bootstrap=y
 
-CONFIG_PACKAGE_procd-seccomp=n
-CONFIG_KERNEL_SECCOMP_FILTER=n
-CONFIG_KERNEL_SECCOMP=n
-
 # 其他需要安装的软件包:
 
 CONFIG_PACKAGE_dnsmasq=n

+ 7 - 5
devices/common/patches/imagebuilder.patch

@@ -112,7 +112,7 @@
 +	ifeq ($(shell grep -q small_flash $(TOPDIR)/repositories.conf || echo "not_found"),not_found)
 +        $(shell echo "`grep kwrt_kiddin9 $(TOPDIR)/repositories.conf | sed -e 's/kiddin9/small_flash/g'`" >>$(TOPDIR)/repositories.conf)
 +	endif
-+	ifneq ($(findstring /data/bcache/,$(BIN_DIR)),)
++	ifneq ($(findstring /www/wwwroot/,$(BIN_DIR)),)
 +		BUILD_PACKAGES += -luci-app-istorex -luci-theme-argon -htop -bash -openssh-sftp-server -luci-nginx luci-ssl
 +	endif
 +else
@@ -124,7 +124,7 @@
  BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES))
  PACKAGES:=
  
-@@ -155,7 +182,6 @@ _call_image: staging_dir/host/.prereq-build
+@@ -155,14 +182,16 @@ _call_image: staging_dir/host/.prereq-build
  	echo 'Building images for $(BOARD)$(if $($(USER_PROFILE)_NAME), - $($(USER_PROFILE)_NAME))'
  	echo 'Packages: $(BUILD_PACKAGES)'
  	echo
@@ -132,15 +132,17 @@
  	mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR)
  	$(MAKE) package_reload
  	$(MAKE) package_install
-@@ -163,6 +189,7 @@ _call_image: staging_dir/host/.prereq-build
+ 	$(MAKE) -s prepare_rootfs
  	$(MAKE) -s build_image
  	$(MAKE) -s json_overview_image_info
++ifeq ($(findstring /www/wwwroot/,$(BIN_DIR)),)
  	$(MAKE) -s checksum
++endif
 +	rm -rf $(KERNEL_BUILD_DIR)/tmp $(KERNEL_BUILD_DIR)/root.* $(TARGET_DIR) $(TARGET_DIR_ORIG)
  
  _call_manifest: FORCE
  	rm -rf $(TARGET_DIR)
-@@ -230,9 +257,17 @@ package_install: FORCE
+@@ -230,9 +259,17 @@ package_install: FORCE
  	@echo
  	@echo Installing packages...
  ifeq ($(CONFIG_USE_APK),)
@@ -159,7 +161,7 @@
  else
  	$(APK) add --no-scripts $(firstword $(wildcard $(LINUX_DIR)/libc-*.apk $(PACKAGE_DIR)/libc-*.apk))
  	$(APK) add --no-scripts $(firstword $(wildcard $(LINUX_DIR)/kernel-*.apk $(PACKAGE_DIR)/kernel-*.apk))
-@@ -260,16 +295,19 @@ else
+@@ -260,16 +297,19 @@ else
  	)
  endif
  	$(call prepare_rootfs,$(TARGET_DIR),$(USER_FILES),$(DISABLED_SERVICES))

+ 10 - 1
devices/common/patches/luci-base.patch

@@ -291,7 +291,7 @@
 
 --- a/package/feeds/luci/luci-base/root/usr/share/luci/menu.d/luci-base.json
 +++ b/package/feeds/luci/luci-base/root/usr/share/luci/menu.d/luci-base.json
-@@ -50,6 +50,15 @@
+@@ -50,6 +50,24 @@
  		}
  	},
  
@@ -303,6 +303,15 @@
 +			"recurse": true
 +		}
 +	},
++
++	"admin/control": {
++		"title": "Control",
++		"order": 61,
++		"action": {
++			"type": "firstchild",
++			"recurse": true
++		}
++	},
 +
  	"admin/vpn": {
  		"title": "VPN",

+ 0 - 11
devices/common/patches/seccomp.patch

@@ -1,11 +0,0 @@
---- a/package/system/procd/files/procd.sh
-+++ b/package/system/procd/files/procd.sh
-@@ -260,7 +260,7 @@ _procd_set_param() {
- 		reload_signal)
- 			json_add_int "$type" $(kill -l "$1")
- 		;;
--		pidfile|user|group|seccomp|capabilities|facility|\
-+		pidfile|user|group|capabilities|facility|\
- 		extroot|overlaydir|tmpoverlaysize)
- 			json_add_string "$type" "$1"
- 		;;

+ 310 - 0
devices/common/patches/selective_restore.patch

@@ -0,0 +1,310 @@
+From 58a69ea37f94b9cfae8f4619627469a6596474cd Mon Sep 17 00:00:00 2001
+From: Paul Donald <[email protected]>
+Date: Fri, 11 Oct 2024 00:48:27 +0200
+Subject: [PATCH] luci-mod-system: Allow selective file restore from backups
+
+This is useful when you're importing backups intended for different
+hardware, for example, where e.g. `/etc/config/[network|wireless]` are
+not suitable for the target platform, but everything else useful.
+
+Caveats: subsequent extraction and compression steps happen on the
+target device, to then feed the selective_backup archive to sysupgrade.
+
+Signed-off-by: Paul Donald <[email protected]>
+---
+ .../resources/view/system/flash.js            | 171 ++++++++++++++++++
+ .../usr/share/rpcd/acl.d/luci-mod-system.json |   5 +
+ 2 files changed, 176 insertions(+)
+
+diff --git a/feeds/luci/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js b/feeds/luci/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
+index 2ef096f5f23f..3ffef2aba752 100644
+--- a/feeds/luci/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
++++ b/feeds/luci/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
+@@ -139,6 +139,85 @@ return view.extend({
+ 			}, this, ev.target));
+ 	},
+ 
++	handleSelectiveRestore: function(ev) {
++		return ui.uploadFile('/tmp/backup.tar.gz', ev.target)
++			.then(L.bind(function(btn, res) {
++				btn.firstChild.data = _('Checking archive…');
++				return fs.exec('/bin/tar', [ '-tzf', '/tmp/backup.tar.gz' ]);
++			}, this, ev.target))
++			.then(L.bind(function(btn, res) {
++				if (res.code != 0) {
++					ui.addNotification(null, E('p', _('The uploaded backup archive is not readable')));
++					return fs.remove('/tmp/backup.tar.gz');
++				}
++
++				// Split the stdout to get individual file names
++				var files = res.stdout.split('\n').filter(function(f) { return f.trim() !== ''; });
++
++				// Generate check-boxes for each file with <br /> after each
++				var fileCheckboxes = files.map(function(file) {
++					return E('label', { 'class': 'checkbox' }, [
++						E('input', { 'type': 'checkbox', 'name': 'file', 'value': file }),
++						' ', file, E('br')  // Add line break after each checkbox
++					]);
++				});
++
++				// Helper buttons to check all, none, or inverse
++				var checkAllButton = E('button', {
++					'class': 'btn',
++					'click': function() {
++						// Select all check-boxes
++						document.querySelectorAll('input[name="file"]').forEach(function(cb) {
++							cb.checked = true;
++						});
++					}
++				}, _('Check All'));
++
++				var uncheckAllButton = E('button', {
++					'class': 'btn',
++					'click': function() {
++						// Deselect all check-boxes
++						document.querySelectorAll('input[name="file"]').forEach(function(cb) {
++							cb.checked = false;
++						});
++					}
++				}, _('Check None'));
++
++				var invertButton = E('button', {
++					'class': 'btn',
++					'click': function() {
++						// Deselect all check-boxes
++						document.querySelectorAll('input[name="file"]').forEach(function(cb) {
++							cb.checked = !cb.checked;
++						});
++					}
++				}, _('Invert'));
++
++				// Display the modal with check-boxes and helper buttons
++				ui.showModal(_('Apply backup?'), [
++					E('p', _('The uploaded backup archive appears to be valid and contains the files listed below. Select the files you wish to restore and press "Continue", or "Cancel" to abort.')),
++					E('div', {}, fileCheckboxes), // Display check-boxes for files
++					E('div', { 'class': 'right' }, [
++						checkAllButton, ' ', uncheckAllButton, ' ', invertButton, ' ',
++						E('button', {
++							'class': 'btn',
++							'click': ui.createHandlerFn(this, function(ev) {
++								return fs.remove('/tmp/backup.tar.gz').finally(ui.hideModal);
++							})
++						}, [ _('Cancel') ]), ' ',
++						E('button', {
++							'class': 'btn cbi-button-action important',
++							'click': ui.createHandlerFn(this, 'handleSelectiveRestoreConfirm', btn)
++						}, [ _('Continue') ])
++					])
++				]);
++			}, this, ev.target))
++			.catch(function(e) { ui.addNotification(null, E('p', e.message)) })
++			.finally(L.bind(function(btn, input) {
++				btn.firstChild.data = _('Upload archive...');
++			}, this, ev.target));
++	},
++
+ 	handleRestoreConfirm: function(btn, ev) {
+ 		return fs.exec('/sbin/sysupgrade', [ '--restore-backup', '/tmp/backup.tar.gz' ])
+ 			.then(L.bind(function(btn, res) {
+@@ -169,6 +248,94 @@ return view.extend({
+ 			.finally(function() { btn.firstChild.data = _('Upload archive...') });
+ 	},
+ 
++	handleSelectiveRestoreConfirm: function(btn, ev) {
++		// Get the selected files from the check-boxes
++		var selectedFiles = Array.prototype.slice.call(document.querySelectorAll('input[name="file"]:checked'))
++			.map(function(checkbox) { return checkbox.value; });
++
++		if (selectedFiles.length === 0) {
++			ui.addNotification(null, E('p', _('No files selected for restoration')));
++			return fs.remove('/tmp/backup.tar.gz').finally(ui.hideModal);
++		}
++
++		btn.firstChild.data = _('Creating archive of selected files…');
++
++		// Write the selected file names into a temporary file for tar -T option
++		var fileList = selectedFiles.join('\n');
++		return fs.write('/tmp/filelist.txt', fileList)
++			.then(L.bind(function() {
++				// Make selective restore directory
++			return fs.exec('/bin/mkdir', ['-p', '/tmp/selective_restore/']);
++			}, this))
++			.then(L.bind(function(mkdirRes) {
++				if (mkdirRes.code != 0) {
++					ui.addNotification(null, [
++						E('p', _('Path creation failed with code %d').format(mkdirRes.code)),
++						mkdirRes.stderr ? E('pre', {}, [ mkdirRes.stderr ]) : ''
++					]);
++					L.raise('Error', 'Path creation failed');
++				}
++				// Extract the tar.gz with only the selected files
++				return fs.exec('/bin/tar', ['-xzf', '/tmp/backup.tar.gz', '-T', '/tmp/filelist.txt', '-C', '/tmp/selective_restore/']);
++			}, this))
++			.then(L.bind(function(tarRes) {
++				if (tarRes.code != 0) {
++					ui.addNotification(null, [
++						E('p', _('Tar extraction failed with code %d').format(tarRes.code)),
++						tarRes.stderr ? E('pre', {}, [ tarRes.stderr ]) : ''
++					]);
++					L.raise('Error', 'Tar extraction failed');
++				}
++				// Create the new tar.gz with only the selected files
++				return fs.exec('/bin/tar', ['-czf', '/tmp/selective_restore.tar.gz', '-T', '/tmp/filelist.txt', '-C', '/tmp/selective_restore/']);
++			}, this))
++			.then(L.bind(function(tarRes) {
++				if (tarRes.code != 0) {
++					ui.addNotification(null, [
++						E('p', _('The tar creation failed with code %d').format(tarRes.code)),
++						tarRes.stderr ? E('pre', {}, [ tarRes.stderr ]) : ''
++					]);
++					L.raise('Error', 'Tar creation failed');
++				}
++
++				// Now use sysupgrade with the newly created tar.gz
++				return fs.exec('/sbin/sysupgrade', ['--restore-backup', '/tmp/selective_restore.tar.gz']);
++			}, this))
++			.then(L.bind(function(sysupgradeRes) {
++				if (sysupgradeRes.code != 0) {
++					ui.addNotification(null, [
++						E('p', _('The sysupgrade command failed with code %d').format(sysupgradeRes.code)),
++						sysupgradeRes.stderr ? E('pre', {}, [ sysupgradeRes.stderr ]) : ''
++					]);
++					L.raise('Error', 'Sysupgrade failed');
++				}
++
++				// Proceed with reboot after successful restore
++				btn.firstChild.data = _('Rebooting…');
++				return fs.exec('/sbin/reboot');
++			}, this))
++			.then(L.bind(function(res) {
++				if (res.code != 0) {
++					ui.addNotification(null, E('p', _('The reboot command failed with code %d').format(res.code)));
++					L.raise('Error', 'Reboot failed');
++				}
++
++				// Show rebooting modal
++				ui.showModal(_('Rebooting…'), [
++					E('p', { 'class': 'spinning' }, _('The system is rebooting now. If the restored configuration changed the current LAN IP address, you might need to reconnect manually.'))
++				]);
++
++				// Await reconnection
++				ui.awaitReconnect(window.location.host, '192.168.1.1', 'openwrt.lan');
++			}, this))
++			.catch(function(e) { 
++				ui.addNotification(null, E('p', e.message)); 
++			})
++			.finally(function() { 
++				btn.firstChild.data = _('Upload archive...'); 
++			});
++	},
++
+ 	handleBlock: function(hostname, ev) {
+ 		var mtdblock = dom.parent(ev.target, '.cbi-section').querySelector('[data-name="mtdselect"] select');
+ 		var mtdnumber = mtdblock.value;
+@@ -414,6 +581,10 @@ return view.extend({
+ 		o.inputtitle = _('Upload archive...');
+ 		o.onclick = L.bind(this.handleRestore, this);
+ 
++		o = ss.option(form.Button, 'selective_restore', _('Selectively Restore backup'), _('Custom files (certificates, scripts) may remain on the system. To prevent this, perform a factory-reset first.'));
++		o.inputstyle = 'action important';
++		o.inputtitle = _('Upload archive...');
++		o.onclick = L.bind(this.handleSelectiveRestore, this);
+ 
+ 		var mtdblocks = [];
+ 		procmtd.split(/\n/).forEach(function(ln) {
+diff --git a/feeds/luci/modules/luci-mod-system/root/usr/share/rpcd/acl.d/luci-mod-system.json b/feeds/luci/modules/luci-mod-system/root/usr/share/rpcd/acl.d/luci-mod-system.json
+index b096d870a754..2991613ef1af 100644
+--- a/feeds/luci/modules/luci-mod-system/root/usr/share/rpcd/acl.d/luci-mod-system.json
++++ b/feeds/luci/modules/luci-mod-system/root/usr/share/rpcd/acl.d/luci-mod-system.json
+@@ -149,6 +149,9 @@
+ 			"cgi-io": [ "upload" ],
+ 			"file": {
+ 				"/bin/tar -tzf /tmp/backup.tar.gz": [ "exec" ],
++				"/bin/mkdir -p /tmp/selective_restore/": [ "exec" ],
++				"/bin/tar -xzf /tmp/backup.tar.gz -T /tmp/filelist.txt -C /tmp/selective_restore/": [ "exec" ],
++				"/bin/tar -czf /tmp/selective_restore.tar.gz -T /tmp/filelist.txt -C /tmp/selective_restore/": [ "exec" ],
+ 				"/etc/sysupgrade.conf": [ "write" ],
+ 				"/sbin/firstboot -r -y": [ "exec" ],
+ 				"/sbin/reboot": [ "exec" ],
+@@ -162,8 +165,10 @@
+ 				"/sbin/sysupgrade -u /tmp/firmware.bin": [ "exec" ],
+ 				"/sbin/sysupgrade -u -k /tmp/firmware.bin": [ "exec" ],
+ 				"/sbin/sysupgrade --restore-backup /tmp/backup.tar.gz": [ "exec" ],
++				"/sbin/sysupgrade --restore-backup /tmp/selective_restore.tar.gz": [ "exec" ],
+ 				"/sbin/sysupgrade --test /tmp/firmware.bin": [ "exec" ],
+ 				"/sbin/sysupgrade /tmp/firmware.bin": [ "exec" ],
++				"/tmp/filelist.txt": [ "write" ],
+ 				"/tmp/backup.tar.gz": [ "write" ],
+ 				"/tmp/firmware.bin": [ "write" ]
+ 			},
+diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
+index 75817d178aea18..4a51304f771e20 100755
+--- a/package/base-files/files/sbin/sysupgrade
++++ b/package/base-files/files/sbin/sysupgrade
+@@ -22,6 +22,8 @@ CONF_BACKUP_LIST=0
+ CONF_BACKUP_LIST=0
+ CONF_BACKUP=
+ CONF_RESTORE=
++CONF_SELECTIVE_RESTORE=
++CONF_SELECTIVE_RESTORE_FILELIST=
+ NEED_IMAGE=
+ HELP=0
+ TEST=0
+@@ -51,6 +53,7 @@ while [ -n "$1" ]; do
+ 		-u) SKIP_UNCHANGED=1;;
+ 		-b|--create-backup) CONF_BACKUP="$2" NEED_IMAGE=1; shift;;
+ 		-r|--restore-backup) CONF_RESTORE="$2" NEED_IMAGE=1; shift;;
++		-S|--selectively-restore-backup) CONF_SELECTIVE_RESTORE_FILELIST="$2" CONF_SELECTIVE_RESTORE="$3" NEED_IMAGE=1; shift;shift;;
+ 		-l|--list-backup) CONF_BACKUP_LIST=1;;
+ 		-f) CONF_IMAGE="$2"; shift;;
+ 		-s) USE_CURR_PART=1;;
+@@ -105,6 +108,11 @@ backup-command:
+ 	             restore a .tar.gz created with sysupgrade -b
+ 	             then exit. Does not flash an image. If file is '-',
+ 	             the archive is read from stdin.
++	-S | --selectively-restore-backup <file-with-list-of-filenames> <file>
++	             selectively restore a .tar.gz created with sysupgrade -b
++	             by passing a file containing the desired list of filenames,
++	             then exit. Does not flash an image. If file is '-',
++	             the archive is read from stdin.
+ 	-l | --list-backup
+ 	             list the files that would be backed up when calling
+ 	             sysupgrade -b. Does not create a backup file.
+@@ -351,6 +359,22 @@ if [ -n "$CONF_RESTORE" ]; then
+ 	exit $?
+ fi
+ 
++if [ -n "$CONF_SELECTIVE_RESTORE" ]; then
++	if [ "$CONF_SELECTIVE_RESTORE" != "-" ] && [ ! -f "$CONF_SELECTIVE_RESTORE" ]; then
++		echo "Backup archive '$CONF_SELECTIVE_RESTORE' not found." >&2
++		exit 1
++	fi
++
++	[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
++	v "Selectively restoring config files..."
++	if [ "$(type -t platform_restore_backup)" = 'platform_restore_backup' ]; then
++		platform_selectively_restore_backup "$TAR_V"
++	else
++		tar -C / -x"${TAR_V}"zf "$CONF_SELECTIVE_RESTORE" -T "$CONF_SELECTIVE_RESTORE_FILELIST"
++	fi
++	exit $?
++fi
++
+ type platform_check_image >/dev/null 2>/dev/null || {
+ 	echo "Firmware upgrade is not implemented for this platform." >&2
+ 	exit 1
+diff --git a/target/linux/bcm27xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm27xx/base-files/lib/upgrade/platform.sh
+index 69cc60e2bcb095..b7fffd68b4b450 100644
+--- a/target/linux/bcm27xx/base-files/lib/upgrade/platform.sh
++++ b/target/linux/bcm27xx/base-files/lib/upgrade/platform.sh
+@@ -128,3 +128,10 @@ platform_restore_backup() {
+ 	tar -C / -x${TAR_V}zf "$CONF_RESTORE"
+ 	bcm27xx_set_root_part
+ }
++
++platform_selectively_restore_backup() {
++	local TAR_V=$1
++
++	tar -C / -x${TAR_V}zf "$CONF_RESTORE" -T "$CONF_SELECTIVE_RESTORE_FILELIST"
++	bcm27xx_set_root_part
++}

+ 3 - 2
devices/mediatek_filogic/patches/tr3000-mod.patch

@@ -70,6 +70,7 @@
  	cudy,re3000-v1|\
 -	cudy,tr3000-v1|\
 +	cudy,tr3000*|\
+ 	cudy,wr3000e-v1|\
  	cudy,wr3000s-v1|\
- 	cudy,wr3000-v1)
- 		addr=$(mtd_get_mac_binary bdinfo 0xde00)
+ 	cudy,wr3000h-v1|\
+

+ 5 - 3
devices/qualcommax_ipq50xx/diy.sh

@@ -4,14 +4,16 @@ shopt -s extglob
 
 SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
-rm -rf package/boot package/kernel/qca* package/firmware/ipq-wifi package/firmware/ath11k-firmware target/linux/qualcommax target/linux/generic
+rm -rf package/boot package/kernel/qca* package/firmware/ipq-wifi package/firmware/ath11k-firmware target/linux/qualcommax target/linux/generic package/devel/perf
 
 git_clone_path master https://github.com/coolsnowwolf/lede target/linux/qualcommax target/linux/generic package/boot package/qca package/firmware/ipq-wifi package/firmware/ath11k-firmware
 
 wget -N https://github.com/coolsnowwolf/lede/raw/master/include/kernel-6.6 -P include/
 
-sed -i "s/wpad-openssl/wpad-basic-mbedtls/" target/linux/qualcommax/Makefile
-sed -i "/KERNEL_TESTING_PATCHVER/d" target/linux/qualcommax/Makefile
+sed -i -e "s/wpad-openssl/wpad-basic-mbedtls/" \
+	   -e "/KERNEL_TESTING_PATCHVER/d" \
+	   -e "s/KERNEL_PATCHVER:=6.12/KERNEL_PATCHVER:=6.6/" \
+target/linux/qualcommax/Makefile
 
 sed -i "/ECM_INTERFACE_MAP_T_ENABLE/d"  package/qca/qca-nss-ecm/Makefile
 

+ 0 - 11
devices/qualcommax_ipq50xx/patches/fix.patch

@@ -1,14 +1,3 @@
---- a/package/kernel/linux/modules/netdevices.mk
-+++ b/package/kernel/linux/modules/netdevices.mk
-@@ -450,7 +450,7 @@ define KernelPackage/phy-realtek
-    KCONFIG:=CONFIG_REALTEK_PHY \
-     CONFIG_REALTEK_PHY_HWMON=y
-    DEPENDS:=+kmod-libphy +kmod-hwmon-core
--   FILES:=$(LINUX_DIR)/drivers/net/phy/realtek/realtek.ko
-+   FILES:=$(LINUX_DIR)/drivers/net/phy/realtek.ko
-    AUTOLOAD:=$(call AutoLoad,18,realtek,1)
- endef
-
 --- a/package/kernel/linux/modules/netfilter.mk
 +++ b/package/kernel/linux/modules/netfilter.mk
 @@ -330,7 +330,7 @@ define KernelPackage/ipt-ipopt

+ 1 - 4
devices/qualcommax_ipq60xx/.config

@@ -1,9 +1,6 @@
+
 CONFIG_TARGET_qualcommax=y
 CONFIG_TARGET_qualcommax_ipq60xx=y
 CONFIG_TARGET_MULTI_PROFILE=y
 CONFIG_TARGET_ALL_PROFILES=y
-CONFIG_PACKAGE_kmod-qca-nss-drv-tunipip6=n
-CONFIG_PACKAGE_kmod-qca-nss-drv-mirror=n
-CONFIG_PACKAGE_kmod-qca-nss-drv-match=n
-
 

+ 0 - 1
devices/qualcommax_ipq60xx/README.md

@@ -1 +0,0 @@
-源码来源 https://github.com/LiBwrt-op/openwrt-6.x 感谢

+ 10 - 17
devices/qualcommax_ipq60xx/diy.sh

@@ -4,25 +4,18 @@ shopt -s extglob
 
 SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
-wget -N https://raw.githubusercontent.com/openwrt/openwrt/refs/heads/openwrt-24.10/target/imagebuilder/files/Makefile -P target/imagebuilder/files/
-wget -N https://raw.githubusercontent.com/openwrt/openwrt/refs/heads/openwrt-24.10/package/base-files/files/sbin/sysupgrade -P package/base-files/files/sbin/
-wget -N https://github.com/openwrt/openwrt/raw/refs/heads/openwrt-24.10/package/network/config/firewall/Makefile -P package/network/config/firewall/
-wget -N https://github.com/openwrt/openwrt/raw/refs/heads/openwrt-24.10/package/network/services/dnsmasq/files/dnsmasq.init -P package/network/services/dnsmasq/files/
-wget -N https://github.com/openwrt/openwrt/raw/refs/heads/openwrt-24.10/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh -P package/network/config/wifi-scripts/files/lib/netifd/
-wget -N https://raw.githubusercontent.com/openwrt/openwrt/refs/heads/main/include/target.mk -P include/
+rm -rf package/boot package/kernel/qca* package/firmware/ipq-wifi package/firmware/ath11k-firmware target/linux/qualcommax target/linux/generic package/devel/perf
 
-git clone https://github.com/LiBwrt/nss-packages nss-packages
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/qualcommax target/linux/generic package/boot package/qca package/firmware/ipq-wifi package/firmware/ath11k-firmware
 
-mv -f nss-packages/* package/feeds/kiddin9/
+wget -N https://github.com/coolsnowwolf/lede/raw/master/include/kernel-6.6 -P include/
 
-sed -i "/ECM_INTERFACE_RAWIP_ENABLE/d"  package/feeds/kiddin9/qca-nss-ecm/Makefile
+sed -i -e "s/wpad-openssl/wpad-basic-mbedtls/" \
+	   -e "/KERNEL_TESTING_PATCHVER/d" \
+	   -e "s/KERNEL_PATCHVER:=6.12/KERNEL_PATCHVER:=6.6/" \
+target/linux/qualcommax/Makefile
 
-rm -rf feeds/kiddin9/{fullconenat-nft,xtables-wgobfs,shortcut-fe} package/devel/perf package/feeds/packages/{libpfring,ovpn-dco,xr_usb_serial_common,openvswitch,xtables-addons}
+sed -i "/ECM_INTERFACE_MAP_T_ENABLE/d"  package/qca/qca-nss-ecm/Makefile
 
-rm -rf target/linux/generic/hack-6.6/220-arm-gc_sections.patch
-
-sed -i "s/wpad-openssl/wpad-basic-mbedtls/" target/linux/qualcommax/Makefile
-
-sed -i "s/LiBwrt/Kwrt/Ig" package/base-files/files/bin/config_generate package/base-files/image-config.in package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc config/Config-images.in Config.in include/u-boot.mk include/version.mk || true
-
-sed -i -e "s/set \${s}.country='\${country || ''}'/set \${s}.country='\${country || \"CN\"}'/g" -e "s/set \${s}.disabled=.*/set \${s}.disabled='0'/" package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc
+make defconfig
+sed -i "s/\(CONFIG_PACKAGE_kmod-qca.*\)=m/\1=n/g" .config

+ 0 - 4
devices/qualcommax_ipq60xx/feeds.conf.default

@@ -1,4 +0,0 @@
-src-git packages https://git.openwrt.org/feed/packages.git;openwrt-24.10
-src-git luci https://git.openwrt.org/project/luci.git;openwrt-24.10
-src-git routing https://git.openwrt.org/feed/routing.git;openwrt-24.10
-src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-24.10

+ 0 - 11
devices/qualcommax_ipq60xx/patches/default-packages.patch

@@ -1,11 +0,0 @@
---- a/include/target.mk
-+++ b/include/target.mk
-@@ -52,8 +52,6 @@ DEFAULT_PACKAGES.nas:=\
- DEFAULT_PACKAGES.router:=\
- 	dnsmasq-full \
- 	firewall4 \
--	nftables \
--	kmod-nft-offload \
- 	odhcp6c \
- 	odhcpd-ipv6only \
- 	ppp \

+ 11 - 30
devices/qualcommax_ipq60xx/patches/fix.patch

@@ -1,32 +1,13 @@
---- a/package/kernel/linux/modules/crypto.mk
-+++ b/package/kernel/linux/modules/crypto.mk
-@@ -302,7 +302,7 @@ define KernelPackage/crypto-gf128
-   KCONFIG:= \
- 	CONFIG_CRYPTO_GF128MUL \
- 	CONFIG_CRYPTO_LIB_GF128MUL
--  FILES:=$(LINUX_DIR)/lib/crypto/gf128mul.ko
-+  FILES:=$(LINUX_DIR)/crypto/gf128mul.ko
-   AUTOLOAD:=$(call AutoLoad,09,gf128mul)
-   $(call AddDepends/crypto)
+--- a/package/kernel/linux/modules/netfilter.mk
++++ b/package/kernel/linux/modules/netfilter.mk
+@@ -330,7 +330,7 @@ define KernelPackage/ipt-ipopt
+   KCONFIG:=$(KCONFIG_IPT_IPOPT)
+   FILES:=$(foreach mod,$(IPT_IPOPT-m),$(LINUX_DIR)/net/$(mod).ko)
+   AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_IPOPT-m)))
+-  $(call AddDepends/ipt)
++  $(call AddDepends/ipt,+kmod-nf-conntrack)
  endef
+ 
+ define KernelPackage/ipt-ipopt/description
 
---- a/target/linux/qualcommax/image/ipq60xx.mk
-+++ b/target/linux/qualcommax/image/ipq60xx.mk
-@@ -236,7 +236,7 @@ define Device/jdcloud_re-ss-01
- 	$(call Device/FitImage)
- 	$(call Device/EmmcImage)
- 	DEVICE_VENDOR := JDCloud
--	DEVICE_MODEL := RE-SS-01
-+	DEVICE_MODEL := AX1800 Pro
- 	BLOCKSIZE := 128k
- 	KERNEL_SIZE := 6144k
- 	SOC := ipq6000
-@@ -250,7 +250,7 @@ define Device/jdcloud_re-cs-02
- 	$(call Device/FitImage)
- 	$(call Device/EmmcImage)
- 	DEVICE_VENDOR := JDCloud
--	DEVICE_MODEL := RE-CS-02
-+	DEVICE_MODEL := AX6600
- 	BLOCKSIZE := 128k
- 	KERNEL_SIZE := 6144k
- 	SOC := ipq6010
+ 

+ 22 - 0
devices/qualcommax_ipq60xx/patches/zn-m2.patch

@@ -0,0 +1,22 @@
+--- a/target/linux/qualcommax/image/ipq60xx.mk
++++ b/target/linux/qualcommax/image/ipq60xx.mk
+@@ -10,6 +10,8 @@ define Device/cmiot_ax18
+ 	$(call Device/UbiFit)
+ 	DEVICE_VENDOR := CMIOT
+ 	DEVICE_MODEL := AX18
++	DEVICE_ALT0_VENDOR := ZN
++	DEVICE_ALT0_MODEL := M2
+ 	BLOCKSIZE := 128k
+ 	PAGESIZE := 2048
+ 	DEVICE_DTS_CONFIG := config@cp03-c1
+@@ -127,7 +129,9 @@ define Device/xiaomi_rm1800
+ 	$(call Device/FitImage)
+ 	$(call Device/UbiFit)
+ 	DEVICE_VENDOR := Xiaomi
+-	DEVICE_MODEL := RM1800 (AX5)
++	DEVICE_MODEL := AX1800
++	DEVICE_ALT0_VENDOR := Redmi
++	DEVICE_ALT0_MODEL := AX5
+ 	BLOCKSIZE := 128k
+ 	PAGESIZE := 2048
+ 	SOC := ipq6000

+ 0 - 10
devices/qualcommax_ipq60xx/settings.ini

@@ -1,10 +0,0 @@
-REPO_URL="https://github.com/LiBwrt/openwrt-6.x"
-REPO_BRANCH=""
-CONFIG_FILE=".config"
-DIY_SH="diy.sh"
-FREE_UP_DISK="false"
-UPLOAD_BIN_DIR_FOR_ARTIFACT="false"
-UPLOAD_FIRMWARE_FOR_ARTIFACT="true"
-UPLOAD_FIRMWARE_FOR_RELEASE="false"
-UPLOAD_FIRMWARE_TO_COWTRANSFER="false"
-UPLOAD_FIRMWARE_TO_WETRANSFER="true"

+ 0 - 11
devices/rockchip_armv8/patches/fix.patch

@@ -1,11 +0,0 @@
---- a/package/kernel/linux/modules/netdevices.mk
-+++ b/package/kernel/linux/modules/netdevices.mk
-@@ -450,7 +450,7 @@ define KernelPackage/phy-realtek
-    KCONFIG:=CONFIG_REALTEK_PHY \
-     CONFIG_REALTEK_PHY_HWMON=y
-    DEPENDS:=+kmod-libphy +kmod-hwmon-core
--   FILES:=$(LINUX_DIR)/drivers/net/phy/realtek/realtek.ko
-+   FILES:=$(LINUX_DIR)/drivers/net/phy/realtek.ko
-    AUTOLOAD:=$(call AutoLoad,18,realtek,1)
- endef
-