From: 孙春阳 Date: Tue, 23 Dec 2025 07:05:10 +0000 (+0800) Subject: 给编译脚本添加旧版本 mkyaffs2image.old的切换功能 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F2961%2Fhead;p=mirrors%2FFD230.git 给编译脚本添加旧版本 mkyaffs2image.old的切换功能 --- diff --git a/code/sdk/build/config/target_config/brandy/config.py b/code/sdk/build/config/target_config/brandy/config.py index 8fedf75d8..124949c39 100644 --- a/code/sdk/build/config/target_config/brandy/config.py +++ b/code/sdk/build/config/target_config/brandy/config.py @@ -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': { diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/mkyaffs2tool.py b/code/sdk/build/config/target_config/brandy/mk_fs_image/mkyaffs2tool.py index 198d43f67..97f76781f 100644 --- a/code/sdk/build/config/target_config/brandy/mk_fs_image/mkyaffs2tool.py +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/mkyaffs2tool.py @@ -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__)) image_tool_path = os.path.realpath(os.path.join(root_path, 'tools', 'bin', 'platform_tool', 'mkyaffs2image')) -# 配置生成文件镜像工具路径 mkyaffstool = os.path.join(image_tool_path, 'mkyaffs2image') image_name = "file" @@ -78,6 +77,17 @@ if __name__ == "__main__": if sys.argv[3] == 'False': single_user_partition = False fs_image_path=sys.argv[4] + elif len(sys.argv) == 6 : + out_path = os.path.join(sys.argv[1], "%s.bin" %image_name) + if sys.argv[2] == '128' : + cfg_obb_size = 128 + if sys.argv[3] == 'False': + single_user_partition = False + fs_image_path=sys.argv[4] + if sys.argv[5] == 'True': + mkyaffstool = os.path.join(image_tool_path, 'mkyaffs2image.old') + else: + mkyaffstool = os.path.join(image_tool_path, 'mkyaffs2image') else: print("need give parms output path and oobsize!") sys.exit(1) @@ -101,6 +111,7 @@ if __name__ == "__main__": os.remove(tmp_file) if os.path.exists(image_file): os.remove(image_file) + # 配置生成文件镜像工具路径 if single_user_partition : for partition in partition_list_single: if (partition[1] != "null"): diff --git a/code/sdk/build/script/cmake_builder.py b/code/sdk/build/script/cmake_builder.py index 8ce1e2c09..ee0675ebc 100644 --- a/code/sdk/build/script/cmake_builder.py +++ b/code/sdk/build/script/cmake_builder.py @@ -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 index 000000000..086d8c50f Binary files /dev/null and b/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image.old differ