Loading tools/releasetools/ota_from_target_files.py +19 −0 Original line number Diff line number Diff line Loading @@ -273,6 +273,7 @@ OPTIONS.disable_verity_computation = False OPTIONS.partial = None OPTIONS.custom_images = {} OPTIONS.disable_vabc = False OPTIONS.spl_downgrade = False POSTINSTALL_CONFIG = 'META/postinstall_config.txt' DYNAMIC_PARTITION_INFO = 'META/dynamic_partitions_info.txt' Loading @@ -291,6 +292,8 @@ SECONDARY_PAYLOAD_SKIPPED_IMAGES = [ 'system_ext', 'vbmeta', 'vbmeta_system', 'vbmeta_vendor', 'vendor', 'vendor_boot'] SECURITY_PATCH_LEVEL_PROP_NAME = "ro.build.version.security_patch" class PayloadSigner(object): """A class that wraps the payload signing works. Loading Loading @@ -1262,6 +1265,8 @@ def main(argv): OPTIONS.custom_images[custom_partition] = custom_image elif o == "--disable_vabc": OPTIONS.disable_vabc = True elif o == "--spl_downgrade": OPTIONS.spl_downgrade = True else: return False return True Loading Loading @@ -1304,6 +1309,7 @@ def main(argv): "partial=", "custom_image=", "disable_vabc", "spl_downgrade" ], extra_option_handler=option_handler) if len(args) != 2: Loading Loading @@ -1400,6 +1406,19 @@ def main(argv): # Get signing keys OPTIONS.key_passwords = common.GetKeyPasswords([OPTIONS.package_key]) if OPTIONS.source_info_dict: source_build_prop = OPTIONS.source_info_dict["build.prop"] target_build_prop = OPTIONS.target_info_dict["build.prop"] source_spl = source_build_prop.GetProp(SECURITY_PATCH_LEVEL_PROP_NAME) target_spl = target_build_prop.GetProp(SECURITY_PATCH_LEVEL_PROP_NAME) if target_spl < source_spl and not OPTIONS.spl_downgrade: raise common.ExternalError( "Target security patch level {} is older than source SPL {} applying " "such OTA will likely cause device fail to boot. Pass --spl-downgrade " "to override this check. This script expects security patch level to " "be in format yyyy-mm-dd (e.x. 2021-02-05). It's possible to use " "separators other than -, so as long as it's used consistenly across " "all SPL dates".format(target_spl, source_spl)) if generate_ab: GenerateAbOtaPackage( target_file=args[0], Loading Loading
tools/releasetools/ota_from_target_files.py +19 −0 Original line number Diff line number Diff line Loading @@ -273,6 +273,7 @@ OPTIONS.disable_verity_computation = False OPTIONS.partial = None OPTIONS.custom_images = {} OPTIONS.disable_vabc = False OPTIONS.spl_downgrade = False POSTINSTALL_CONFIG = 'META/postinstall_config.txt' DYNAMIC_PARTITION_INFO = 'META/dynamic_partitions_info.txt' Loading @@ -291,6 +292,8 @@ SECONDARY_PAYLOAD_SKIPPED_IMAGES = [ 'system_ext', 'vbmeta', 'vbmeta_system', 'vbmeta_vendor', 'vendor', 'vendor_boot'] SECURITY_PATCH_LEVEL_PROP_NAME = "ro.build.version.security_patch" class PayloadSigner(object): """A class that wraps the payload signing works. Loading Loading @@ -1262,6 +1265,8 @@ def main(argv): OPTIONS.custom_images[custom_partition] = custom_image elif o == "--disable_vabc": OPTIONS.disable_vabc = True elif o == "--spl_downgrade": OPTIONS.spl_downgrade = True else: return False return True Loading Loading @@ -1304,6 +1309,7 @@ def main(argv): "partial=", "custom_image=", "disable_vabc", "spl_downgrade" ], extra_option_handler=option_handler) if len(args) != 2: Loading Loading @@ -1400,6 +1406,19 @@ def main(argv): # Get signing keys OPTIONS.key_passwords = common.GetKeyPasswords([OPTIONS.package_key]) if OPTIONS.source_info_dict: source_build_prop = OPTIONS.source_info_dict["build.prop"] target_build_prop = OPTIONS.target_info_dict["build.prop"] source_spl = source_build_prop.GetProp(SECURITY_PATCH_LEVEL_PROP_NAME) target_spl = target_build_prop.GetProp(SECURITY_PATCH_LEVEL_PROP_NAME) if target_spl < source_spl and not OPTIONS.spl_downgrade: raise common.ExternalError( "Target security patch level {} is older than source SPL {} applying " "such OTA will likely cause device fail to boot. Pass --spl-downgrade " "to override this check. This script expects security patch level to " "be in format yyyy-mm-dd (e.x. 2021-02-05). It's possible to use " "separators other than -, so as long as it's used consistenly across " "all SPL dates".format(target_spl, source_spl)) if generate_ab: GenerateAbOtaPackage( target_file=args[0], Loading