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

Commit cc99efd0 authored by Yifan Hong's avatar Yifan Hong Committed by Automerger Merge Worker
Browse files

Split PARTITIONS_WITH_BUILD_PROP from *_WITH_CARE_MAP am: 5057b955 am: 55f3d4e9

Original change: https://android-review.googlesource.com/c/platform/build/+/1543468

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5d745c7a48b1712fab800779152d25432553cce5
parents 654f7bee 55f3d4e9
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -128,6 +128,9 @@ PARTITIONS_WITH_CARE_MAP = [
    'odm_dlkm',
]

# Partitions with a build.prop file
PARTITIONS_WITH_BUILD_PROP = PARTITIONS_WITH_CARE_MAP

# See sysprop.mk. If file is moved, add new search paths here; don't remove
# existing search paths.
RAMDISK_BUILD_PROP_REL_PATHS = ['system/etc/ramdisk/build.prop']
@@ -420,7 +423,7 @@ class BuildInfo(object):
            "3.2.2. Build Parameters.".format(fingerprint))

    self._partition_fingerprints = {}
    for partition in PARTITIONS_WITH_CARE_MAP:
    for partition in PARTITIONS_WITH_BUILD_PROP:
      try:
        fingerprint = self.CalculatePartitionFingerprint(partition)
        check_fingerprint(fingerprint)
@@ -428,7 +431,7 @@ class BuildInfo(object):
      except ExternalError:
        continue
    if "system" in self._partition_fingerprints:
      # system_other is not included in PARTITIONS_WITH_CARE_MAP, but does
      # system_other is not included in PARTITIONS_WITH_BUILD_PROP, but does
      # need a fingerprint when creating the image.
      self._partition_fingerprints[
          "system_other"] = self._partition_fingerprints["system"]
@@ -756,7 +759,7 @@ def LoadInfoDict(input_file, repacking=False):

  # Tries to load the build props for all partitions with care_map, including
  # system and vendor.
  for partition in PARTITIONS_WITH_CARE_MAP:
  for partition in PARTITIONS_WITH_BUILD_PROP:
    partition_prop = "{}.build.prop".format(partition)
    d[partition_prop] = PartitionBuildProps.FromInputFile(
        input_file, partition)
@@ -766,7 +769,7 @@ def LoadInfoDict(input_file, repacking=False):
  # hash / hashtree footers.
  if d.get("avb_enable") == "true":
    build_info = BuildInfo(d)
    for partition in PARTITIONS_WITH_CARE_MAP:
    for partition in PARTITIONS_WITH_BUILD_PROP:
      fingerprint = build_info.GetPartitionFingerprint(partition)
      if fingerprint:
        d["avb_{}_salt".format(partition)] = sha256(fingerprint.encode()).hexdigest()
+3 −3
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ import zipfile
import ota_metadata_pb2
from common import (ZipDelete, ZipClose, OPTIONS, MakeTempFile,
                    ZipWriteStr, BuildInfo, LoadDictionaryFromFile,
                    SignFile, PARTITIONS_WITH_CARE_MAP, PartitionBuildProps)
                    SignFile, PARTITIONS_WITH_BUILD_PROP, PartitionBuildProps)

logger = logging.getLogger(__name__)

@@ -174,7 +174,7 @@ def UpdateDeviceState(device_state, build_info, boot_variable_values,
    # delta_generator will error out on unused timestamps,
    # so only generate timestamps for dynamic partitions
    # used in OTA update.
    for partition in sorted(set(PARTITIONS_WITH_CARE_MAP) & ab_partitions):
    for partition in sorted(set(PARTITIONS_WITH_BUILD_PROP) & ab_partitions):
      partition_prop = build_info.info_dict.get(
          '{}.build.prop'.format(partition))
      # Skip if the partition is missing, or it doesn't have a build.prop
@@ -360,7 +360,7 @@ def ComputeRuntimeBuildInfos(default_build_info, boot_variable_values):
    # Reload the info_dict as some build properties may change their values
    # based on the value of ro.boot* properties.
    info_dict = copy.deepcopy(default_build_info.info_dict)
    for partition in PARTITIONS_WITH_CARE_MAP:
    for partition in PARTITIONS_WITH_BUILD_PROP:
      partition_prop_key = "{}.build.prop".format(partition)
      input_file = info_dict[partition_prop_key].input_file
      if isinstance(input_file, zipfile.ZipFile):