Allow addition of recovery DTBO to recovery image
Non-A/B devices need to include the DTBO image
within the recovery partition to be self-sufficient
and prevent OTA failures.
Test: Ran 'm dist' and verified that the DTBO image
was included in recovery.img using unpack_bootimg.
Also ran 'make' and verified that the DTBO image was
included in recovery.img using unpack_bootimg.
Also tested that aosp_angler-userdebug could
boot into recovery(including a fake dtbo.img
in recovery image).
Bug: 74763691
Change-Id: I38c9c395c95d21f4da42cfa646063bd4416f6bd8
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index b5f69a5..fd8a130 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -461,6 +461,11 @@
# "boot" or "recovery", without extension.
partition_name = os.path.basename(sourcedir).lower()
+ if (partition_name == "recovery" and
+ info_dict.get("include_recovery_dtbo") == "true"):
+ fn = os.path.join(sourcedir, "recovery_dtbo")
+ cmd.extend(["--recovery_dtbo", fn])
+
p = Run(cmd, stdout=subprocess.PIPE)
p.communicate()
assert p.returncode == 0, "mkbootimg of %s image failed" % (partition_name,)