mirror of
https://gitee.com/openharmony/update_packaging_tools
synced 2024-11-23 06:40:03 +00:00
Merge branch 'master' of https://gitee.com/summerpass/update_packaging_tools_2
Signed-off-by: unknown <zhangchun39@huawei.com>
This commit is contained in:
commit
4f74151d24
@ -345,9 +345,21 @@ class CreatePackage(object):
|
||||
except IOError:
|
||||
UPDATE_LOGGER.print_log("Add descriptPackageId failed!", log_type=UPDATE_LOGGER.ERROR_LOG)
|
||||
return False
|
||||
self.hash_info_offset = self.compinfo_offset + UPGRADE_RESERVE_LEN
|
||||
if OPTIONS_MANAGER.sd_card:
|
||||
try:
|
||||
# Add hash check data to package
|
||||
hash_check_data.write_hashdata()
|
||||
package_file.seek(self.hash_info_offset)
|
||||
package_file.write(hash_check_data.hashinfo_value + hash_check_data.hashdata)
|
||||
self.hash_info_offset += len(hash_check_data.hashinfo_value + hash_check_data.hashdata)
|
||||
|
||||
except IOError:
|
||||
UPDATE_LOGGER.print_log("Add hash check data failed", log_type=UPDATE_LOGGER.ERROR_LOG)
|
||||
return False
|
||||
self.sign_header(SIGN_ALGO_RSA, hash_check_data, package_file)
|
||||
self.component_offset = self.hash_info_offset
|
||||
for i in range(0, self.head_list.entry_conut):
|
||||
for i in range(0, self.head_list.entry_count):
|
||||
if not self.write_component(self.component_list[i], package_file):
|
||||
UPDATE_LOGGER.print_log("write component failed: %s"
|
||||
% self.component_list[i].component_addr, UPDATE_LOGGER.ERROR_LOG)
|
||||
|
@ -79,7 +79,7 @@ class FullUpdateImage:
|
||||
# No zip mode (no script command)
|
||||
image_write_cmd = self.verse_script.full_image_update(UPDATE_BIN_FILE_NAME)
|
||||
cmd = '%s_WRITE_FLAG%s' % (UPDATE_BIN_FILE_NAME, image_write_cmd)
|
||||
if each_name not in FORBIDEN_UPDATE_IMAGE_LIST:
|
||||
if each_name not in FORBIDEN_UPDATE_IMAGE_SET:
|
||||
self.verse_script.add_command(cmd=cmd)
|
||||
|
||||
UPDATE_LOGGER.print_log(
|
||||
|
@ -44,6 +44,7 @@ from utils import SIGN_PACKAGE_EVENT
|
||||
from utils import CHECK_BINARY_EVENT
|
||||
from utils import ZIP_EVENT
|
||||
from utils import GENERATE_SIGNED_DATA_EVENT
|
||||
from utils import DECOUPLED_EVENT
|
||||
from utils import get_extend_path_list
|
||||
from create_update_package import CreatePackage
|
||||
from create_update_package import SIGN_ALGO_RSA
|
||||
@ -418,6 +419,9 @@ def do_zip_update_package():
|
||||
zip_file.write(OPTIONS_MANAGER.build_tools_zip_obj.name, BUILD_TOOLS_FILE_NAME)
|
||||
|
||||
zip_file.write(OPTIONS_MANAGER.board_list_file_path, "board_list")
|
||||
decouple_res = OPTIONS_MANAGER.init.invoke_event(DECOUPLED_EVENT)
|
||||
if decouple_res is False:
|
||||
zip_file.write(OPTIONS_MANAGER.version_mbn_file_path, "version_list")
|
||||
|
||||
if OPTIONS_MANAGER.max_stash_size != 0:
|
||||
max_stash_file_obj = tempfile.NamedTemporaryFile(mode="w+")
|
||||
|
6
utils.py
6
utils.py
@ -312,7 +312,7 @@ def parse_update_config(xml_path):
|
||||
full_image_path_list = []
|
||||
|
||||
if not OPTIONS_MANAGER.not_l2:
|
||||
expand_component(component_dict)
|
||||
expand_component(comp_dict)
|
||||
if isinstance(component_info, OrderedDict) or isinstance(component_info, dict):
|
||||
component_info = [component_info]
|
||||
if component_info is None:
|
||||
@ -335,13 +335,13 @@ def parse_update_config(xml_path):
|
||||
OPTIONS_MANAGER.full_img_name_list.append(split_img_name(component['#text']))
|
||||
tem_path = os.path.join(OPTIONS_MANAGER.target_package_dir, component.get("#text", None))
|
||||
full_image_path_list.append(tem_path)
|
||||
component_dict[component['@compAddr']] = component_list
|
||||
comp_dict[component['@compAddr']] = component_list
|
||||
elif component['@compType'] == '1':
|
||||
difference_list.append(component['@compAddr'])
|
||||
OPTIONS_MANAGER.incremental_img_name_list.append(split_img_name(component['#text']))
|
||||
|
||||
UPDATE_LOGGER.print_log('XML file parsing completed!')
|
||||
ret_params = [head_list, component_dict, whole_list, difference_list, package_version, full_image_path_list]
|
||||
ret_params = [head_list, comp_dict, whole_list, difference_list, package_version, full_image_path_list]
|
||||
return ret_params
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user