[openwrt/openwrt] Qualcommax: IPQ807x: update preinit factory partition mount script

LEDE Commits lede-commits at lists.infradead.org
Tue Apr 22 04:25:49 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6180724737d936542102dc6e1b8186dd287411fb

commit 6180724737d936542102dc6e1b8186dd287411fb
Author: jonathan brophy <professor_jonny at hotmail.com>
AuthorDate: Wed Apr 2 23:36:50 2025 +1300

    Qualcommax: IPQ807x: update preinit factory partition mount script
    
    Patch script used for mounting of factory data partitions to not assume devices names or use hardcoded identifiers.
    
    Signed-off-by: jonathan brophy <professor_jonny at hotmail.com>
    Link: https://github.com/openwrt/openwrt/pull/16329
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../base-files/lib/preinit/09_mount_factory_data   | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data b/target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data
index 2563202a1a..f29362dbce 100644
--- a/target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data
+++ b/target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data
@@ -1,20 +1,28 @@
 #!/bin/sh
 
+. /lib/functions.sh
+. /lib/functions/system.sh
+
 preinit_mount_factory_data() {
+	local part_name="$1"
 	local mtd_path
+	local ubi_num
+
+		mtd_path=$(find_mtd_chardev "$part_name")
+		ubi_num=$(grep $part_name /proc/mtd | cut -c 1-5 | grep -o '[0-9]*')
+		ubiattach --dev-path="$mtd_path" --devn=$ubi_num
+		mkdir /tmp/$part_name
+		mount -o ro,noatime -t ubifs ubi$ubi_num:ubi_$part_name /tmp/$part_name
+}
 
-	. /lib/functions.sh
-	. /lib/functions/system.sh
+preinit_mount_factory_partitions() {
 
 	case $(board_name) in
 	tplink,eap620hd-v1|\
 	tplink,eap660hd-v1)
-		mtd_path=$(find_mtd_chardev "factory_data")
-		ubiattach --dev-path="$mtd_path" --devn=1
-		mkdir /tmp/factory_data
-		mount -o ro,noatime -t ubifs ubi1:ubi_factory_data /tmp/factory_data
+		preinit_mount_factory_data "tp_data"
 		;;
 	esac
 }
 
-boot_hook_add preinit_main preinit_mount_factory_data
+boot_hook_add preinit_main preinit_mount_factory_partitions




More information about the lede-commits mailing list