Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d475d62 authored by ctso's avatar ctso Committed by Koushik Dutta
Browse files

Add TARGET_OTA_BACKUPTOOL env variable.

Change-Id: I2db56556a26406da084cbf5e1d40b235c7612cdd
parent ffc23870
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -990,6 +990,13 @@ else
$(INTERNAL_OTA_PACKAGE_TARGET): backuptool := $(TARGET_OTA_BACKUPTOOL)
endif

ifeq ($(TARGET_NO_RECOVERY),)
# default to "false"
$(INTERNAL_OTA_PACKAGE_TARGET): recoveryex := false
else
$(INTERNAL_OTA_PACKAGE_TARGET): recoveryex := $(TARGET_NO_RECOVERY)
endif

ifeq ($(TARGET_OTA_ASSERT_DEVICE),)
$(INTERNAL_OTA_PACKAGE_TARGET): override_device := auto
else
@@ -1004,6 +1011,7 @@ $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTATOOLS)
	   -p $(HOST_OUT) \
           -k $(KEY_CERT_PAIR) \
           --backup=$(backuptool) \
           --recovery=$(recoveryex) \
	   --override_device=$(override_device) \
           $(BUILT_TARGET_FILES_PACKAGE) $@

+18 −6
Original line number Diff line number Diff line
@@ -52,6 +52,10 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package
      Enable or disable the execution of backuptool.sh.
      Disabled by default.

  --recovery <boolean>
      Enable or disable the exclusion of recovery.img or recovery/
      Disabled by default. Enable in *.mk with TARGET_NO_RECOVERY := true

  --override_device <device>
      Override device-specific asserts. Can be a comma-separated list.

@@ -91,6 +95,7 @@ OPTIONS.extra_script = None
OPTIONS.script_mode = 'auto'
OPTIONS.worker_threads = 3
OPTIONS.backuptool = False
OPTIONS.recoveryex = False
OPTIONS.override_device = 'auto'

def MostPopularKey(d, default):
@@ -329,6 +334,7 @@ def MakeRecoveryPatch(output_zip, recovery_img, boot_img):

  d = Difference(recovery_img, boot_img)
  _, _, patch = d.ComputePatch()
  if OPTIONS.recoveryex == False:
    common.ZipWriteStr(output_zip, "recovery/recovery-from-boot.p", patch)
    Item.Get("system/recovery-from-boot.p", dir=False)

@@ -394,6 +400,8 @@ def WriteFullOTAPackage(input_zip, output_zip):

  script.FormatPartition("system")
  script.Mount("MTD", "system", "/system")
  script.ShowProgress(0.5, 40)
  if OPTIONS.recoveryex == False:
    script.UnpackPackageDir("recovery", "/system")
  script.UnpackPackageDir("system", "/system")

@@ -402,6 +410,7 @@ def WriteFullOTAPackage(input_zip, output_zip):

  boot_img = File("boot.img", common.BuildBootableImage(
      os.path.join(OPTIONS.input_tmp, "BOOT")))
  if OPTIONS.recoveryex == False:
	  recovery_img = File("recovery.img", common.BuildBootableImage(
	      os.path.join(OPTIONS.input_tmp, "RECOVERY")))
	  MakeRecoveryPatch(output_zip, recovery_img, boot_img)
@@ -880,6 +889,8 @@ def main(argv):
      OPTIONS.worker_threads = int(a)
    elif o in ("--backup"):
      OPTIONS.backuptool = bool(a.lower() == 'true')
    elif o in ("--recovery"):
      OPTIONS.recoveryex = bool(a.lower() == 'true')
    elif o in ("--override_device"):
      OPTIONS.override_device = a
    else:
@@ -897,6 +908,7 @@ def main(argv):
                                              "script_mode=",
                                              "worker_threads=",
                                              "backup=",
                                              "recovery=",
                                              "override_device="],
                             extra_option_handler=option_handler)