Skip to content

Commit

Permalink
Don't make recovery patch for devices with prebuilt vendor
Browse files Browse the repository at this point in the history
Change-Id: I05c0155e6331bfeccd4ad545e003fa3fa3498044
  • Loading branch information
TheScarastic authored and mikeNG committed Oct 4, 2020
1 parent 07b4167 commit 00ed066
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
3 changes: 3 additions & 0 deletions core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4311,6 +4311,9 @@ endif
ifeq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true)
$(hide) echo "full_recovery_image=true" >> $@
endif
ifdef BUILDING_VENDOR_IMAGE
$(hide) echo "board_builds_vendorimage=true" >> $@
endif
ifdef BOARD_USES_VENDORIMAGE
$(hide) echo "board_uses_vendorimage=true" >> $@
endif
Expand Down
10 changes: 8 additions & 2 deletions tools/releasetools/make_recovery_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ def main(argv):

board_uses_vendorimage = OPTIONS.info_dict.get(
"board_uses_vendorimage") == "true"
board_builds_vendorimage = OPTIONS.info_dict.get(
"board_builds_vendorimage") == "true"
target_files_dir = None

if board_uses_vendorimage:
if board_builds_vendorimage:
target_files_dir = "VENDOR"
else:
elif not board_uses_vendorimage:
target_files_dir = "SYSTEM/vendor"

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

with open(os.path.join(output_dir, target_files_dir,
*fn.split("/")), "wb") as f:
f.write(data)
Expand Down
9 changes: 7 additions & 2 deletions tools/releasetools/ota_from_target_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,12 +538,17 @@ def _WriteRecoveryImageToBoot(script, output_zip):

def HasRecoveryPatch(target_files_zip, info_dict):
board_uses_vendorimage = info_dict.get("board_uses_vendorimage") == "true"
board_builds_vendorimage = info_dict.get("board_builds_vendorimage") == "true"
target_files_dir = None

if board_uses_vendorimage:
if board_builds_vendorimage:
target_files_dir = "VENDOR"
else:
elif not board_uses_vendorimage:
target_files_dir = "SYSTEM/vendor"

if target_files_dir is None:
return True

patch = "%s/recovery-from-boot.p" % target_files_dir
img = "%s/etc/recovery.img" %target_files_dir

Expand Down

0 comments on commit 00ed066

Please sign in to comment.