Merge "Resolve conflict AVB rollback index location" into main
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 4a7e957..dfc0cd0 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -776,6 +776,9 @@
# Clear out tools/metalava Bazel output dir
$(call add-clean-step, rm -rf $(OUT_DIR)/bazel/output/execroot/__main__/bazel-out/mixed_builds_product-*/bin/tools/metalava)
+# Clear out rustc compiler intermediates after reverting rust compiler/linker split.
+$(call add-clean-step, find $(OUT_DIR) -name "*.rsp.whole.a" -print0 | xargs -0 /bin/bash -c 'rm -f $$$${@}; rm -f $$$${@/.rsp.whole.a/.rsp.a}; rm -f $$$${@/.rsp.whole.a/.rsp}')
+
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
diff --git a/core/Makefile b/core/Makefile
index fc2a132..e77b8e7 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1233,6 +1233,7 @@
$(AVBTOOL) add_hash_footer \
--image $(1) \
$(call get-partition-size-argument,$(call get-bootimage-partition-size,$(1),boot)) \
+ --salt `sha256sum "$(kernel)" | cut -d " " -f 1` \
--partition_name boot $(INTERNAL_AVB_BOOT_SIGNING_ARGS) \
$(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)
endef
diff --git a/core/envsetup.mk b/core/envsetup.mk
index f5a2022..091c2e3 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -720,6 +720,7 @@
TARGET_OUT_VENDOR_APPS := $(target_out_vendor_app_base)/app
TARGET_OUT_VENDOR_APPS_PRIVILEGED := $(target_out_vendor_app_base)/priv-app
TARGET_OUT_VENDOR_ETC := $(TARGET_OUT_VENDOR)/etc
+TARGET_OUT_VENDOR_FAKE := $(PRODUCT_OUT)/vendor_fake_packages
.KATI_READONLY := \
TARGET_OUT_VENDOR_EXECUTABLES \
TARGET_OUT_VENDOR_OPTIONAL_EXECUTABLES \
@@ -728,7 +729,8 @@
TARGET_OUT_VENDOR_JAVA_LIBRARIES \
TARGET_OUT_VENDOR_APPS \
TARGET_OUT_VENDOR_APPS_PRIVILEGED \
- TARGET_OUT_VENDOR_ETC
+ TARGET_OUT_VENDOR_ETC \
+ TARGET_OUT_VENDOR_FAKE
$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_EXECUTABLES := $(TARGET_OUT_VENDOR_EXECUTABLES)
$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib
diff --git a/core/soong_config.mk b/core/soong_config.mk
index d50ba8e..90b47a0 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -144,7 +144,6 @@
$(call add_json_list, DeviceKernelHeaders, $(TARGET_DEVICE_KERNEL_HEADERS) $(TARGET_BOARD_KERNEL_HEADERS) $(TARGET_PRODUCT_KERNEL_HEADERS))
$(call add_json_str, DeviceVndkVersion, $(BOARD_VNDK_VERSION))
$(call add_json_str, Platform_vndk_version, $(PLATFORM_VNDK_VERSION))
-$(call add_json_str, ProductVndkVersion, $(PRODUCT_PRODUCT_VNDK_VERSION))
$(call add_json_list, ExtraVndkVersions, $(PRODUCT_EXTRA_VNDK_VERSIONS))
$(call add_json_list, DeviceSystemSdkVersions, $(BOARD_SYSTEMSDK_VERSIONS))
$(call add_json_str, RecoverySnapshotVersion, $(RECOVERY_SNAPSHOT_VERSION))
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index f9a471a..0f3c430 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -1424,7 +1424,7 @@
return RunAndCheckOutput(cmd)
-def AppendAVBSigningArgs(cmd, partition):
+def AppendAVBSigningArgs(cmd, partition, avb_salt=None):
"""Append signing arguments for avbtool."""
# e.g., "--key path/to/signing_key --algorithm SHA256_RSA4096"
key_path = ResolveAVBSigningPathArgs(
@@ -1432,7 +1432,8 @@
algorithm = OPTIONS.info_dict.get("avb_" + partition + "_algorithm")
if key_path and algorithm:
cmd.extend(["--key", key_path, "--algorithm", algorithm])
- avb_salt = OPTIONS.info_dict.get("avb_salt")
+ if avb_salt is None:
+ avb_salt = OPTIONS.info_dict.get("avb_salt")
# make_vbmeta_image doesn't like "--salt" (and it's not needed).
if avb_salt and not partition.startswith("vbmeta"):
cmd.extend(["--salt", avb_salt])
@@ -1903,7 +1904,11 @@
cmd = [avbtool, "add_hash_footer", "--image", img.name,
"--partition_size", str(part_size), "--partition_name",
partition_name]
- AppendAVBSigningArgs(cmd, partition_name)
+ salt = None
+ if kernel_path is not None:
+ with open(kernel_path, "rb") as fp:
+ salt = sha256(fp.read()).hexdigest()
+ AppendAVBSigningArgs(cmd, partition_name, salt)
args = info_dict.get("avb_" + partition_name + "_add_hash_footer_args")
if args and args.strip():
split_args = ResolveAVBSigningPathArgs(shlex.split(args))