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

Commit 60922a45 authored by Daniel Zheng's avatar Daniel Zheng
Browse files

ota_from_target_files: allow cow version override

With our version compatibility check, overriding our cow version no
longer works. Updating this check to only apply if a command line
vabc_cow_version is not specified.

NOTE: the ota may not successfully apply, depending on device if we
override the cow version

Test: th
Change-Id: Ibbed6cf94cc2e91597d0c249dc8ade314b8341a2
parent 427fea8b
Loading
Loading
Loading
Loading
+20 −18
Original line number Diff line number Diff line
@@ -914,6 +914,7 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None):
    # and install time performance. All OTA's with
    # both the source build and target build with VIRTUAL_AB_COW_VERSION = 3
    # can support the new format. Otherwise, fallback on older versions
    if not OPTIONS.vabc_cow_version:
      if not source_info.vabc_cow_version or not target_info.vabc_cow_version:
        logger.info("Source or Target doesn't have VABC_COW_VERSION specified, default to version 2")
        OPTIONS.vabc_cow_version = 2
@@ -933,6 +934,7 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None):
    assert "ab_partitions" in OPTIONS.info_dict, \
        "META/ab_partitions.txt is required for ab_update."
    source_info = None
    if not OPTIONS.vabc_cow_version:
      if not target_info.vabc_cow_version:
          OPTIONS.vabc_cow_version = 2
      elif target_info.vabc_cow_version >= "3" and target_info.vendor_api_level < 35: