summaryrefslogtreecommitdiff
path: root/tools/releasetools/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/releasetools/common.py')
-rw-r--r--tools/releasetools/common.py27
1 files changed, 18 insertions, 9 deletions
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 495fec30b9..80f80029f0 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -99,6 +99,9 @@ SPECIAL_CERT_STRINGS = ("PRESIGNED", "EXTERNAL")
AVB_PARTITIONS = ('boot', 'dtbo', 'odm', 'product', 'product_services',
'recovery', 'system', 'vendor')
+# Chained VBMeta partitions.
+AVB_VBMETA_PARTITIONS = ('vbmeta_system', 'vbmeta_vendor')
+
# Partitions that should have their care_map added to META/care_map.pb
PARTITIONS_WITH_CARE_MAP = ('system', 'vendor', 'product', 'product_services',
'odm')
@@ -332,15 +335,15 @@ def LoadInfoDict(input_file, repacking=False):
raise ValueError("Failed to find 'fstab_version'")
if repacking:
- # We carry a copy of file_contexts.bin under META/. If not available, search
- # BOOT/RAMDISK/. Note that sometimes we may need a different file to build
- # images than the one running on device, in that case, we must have the one
- # for image generation copied to META/.
- fc_basename = os.path.basename(d.get("selinux_fc", "file_contexts"))
- fc_config = os.path.join(input_file, "META", fc_basename)
- assert os.path.exists(fc_config)
+ # "selinux_fc" properties should point to the file_contexts files
+ # (file_contexts.bin) under META/.
+ for key in d:
+ if key.endswith("selinux_fc"):
+ fc_basename = os.path.basename(d[key])
+ fc_config = os.path.join(input_file, "META", fc_basename)
+ assert os.path.exists(fc_config)
- d["selinux_fc"] = fc_config
+ d[key] = fc_config
# Similarly we need to redirect "root_dir", and "root_fs_config".
d["root_dir"] = os.path.join(input_file, "ROOT")
@@ -417,8 +420,14 @@ 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:
- d["{}.build.prop".format(partition)] = LoadBuildProp(
+ partition_prop = "{}.build.prop".format(partition)
+ d[partition_prop] = LoadBuildProp(
read_helper, "{}/build.prop".format(partition.upper()))
+ # Some partition might use /<partition>/etc/build.prop as the new path.
+ # TODO: try new path first when majority of them switch to the new path.
+ if not d[partition_prop]:
+ d[partition_prop] = LoadBuildProp(
+ read_helper, "{}/etc/build.prop".format(partition.upper()))
d["build.prop"] = d["system.build.prop"]
# Set up the salt (based on fingerprint or thumbprint) that will be used when