修复unyaffs脚本 测试mkota_single_user.sh 脚本
author孙春阳 <snickersun@163.com>
Mon, 22 Dec 2025 14:19:12 +0000 (22:19 +0800)
committer孙春阳 <snickersun@163.com>
Tue, 23 Dec 2025 08:31:35 +0000 (16:31 +0800)
tools/scripts/unyaffs2tool.py
tools/scripts/unyaffs2tool_singleuser.py
tools/unyaffs_0.9.7/mkyaffs2image [new file with mode: 0644]
tools/unyaffs_0.9.7/mkyaffs2image.old [new file with mode: 0644]
tools/unyaffs_0.9.7/test_yaffs.py
tools/unyaffs_0.9.7/unyaffs.old [new file with mode: 0644]

index d05e3e3..6dbadce 100644 (file)
@@ -85,7 +85,10 @@ def unyaffs_img(binname,target_dir):
         except OSError as exc: # Guard against race condition
             if exc.errno != errno.EEXIST:
                 raise
-    command = "cd " + target_dir +" && " + unyaffstool + " -c 2 -s 64 -b " + binname + " && cd -"
+    # unyaffs 0.9.7 使用 -l 选项指定布局: layout=1 表示 2K chunk, 64 byte spare size
+    # 格式: unyaffs [-l <layout>] [-t] [-v] [-V] <image_file_name> [<base dir>]
+    # 由于已经 cd 到 target_dir,base dir 可以省略(默认解压到当前目录)
+    command = "cd " + target_dir +" && " + unyaffstool + " " + binname + " && cd -"
     os.system(command)
     os.remove(binname)
 
index 752c487..7c28563 100644 (file)
@@ -85,7 +85,10 @@ def unyaffs_img(binname,target_dir):
         except OSError as exc: # Guard against race condition
             if exc.errno != errno.EEXIST:
                 raise
-    command = "cd " + target_dir +" && " + unyaffstool + " -c 2 -s 64 -b " + binname + " && cd -"
+    # unyaffs 0.9.7 使用 -l 选项指定布局: layout=1 表示 2K chunk, 64 byte spare size
+    # 格式: unyaffs [-l <layout>] [-t] [-v] [-V] <image_file_name> [<base dir>]
+    # 由于已经 cd 到 target_dir,base dir 可以省略(默认解压到当前目录)
+    command = "cd " + target_dir +" && " + unyaffstool + " " + binname + " && cd -"
     os.system(command)
     os.remove(binname)
 
diff --git a/tools/unyaffs_0.9.7/mkyaffs2image b/tools/unyaffs_0.9.7/mkyaffs2image
new file mode 100644 (file)
index 0000000..aa49b9e
Binary files /dev/null and b/tools/unyaffs_0.9.7/mkyaffs2image differ
diff --git a/tools/unyaffs_0.9.7/mkyaffs2image.old b/tools/unyaffs_0.9.7/mkyaffs2image.old
new file mode 100644 (file)
index 0000000..086d8c5
Binary files /dev/null and b/tools/unyaffs_0.9.7/mkyaffs2image.old differ
index 2fe6717..469c926 100644 (file)
@@ -9,7 +9,7 @@
 
 注意:
 - 新版本 mkyaffs2image:支持 summary chunks
-- 旧版本 mkyaffs2image_old:不支持 summary chunks
+- 旧版本 mkyaffs2image.old:不支持 summary chunks
 - unyaffs 应该能够自动检测并兼容两个版本的镜像格式
 - 脚本会尝试多种 pagesize 和 ecctype 组合
 """
@@ -190,8 +190,8 @@ def main():
     os.chdir(script_dir)
     
     # 检查工具
-    mkyaffs2image_new = script_dir / "mkyaffs2image" / "mkyaffs2image"
-    mkyaffs2image_old = script_dir / "mkyaffs2image" / "mkyaffs2image_old"
+    mkyaffs2image_new = script_dir / "mkyaffs2image"
+    mkyaffs2image_old = script_dir / "mkyaffs2image.old"
     unyaffs = script_dir / "unyaffs"
     res_dir = script_dir / "res"
     
diff --git a/tools/unyaffs_0.9.7/unyaffs.old b/tools/unyaffs_0.9.7/unyaffs.old
new file mode 100644 (file)
index 0000000..b510168
Binary files /dev/null and b/tools/unyaffs_0.9.7/unyaffs.old differ