Skip to content

Commit

Permalink
fixup! Correct logic for obtaining the path to full recovery image
Browse files Browse the repository at this point in the history
* The original change had the right idea BUT it removed
  the extra vendor from the "root path" instead of the
  "target" path.

* This broke non-vendor building devices who did not
  set BOARD_USES_FULL_RECOVERY_IMAGE.

* This wasn't noticed for so long on 21 as, well, almost
  no one on 21 doesn't build vendor image AND doesn't
  set the full recovery image flag.

* This restores the expected behavior where all components
  are installed to (device relative) `/vendor`.

Change-Id: Id706d90f54c4a87676b58fd11d76236bffa183f0
  • Loading branch information
luca020400 authored and npjohnson committed Apr 27, 2024
1 parent ff09641 commit 2da41b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions tools/releasetools/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3875,12 +3875,8 @@ def MakeRecoveryPatch(input_dir, output_sink, recovery_img, boot_img,
board_uses_vendorimage = info_dict.get("board_uses_vendorimage") == "true"
board_builds_vendorimage = info_dict.get("board_builds_vendorimage") == "true"

if board_builds_vendorimage:
# In this case, the output sink is rooted at VENDOR
if board_builds_vendorimage or not board_uses_vendorimage:
recovery_img_path = "etc/recovery.img"
elif not board_uses_vendorimage:
# In this case the output sink is rooted at SYSTEM
recovery_img_path = "vendor/etc/recovery.img"
else:
logger.warning('Recovery patch generation is disable when prebuilt vendor image is used.')
return None
Expand Down
2 changes: 1 addition & 1 deletion tools/releasetools/make_recovery_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def main(argv):
if board_builds_vendorimage:
target_files_dir = "VENDOR"
elif not board_uses_vendorimage:
target_files_dir = "SYSTEM"
target_files_dir = "SYSTEM/vendor"

def output_sink(fn, data):
if target_files_dir is None:
Expand Down

0 comments on commit 2da41b2

Please sign in to comment.