aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlex1911 <dedsa2002@gmail.com>2017-04-07 09:56:44 (GMT)
committerFlex1911 <dedsa2002@gmail.com>2017-04-09 09:09:32 (GMT)
commit96efb2183e7ccc18b569e7a7218075260348ed8d (patch)
tree1d3f7a5690532512a01dee2bb39d82307b0702f6
parent079be45db7263fdb62a029124fb1f71b523e9bab (diff)
downloadandroid_build-staging/cm-14.1_android-7.1.2_r2.zip
android_build-staging/cm-14.1_android-7.1.2_r2.tar.gz
android_build-staging/cm-14.1_android-7.1.2_r2.tar.bz2
build: allow to disable recovery-two-step.img generationstaging/cm-14.1_android-7.1.2_r2refs/changes/52/168252/1
Android 7.1.2 introduced new mechanism for recovery updating in two-step OTAs. Although, recovery-two-step.img generation may be completely broken on some devices with custom mkbootimg handling. We can use recovery.img as base for that devices, so recovery-two-step.img generation will not be required in this case. Let's add new TARGET_NO_TWO_STEP_RECOVERY flag to skip recovery-two-step.img generation during target files packaging if we need it. Change-Id: Icbea2da2f9565277622746545cdb96bf7f5ef3df
-rw-r--r--core/Makefile3
-rwxr-xr-xtools/releasetools/add_img_to_target_files.py16
2 files changed, 12 insertions, 7 deletions
diff --git a/core/Makefile b/core/Makefile
index e1b0534..5eb15c4 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -2100,6 +2100,9 @@ endif
ifeq ($(TARGET_NOT_USE_GZIP_RECOVERY_RAMDISK),true)
$(hide) echo "no_gzip_recovery_ramdisk=true" >> $(zip_root)/META/misc_info.txt
endif
+ifeq ($(TARGET_NO_TWO_STEP_RECOVERY),true)
+ $(hide) echo "no_two_step_recovery=true" >> $(zip_root)/META/misc_info.txt
+endif
ifdef TARGET_RELEASETOOL_FACTORY_FROM_TARGET_SCRIPT
$(hide) echo "factory_from_target_script=$(TARGET_RELEASETOOL_FACTORY_FROM_TARGET_SCRIPT)" >> $(zip_root)/META/misc_info.txt
endif
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py
index 4dd39f9..9595c7e 100755
--- a/tools/releasetools/add_img_to_target_files.py
+++ b/tools/releasetools/add_img_to_target_files.py
@@ -413,6 +413,7 @@ def AddImagesToTargetFiles(filename):
compression=zipfile.ZIP_DEFLATED)
has_recovery = (OPTIONS.info_dict.get("no_recovery") != "true")
+ use_two_step_recovery = (OPTIONS.info_dict.get("no_two_step_recovery") != "true")
def banner(s):
print "\n\n++++ " + s + " ++++\n\n"
@@ -447,13 +448,14 @@ def AddImagesToTargetFiles(filename):
if recovery_image:
recovery_image.AddToZip(output_zip)
- banner("recovery (two-step image)")
- # The special recovery.img for two-step package use.
- recovery_two_step_image = common.GetBootableImage(
- "IMAGES/recovery-two-step.img", "recovery-two-step.img",
- OPTIONS.input_tmp, "RECOVERY", two_step_image=True)
- if recovery_two_step_image:
- recovery_two_step_image.AddToZip(output_zip)
+ if use_two_step_recovery:
+ banner("recovery (two-step image)")
+ # The special recovery.img for two-step package use.
+ recovery_two_step_image = common.GetBootableImage(
+ "IMAGES/recovery-two-step.img", "recovery-two-step.img",
+ OPTIONS.input_tmp, "RECOVERY", two_step_image=True)
+ if recovery_two_step_image:
+ recovery_two_step_image.AddToZip(output_zip)
banner("system")
system_imgname = AddSystem(output_zip, recovery_img=recovery_image,