给编译脚本添加旧版本 mkyaffs2image.old的切换功能 2961/1 2961/head
author孙春阳 <snickersun@163.com>
Tue, 23 Dec 2025 07:05:10 +0000 (15:05 +0800)
committer孙春阳 <snickersun@163.com>
Tue, 23 Dec 2025 08:31:52 +0000 (16:31 +0800)
code/sdk/build/config/target_config/brandy/config.py
code/sdk/build/config/target_config/brandy/mk_fs_image/mkyaffs2tool.py
code/sdk/build/script/cmake_builder.py
code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image.old [new file with mode: 0644]

index 8fedf75..124949c 100644 (file)
@@ -1384,6 +1384,7 @@ target = {
                'fs_image_path':'leiniao',
         'ssb_version': 'brandy-native-js-ln-ssb',
                # 'fs_image_path':'evb',
+        # 'mkyaffs2image_old': True,
                'fs_image': True
     },
     'brandy-native-js-ln-r': {
@@ -1573,6 +1574,7 @@ target = {
                'fs_image_path':'leiniao',
         'ssb_version': 'brandy-native-js-ln-ssb',
                # 'fs_image_path':'evb',
+        # 'mkyaffs2image_old': True,
                'fs_image': True
     },
     'brandy-native-js-lnppp-r': {
index 198d43f..97f7678 100644 (file)
@@ -20,7 +20,6 @@ root_path = os.path.join(os.path.split(os.path.realpath(__file__))[0], '..', '..
 cur_dir = os.path.dirname(os.path.abspath(__file__))\r
 image_tool_path = os.path.realpath(os.path.join(root_path, 'tools', 'bin', 'platform_tool', 'mkyaffs2image'))\r
 \r
-# 配置生成文件镜像工具路径\r
 mkyaffstool = os.path.join(image_tool_path, 'mkyaffs2image')\r
 image_name = "file"\r
 \r
@@ -78,6 +77,17 @@ if __name__ == "__main__":
         if sys.argv[3] == 'False':\r
             single_user_partition = False\r
         fs_image_path=sys.argv[4]\r
+    elif len(sys.argv) == 6 :\r
+        out_path = os.path.join(sys.argv[1], "%s.bin" %image_name)\r
+        if sys.argv[2] == '128' :\r
+            cfg_obb_size = 128\r
+        if sys.argv[3] == 'False':\r
+            single_user_partition = False\r
+        fs_image_path=sys.argv[4]\r
+        if sys.argv[5] == 'True':\r
+            mkyaffstool = os.path.join(image_tool_path, 'mkyaffs2image.old')\r
+        else:\r
+            mkyaffstool = os.path.join(image_tool_path, 'mkyaffs2image')\r
     else:\r
         print("need give parms output path and oobsize!")\r
         sys.exit(1)\r
@@ -101,6 +111,7 @@ if __name__ == "__main__":
             os.remove(tmp_file)\r
         if os.path.exists(image_file):\r
             os.remove(image_file)\r
+            # 配置生成文件镜像工具路径\r
         if single_user_partition :\r
             for partition in partition_list_single:\r
                 if (partition[1] != "null"):\r
index 8ce1e2c..ee0675e 100644 (file)
@@ -134,10 +134,13 @@ class CMakeBuilder(BuildEnvironment):
             defines = env.get("defines")
             if "CFG_DRIVERS_NANDFLASH" in defines:
                 print("fs img nandflash mode")
+                mkyaffs2image_old = 'False'
                 if env.get('fs_image_path'):
                     fs_image_path = os.path.join(root_path, 'files', env.get('fs_image_path'))
                 else:
                     fs_image_path = os.path.join(root_path, 'files', 'fd230')
+                if env.get('mkyaffs2image_old'):
+                    mkyaffs2image_old = 'True'
                 # 创建文件校验表,方便检验文件完整性。
                 create_fs_checksum_script_path=os.path.join(root_path, 'build', 'config', 'target_config', env.get('chip'),'mk_fs_image', 'create_fs_checksumfile.py')
                 errcode = exec_shell([self.python_path, create_fs_checksum_script_path, fs_image_path], None, True)
@@ -160,7 +163,7 @@ class CMakeBuilder(BuildEnvironment):
                 else :
                     oobsize = '64' 
 
-                errcode = exec_shell([self.python_path, fs_script_path, output_path, oobsize,single_user_partition,fs_image_path], None, True)
+                errcode = exec_shell([self.python_path, fs_script_path, output_path, oobsize,single_user_partition,fs_image_path,mkyaffs2image_old], None, True)
                 if errcode != 0:
                     print("creat fs image error!")
                     self.print_build_result(target, errcode)
diff --git a/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image.old b/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image.old
new file mode 100644 (file)
index 0000000..086d8c5
Binary files /dev/null and b/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image.old differ