From: 孙春阳 Date: Mon, 22 Dec 2025 14:19:12 +0000 (+0800) Subject: 修复unyaffs脚本 测试mkota_single_user.sh 脚本 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F2964%2Fhead;p=mirrors%2FFD230.git 修复unyaffs脚本 测试mkota_single_user.sh 脚本 --- diff --git a/tools/scripts/unyaffs2tool.py b/tools/scripts/unyaffs2tool.py index d05e3e3db..6dbadce51 100644 --- a/tools/scripts/unyaffs2tool.py +++ b/tools/scripts/unyaffs2tool.py @@ -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 ] [-t] [-v] [-V] [] + # 由于已经 cd 到 target_dir,base dir 可以省略(默认解压到当前目录) + command = "cd " + target_dir +" && " + unyaffstool + " " + binname + " && cd -" os.system(command) os.remove(binname) diff --git a/tools/scripts/unyaffs2tool_singleuser.py b/tools/scripts/unyaffs2tool_singleuser.py index 752c48777..7c2856302 100644 --- a/tools/scripts/unyaffs2tool_singleuser.py +++ b/tools/scripts/unyaffs2tool_singleuser.py @@ -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 ] [-t] [-v] [-V] [] + # 由于已经 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 index 000000000..aa49b9ec4 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 index 000000000..086d8c50f Binary files /dev/null and b/tools/unyaffs_0.9.7/mkyaffs2image.old differ diff --git a/tools/unyaffs_0.9.7/test_yaffs.py b/tools/unyaffs_0.9.7/test_yaffs.py index 2fe6717c8..469c926dc 100644 --- a/tools/unyaffs_0.9.7/test_yaffs.py +++ b/tools/unyaffs_0.9.7/test_yaffs.py @@ -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 index 000000000..b51016885 Binary files /dev/null and b/tools/unyaffs_0.9.7/unyaffs.old differ