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.

Bug: 74763691

Change-Id: I38c9c395c95d21f4da42cfa646063bd4416f6bd8
Merged-In: I38c9c395c95d21f4da42cfa646063bd4416f6bd8
(cherry picked from commit e74a38bc6d)
This commit is contained in:
Hridya Valsaraju
2018-03-21 12:15:11 -07:00
parent 05c62fc0f4
commit d67d8609bb
2 changed files with 20 additions and 2 deletions

View File

@@ -460,6 +460,11 @@ def _BuildBootableImage(sourcedir, fs_config_file, info_dict=None,
# "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,)