diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 86925e80b5..7148b753de 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -3833,11 +3833,9 @@ def MakeRecoveryPatch(input_dir, output_sink, recovery_img, boot_img, if board_builds_vendorimage: # In this case, the output sink is rooted at VENDOR recovery_img_path = "etc/recovery.img" - recovery_resource_dat_path = "VENDOR/etc/recovery-resource.dat" elif not board_uses_vendorimage: # In this case the output sink is rooted at SYSTEM recovery_img_path = "vendor/etc/recovery.img" - recovery_resource_dat_path = "SYSTEM/vendor/etc/recovery-resource.dat" else: logger.warning('Recovery patch generation is disable when prebuilt vendor image is used.') return None @@ -3846,24 +3844,7 @@ def MakeRecoveryPatch(input_dir, output_sink, recovery_img, boot_img, output_sink(recovery_img_path, recovery_img.data) else: - include_recovery_dtbo = info_dict.get("include_recovery_dtbo") == "true" - include_recovery_acpio = info_dict.get("include_recovery_acpio") == "true" - path = os.path.join(input_dir, recovery_resource_dat_path) - # Use bsdiff to handle mismatching entries (Bug: 72731506) - if include_recovery_dtbo or include_recovery_acpio: - diff_program = ["bsdiff"] - bonus_args = "" - assert not os.path.exists(path) - else: - diff_program = ["imgdiff"] - if os.path.exists(path): - diff_program.append("-b") - diff_program.append(path) - bonus_args = "--bonus /vendor/etc/recovery-resource.dat" - else: - bonus_args = "" - - d = Difference(recovery_img, boot_img, diff_program=diff_program) + d = Difference(recovery_img, boot_img) _, _, patch = d.ComputePatch() output_sink("recovery-from-boot.p", patch) @@ -3901,7 +3882,7 @@ fi else: sh = """#!/vendor/bin/sh if ! applypatch --check %(recovery_type)s:%(recovery_device)s:%(recovery_size)d:%(recovery_sha1)s; then - applypatch %(bonus_args)s \\ + applypatch \\ --patch /vendor/recovery-from-boot.p \\ --source %(boot_type)s:%(boot_device)s:%(boot_size)d:%(boot_sha1)s \\ --target %(recovery_type)s:%(recovery_device)s:%(recovery_size)d:%(recovery_sha1)s && \\ @@ -3917,8 +3898,7 @@ fi 'boot_type': boot_type, 'boot_device': boot_device + '$(getprop ro.boot.slot_suffix)', 'recovery_type': recovery_type, - 'recovery_device': recovery_device + '$(getprop ro.boot.slot_suffix)', - 'bonus_args': bonus_args} + 'recovery_device': recovery_device + '$(getprop ro.boot.slot_suffix)'} # The install script location moved from /system/etc to /system/bin in the L # release. In the R release it is in VENDOR/bin or SYSTEM/vendor/bin.