From 6d75a854efcef67d5b3f9e33e4d1ea3ff119d512 Mon Sep 17 00:00:00 2001 From: Oleg Lyovin Date: Wed, 22 Mar 2023 17:50:02 +0300 Subject: [PATCH] Fix choosing wrong diff tool for recovery-from-boot patch 'bsdiff' tool should be used when recovery and boot image have mismatching entries. This includes not only the case when system_as_root enabled, but include_recovery_dtbo and include_recovery_acpio too. Add check if they are enabled to synchronize logic with core/Makefile, which already takes this into account. Test: make dist -j Change-Id: Ie673403ae8eae446d006cc524dd48ac6c56194fc Signed-off-by: Oleg Lyovin --- tools/releasetools/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 78055996eb..9bbdc51b76 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -3605,11 +3605,13 @@ def MakeRecoveryPatch(input_dir, output_sink, recovery_img, boot_img, else: system_root_image = info_dict.get("system_root_image") == "true" + 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) # With system-root-image, boot and recovery images will have mismatching # entries (only recovery has the ramdisk entry) (Bug: 72731506). Use bsdiff # to handle such a case. - if system_root_image: + if system_root_image or include_recovery_dtbo or include_recovery_acpio: diff_program = ["bsdiff"] bonus_args = "" assert not os.path.exists(path)