Merge "Include private/fs_config.h directly when needed"
diff --git a/Deprecation.md b/Deprecation.md
index 5e26492..2f936e3 100644
--- a/Deprecation.md
+++ b/Deprecation.md
@@ -16,13 +16,13 @@
| -------------------------------- | --------- |
| `BUILD_AUX_EXECUTABLE` | Error |
| `BUILD_AUX_STATIC_LIBRARY` | Error |
-| `BUILD_COPY_HEADERS` | Warning |
-| `BUILD_HOST_EXECUTABLE` | Warning |
+| `BUILD_COPY_HEADERS` | Error |
+| `BUILD_HOST_EXECUTABLE` | Error |
| `BUILD_HOST_FUZZ_TEST` | Error |
| `BUILD_HOST_NATIVE_TEST` | Error |
-| `BUILD_HOST_SHARED_LIBRARY` | Warning |
+| `BUILD_HOST_SHARED_LIBRARY` | Error |
| `BUILD_HOST_SHARED_TEST_LIBRARY` | Error |
-| `BUILD_HOST_STATIC_LIBRARY` | Warning |
+| `BUILD_HOST_STATIC_LIBRARY` | Error |
| `BUILD_HOST_STATIC_TEST_LIBRARY` | Error |
| `BUILD_HOST_TEST_CONFIG` | Error |
| `BUILD_NATIVE_BENCHMARK` | Error |
diff --git a/OWNERS b/OWNERS
index e89a6a1..05f8b3d 100644
--- a/OWNERS
+++ b/OWNERS
@@ -8,4 +8,4 @@
hansson@google.com
# For version updates
-per-file version_defaults.mk = aseaton@google.com,elisapascual@google.com
+per-file version_defaults.mk = aseaton@google.com,elisapascual@google.com,lubomir@google.com,pscovanner@google.com
diff --git a/core/Makefile b/core/Makefile
index 64fbe22..f5a65de 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -418,7 +418,7 @@
$(intermediate_system_build_prop): $(BUILDINFO_SH) $(BUILDINFO_COMMON_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(BUILD_SYSTEM)/version_defaults.mk $(system_prop_file) $(INSTALLED_ANDROID_INFO_TXT_TARGET) $(API_FINGERPRINT) $(POST_PROCESS_PROPS)
@echo Target buildinfo: $@
@mkdir -p $(dir $@)
- $(hide) echo > $@
+ $(hide) rm -f $@ && touch $@
ifneq ($(PRODUCT_OEM_PROPERTIES),)
$(hide) echo "#" >> $@; \
echo "# PRODUCT_OEM_PROPERTIES" >> $@; \
@@ -517,7 +517,7 @@
$(INSTALLED_VENDOR_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) $(intermediate_system_build_prop) $(vendor_prop_files)
@echo Target vendor buildinfo: $@
@mkdir -p $(dir $@)
- $(hide) echo > $@
+ $(hide) rm -f $@ && touch $@
ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true)
$(hide) echo ro.boot.dynamic_partitions=true >> $@
endif
@@ -584,7 +584,7 @@
$(INSTALLED_PRODUCT_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) $(product_prop_files)
@echo Target product buildinfo: $@
@mkdir -p $(dir $@)
- $(hide) echo > $@
+ $(hide) rm -f $@ && touch $@
ifdef BOARD_USES_PRODUCTIMAGE
$(hide) $(call generate-common-build-props,product,$@)
endif # BOARD_USES_PRODUCTIMAGE
@@ -625,7 +625,7 @@
$(INSTALLED_ODM_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) $(odm_prop_files)
@echo Target odm buildinfo: $@
@mkdir -p $(dir $@)
- $(hide) echo > $@
+ $(hide) rm -f $@ && touch $@
$(hide) echo ro.odm.product.cpu.abilist="$(TARGET_CPU_ABI_LIST)">>$@
$(hide) echo ro.odm.product.cpu.abilist32="$(TARGET_CPU_ABI_LIST_32_BIT)">>$@
$(hide) echo ro.odm.product.cpu.abilist64="$(TARGET_CPU_ABI_LIST_64_BIT)">>$@
@@ -666,7 +666,7 @@
$(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) $(system_ext_prop_files)
@echo Target system_ext buildinfo: $@
@mkdir -p $(dir $@)
- $(hide) echo > $@
+ $(hide) rm -f $@ && touch $@
$(hide) $(call generate-common-build-props,system_ext,$@)
$(hide) $(foreach file,$(system_ext_prop_files), \
if [ -f "$(file)" ]; then \
@@ -861,10 +861,17 @@
# -----------------------------------------------------------------
# Cert-to-package mapping. Used by the post-build signing tools.
# Use a macro to add newline to each echo command
+# $1 package name
+# $2 certificate
+# $3 private key
+# $4 compressed
+# $5 partition tag
+# $6 output file
define _apkcerts_write_line
-$(hide) echo -n 'name="$(1).apk" certificate="$2" private_key="$3"' >> $5
-$(if $(4), $(hide) echo -n ' compressed="$4"' >> $5)
-$(hide) echo '' >> $5
+$(hide) echo -n 'name="$(1).apk" certificate="$2" private_key="$3"' >> $6
+$(if $(4), $(hide) echo -n ' compressed="$4"' >> $6)
+$(if $(5), $(hide) echo -n ' partition="$5"' >> $6)
+$(hide) echo '' >> $6
endef
@@ -884,8 +891,8 @@
@rm -f $@
$(foreach p,$(sort $(PACKAGES)),\
$(if $(PACKAGES.$(p).EXTERNAL_KEY),\
- $(call _apkcerts_write_line,$(p),"EXTERNAL","",$(PACKAGES.$(p).COMPRESSED),$@),\
- $(call _apkcerts_write_line,$(p),$(PACKAGES.$(p).CERTIFICATE),$(PACKAGES.$(p).PRIVATE_KEY),$(PACKAGES.$(p).COMPRESSED),$@)))
+ $(call _apkcerts_write_line,$(p),"EXTERNAL","",$(PACKAGES.$(p).COMPRESSED),$(PACKAGES.$(p).PARTITION),$@),\
+ $(call _apkcerts_write_line,$(p),$(PACKAGES.$(p).CERTIFICATE),$(PACKAGES.$(p).PRIVATE_KEY),$(PACKAGES.$(p).COMPRESSED),$(PACKAGES.$(p).PARTITION),$@)))
# In case value of PACKAGES is empty.
$(hide) touch $@
@@ -1032,7 +1039,12 @@
INSTALLED_2NDBOOTLOADER_TARGET :=
endif # TARGET_NO_BOOTLOADER
ifneq ($(strip $(TARGET_NO_KERNEL)),true)
- INSTALLED_KERNEL_TARGET := $(PRODUCT_OUT)/kernel
+ ifneq ($(strip $(BOARD_KERNEL_BINARIES)),)
+ INSTALLED_KERNEL_TARGET := $(foreach k,$(BOARD_KERNEL_BINARIES), \
+ $(PRODUCT_OUT)/$(k))
+ else
+ INSTALLED_KERNEL_TARGET := $(PRODUCT_OUT)/kernel
+ endif
else
INSTALLED_KERNEL_TARGET :=
endif
@@ -1104,7 +1116,12 @@
# This is defined here since we may be building recovery as boot
# below and only want to define this once
-BUILT_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img
+ifneq ($(strip $(BOARD_KERNEL_BINARIES)),)
+ BUILT_BOOTIMAGE_TARGET := $(foreach k,$(subst kernel,boot,$(BOARD_KERNEL_BINARIES)), $(PRODUCT_OUT)/$(k).img)
+else
+ BUILT_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img
+endif
+
ifneq ($(strip $(TARGET_NO_KERNEL)),true)
INTERNAL_BOOTIMAGE_ARGS := \
@@ -2113,7 +2130,7 @@
else # INSTALLED_VENDOR_BOOTIMAGE_TARGET not defined
INTERNAL_RECOVERYIMAGE_ARGS := \
$(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \
- --kernel $(recovery_kernel) --ramdisk $(recovery_ramdisk)
+ --ramdisk $(recovery_ramdisk)
# Assumes this has already been stripped
ifdef INTERNAL_KERNEL_CMDLINE
INTERNAL_RECOVERYIMAGE_ARGS += --cmdline "$(INTERNAL_KERNEL_CMDLINE)"
@@ -2139,38 +2156,53 @@
endif
endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET not defined
+$(recovery_ramdisk): $(MKBOOTFS) $(MINIGZIP) \
+ $(INTERNAL_ROOT_FILES) \
+ $(INSTALLED_RAMDISK_TARGET) \
+ $(INTERNAL_RECOVERYIMAGE_FILES) \
+ $(recovery_sepolicy) \
+ $(INSTALLED_2NDBOOTLOADER_TARGET) \
+ $(INSTALLED_RECOVERY_BUILD_PROP_TARGET) \
+ $(recovery_resource_deps) \
+ $(recovery_fstab)
+ # Making recovery image
+ mkdir -p $(TARGET_RECOVERY_OUT)
+ mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sdcard $(TARGET_RECOVERY_ROOT_OUT)/tmp
+ # Copying baseline ramdisk...
+ # Use rsync because "cp -Rf" fails to overwrite broken symlinks on Mac.
+ rsync -a --exclude=sdcard $(IGNORE_RECOVERY_SEPOLICY) $(IGNORE_CACHE_LINK) $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT)
+ # Modifying ramdisk contents...
+ $(if $(filter true,$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)),, \
+ ln -sf /system/bin/init $(TARGET_RECOVERY_ROOT_OUT)/init)
+ # Removes $(TARGET_RECOVERY_ROOT_OUT)/init*.rc EXCEPT init.recovery*.rc.
+ find $(TARGET_RECOVERY_ROOT_OUT) -maxdepth 1 -name 'init*.rc' -type f -not -name "init.recovery.*.rc" | xargs rm -f
+ cp $(TARGET_ROOT_OUT)/init.recovery.*.rc $(TARGET_RECOVERY_ROOT_OUT)/ 2> /dev/null || true # Ignore error when the src file doesn't exist.
+ mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/res
+ rm -rf $(TARGET_RECOVERY_ROOT_OUT)/res/*
+ cp -rf $(recovery_resources_common)/* $(TARGET_RECOVERY_ROOT_OUT)/res
+ $(foreach recovery_text_file,$(generated_recovery_text_files), \
+ cp -rf $(recovery_text_file) $(TARGET_RECOVERY_ROOT_OUT)/res/images/ &&) true
+ cp -f $(recovery_font) $(TARGET_RECOVERY_ROOT_OUT)/res/images/font.png
+ $(foreach item,$(TARGET_PRIVATE_RES_DIRS), \
+ cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline))
+ $(foreach item,$(recovery_fstab), \
+ cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.fstab)
+ $(if $(strip $(recovery_wipe)), \
+ cp -f $(recovery_wipe) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.wipe)
+ ln -sf prop.default $(TARGET_RECOVERY_ROOT_OUT)/default.prop
+ $(BOARD_RECOVERY_IMAGE_PREPARE)
+ $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RECOVERY_ROOT_OUT) | $(MINIGZIP) > $(recovery_ramdisk)
+
# $(1): output file
+# $(2): kernel file
define build-recoveryimage-target
- # Making recovery image
- $(hide) mkdir -p $(TARGET_RECOVERY_OUT)
- $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sdcard $(TARGET_RECOVERY_ROOT_OUT)/tmp
- # Copying baseline ramdisk...
- # Use rsync because "cp -Rf" fails to overwrite broken symlinks on Mac.
- $(hide) rsync -a --exclude=sdcard $(IGNORE_RECOVERY_SEPOLICY) $(IGNORE_CACHE_LINK) $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT)
- # Modifying ramdisk contents...
- $(if $(filter true,$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)),, \
- $(hide) ln -sf /system/bin/init $(TARGET_RECOVERY_ROOT_OUT)/init)
- # Removes $(TARGET_RECOVERY_ROOT_OUT)/init*.rc EXCEPT init.recovery*.rc.
- $(hide) find $(TARGET_RECOVERY_ROOT_OUT) -maxdepth 1 -name 'init*.rc' -type f -not -name "init.recovery.*.rc" | xargs rm -f
- $(hide) cp $(TARGET_ROOT_OUT)/init.recovery.*.rc $(TARGET_RECOVERY_ROOT_OUT)/ 2> /dev/null || true # Ignore error when the src file doesn't exist.
- $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/res
- $(hide) rm -rf $(TARGET_RECOVERY_ROOT_OUT)/res/*
- $(hide) cp -rf $(recovery_resources_common)/* $(TARGET_RECOVERY_ROOT_OUT)/res
- $(hide) $(foreach recovery_text_file,$(generated_recovery_text_files), \
- cp -rf $(recovery_text_file) $(TARGET_RECOVERY_ROOT_OUT)/res/images/ &&) true
- $(hide) cp -f $(recovery_font) $(TARGET_RECOVERY_ROOT_OUT)/res/images/font.png
- $(hide) $(foreach item,$(TARGET_PRIVATE_RES_DIRS), \
- cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline))
- $(hide) $(foreach item,$(recovery_fstab), \
- cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.fstab)
- $(if $(strip $(recovery_wipe)), \
- $(hide) cp -f $(recovery_wipe) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.wipe)
- $(hide) ln -sf prop.default $(TARGET_RECOVERY_ROOT_OUT)/default.prop
- $(BOARD_RECOVERY_IMAGE_PREPARE)
- $(hide) $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RECOVERY_ROOT_OUT) | $(MINIGZIP) > $(recovery_ramdisk)
$(if $(filter true,$(PRODUCT_SUPPORTS_VBOOT)), \
- $(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1).unsigned, \
- $(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1))
+ $(MKBOOTIMG) --kernel $(2) $(MKBOOTIMG_KERNEL_ARG) $(INTERNAL_RECOVERYIMAGE_ARGS) \
+ $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) \
+ --output $(1).unsigned, \
+ $(MKBOOTIMG) --kernel $(2) $(MKBOOTIMG_KERNEL_ARG) $(INTERNAL_RECOVERYIMAGE_ARGS) \
+ $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) \
+ --output $(1))
$(if $(filter true,$(PRODUCT_SUPPORTS_BOOT_SIGNER)),\
$(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)),\
$(BOOT_SIGNER) /boot $(1) $(PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCT_VERITY_SIGNING_KEY).x509.pem $(1),\
@@ -2180,12 +2212,12 @@
$(if $(filter true,$(PRODUCT_SUPPORTS_VBOOT)), \
$(VBOOT_SIGNER) $(FUTILITY) $(1).unsigned $(PRODUCT_VBOOT_SIGNING_KEY).vbpubk $(PRODUCT_VBOOT_SIGNING_KEY).vbprivk $(PRODUCT_VBOOT_SIGNING_SUBKEY).vbprivk $(1).keyblock $(1))
$(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)), \
- $(hide) $(call assert-max-image-size,$(1),$(call get-hash-image-max-size,$(BOARD_BOOTIMAGE_PARTITION_SIZE))), \
- $(hide) $(call assert-max-image-size,$(1),$(call get-hash-image-max-size,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE))))
+ $(call assert-max-image-size,$(1),$(call get-hash-image-max-size,$(BOARD_BOOTIMAGE_PARTITION_SIZE))), \
+ $(call assert-max-image-size,$(1),$(call get-hash-image-max-size,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE))))
$(if $(filter true,$(BOARD_AVB_ENABLE)), \
$(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)), \
- $(hide) $(AVBTOOL) add_hash_footer --image $(1) --partition_size $(BOARD_BOOTIMAGE_PARTITION_SIZE) --partition_name boot $(INTERNAL_AVB_BOOT_SIGNING_ARGS) $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS),\
- $(hide) $(AVBTOOL) add_hash_footer --image $(1) --partition_size $(BOARD_RECOVERYIMAGE_PARTITION_SIZE) --partition_name recovery $(INTERNAL_AVB_RECOVERY_SIGNING_ARGS) $(BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS)))
+ $(AVBTOOL) add_hash_footer --image $(1) --partition_size $(BOARD_BOOTIMAGE_PARTITION_SIZE) --partition_name boot $(INTERNAL_AVB_BOOT_SIGNING_ARGS) $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS),\
+ $(AVBTOOL) add_hash_footer --image $(1) --partition_size $(BOARD_RECOVERYIMAGE_PARTITION_SIZE) --partition_name recovery $(INTERNAL_AVB_RECOVERY_SIGNING_ARGS) $(BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS)))
endef
ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true)
@@ -2212,18 +2244,10 @@
$(INSTALLED_BOOTIMAGE_TARGET): $(INSTALLED_DTBIMAGE_TARGET)
endif
-$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \
- $(INTERNAL_ROOT_FILES) \
- $(INSTALLED_RAMDISK_TARGET) \
- $(INTERNAL_RECOVERYIMAGE_FILES) \
- $(recovery_sepolicy) $(recovery_kernel) \
- $(INSTALLED_2NDBOOTLOADER_TARGET) \
- $(INSTALLED_RECOVERY_BUILD_PROP_TARGET) \
- $(recovery_resource_deps) \
- $(recovery_fstab)
+$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(recovery_ramdisk) \
+ $(recovery_kernel)
$(call pretty,"Target boot image from recovery: $@")
- $(call build-recoveryimage-target, $@)
-$(INSTALLED_BOOTIMAGE_TARGET): .KATI_IMPLICIT_OUTPUTS += $(recovery_ramdisk)
+ $(call build-recoveryimage-target, $@, $(PRODUCT_OUT)/$(subst .img,,$(subst boot,kernel,$(notdir $@))))
endif # BOARD_USES_RECOVERY_AS_BOOT
ifdef BOARD_INCLUDE_RECOVERY_DTBO
@@ -2240,17 +2264,9 @@
$(INSTALLED_RECOVERYIMAGE_TARGET): $(INSTALLED_DTBIMAGE_TARGET)
endif
-$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \
- $(INTERNAL_ROOT_FILES) \
- $(INSTALLED_RAMDISK_TARGET) \
- $(INSTALLED_BOOTIMAGE_TARGET) \
- $(INTERNAL_RECOVERYIMAGE_FILES) \
- $(recovery_sepolicy) $(recovery_kernel) \
- $(INSTALLED_2NDBOOTLOADER_TARGET) \
- $(INSTALLED_RECOVERY_BUILD_PROP_TARGET) \
- $(recovery_resource_deps) \
- $(recovery_fstab)
- $(call build-recoveryimage-target, $@)
+$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(recovery_ramdisk) \
+ $(recovery_kernel)
+ $(call build-recoveryimage-target, $@, $(recovery_kernel))
ifdef RECOVERY_RESOURCE_ZIP
$(RECOVERY_RESOURCE_ZIP): $(INSTALLED_RECOVERYIMAGE_TARGET) | $(ZIPTIME)
@@ -2361,8 +2377,12 @@
# Note: it's intentional to skip signing for boot-debug.img, because it
# can only be used if the device is unlocked with verification error.
ifneq ($(strip $(TARGET_NO_KERNEL)),true)
-
-INSTALLED_DEBUG_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot-debug.img
+ifneq ($(strip $(BOARD_KERNEL_BINARIES)),)
+ INSTALLED_DEBUG_BOOTIMAGE_TARGET := $(foreach k,$(subst kernel,boot-debug,$(BOARD_KERNEL_BINARIES)), \
+ $(PRODUCT_OUT)/$(k).img)
+else
+ INSTALLED_DEBUG_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot-debug.img
+endif
# Replace ramdisk.img in $(MKBOOTIMG) ARGS with ramdisk-debug.img to build boot-debug.img
ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true)
@@ -2392,17 +2412,22 @@
$(call assert-max-image-size,$(1),$(BOARD_BOOTIMAGE_PARTITION_SIZE))
endef
+# $(1): output file
+define build-debug-bootimage-target
+ $(MKBOOTIMG) --kernel $(PRODUCT_OUT)/$(subst .img,,$(subst boot-debug,kernel,$(notdir $(1)))) \
+ $(INTERNAL_DEBUG_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $1
+ $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$1))
+endef
+
# Depends on original boot.img and ramdisk-debug.img, to build the new boot-debug.img
$(INSTALLED_DEBUG_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_DEBUG_RAMDISK_TARGET)
$(call pretty,"Target boot debug image: $@")
- $(MKBOOTIMG) $(INTERNAL_DEBUG_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@
- $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$@))
+ $(call build-debug-bootimage-target, $@)
.PHONY: bootimage_debug-nodeps
bootimage_debug-nodeps: $(MKBOOTIMG)
echo "make $@: ignoring dependencies"
- $(MKBOOTIMG) $(INTERNAL_DEBUG_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_DEBUG_BOOTIMAGE_TARGET)
- $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$(INSTALLED_DEBUG_BOOTIMAGE_TARGET)))
+ $(foreach b,$(INSTALLED_DEBUG_BOOTIMAGE_TARGET),$(call build-debug-bootimage-target,$b))
endif # TARGET_NO_KERNEL
@@ -2730,11 +2755,8 @@
@echo "make $@: ignoring dependencies"
$(call build-systemimage-target,$(INSTALLED_SYSTEMIMAGE_TARGET))
$(hide) $(call assert-max-image-size,$(INSTALLED_SYSTEMIMAGE_TARGET),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))
-
-ifneq (,$(filter systemimage-nodeps snod, $(MAKECMDGOALS)))
ifeq (true,$(WITH_DEXPREOPT))
-$(warning Warning: with dexpreopt enabled, you may need a full rebuild.)
-endif
+ $(warning Warning: with dexpreopt enabled, you may need a full rebuild.)
endif
endif # BUILDING_SYSTEM_IMAGE
@@ -3700,6 +3722,13 @@
check_vintf_has_system :=
check_vintf_has_vendor :=
+ifneq (,$(filter EMPTY_ODM_SKU_PLACEHOLDER,$(ODM_MANIFEST_SKUS)))
+$(error EMPTY_ODM_SKU_PLACEHOLDER is an internal variable and cannot be used for ODM_MANIFEST_SKUS)
+endif
+ifneq (,$(filter EMPTY_VENDOR_SKU_PLACEHOLDER,$(DEVICE_MANIFEST_SKUS)))
+$(error EMPTY_VENDOR_SKU_PLACEHOLDER is an internal variable and cannot be used for DEIVCE_MANIFEST_SKUS)
+endif
+
# -- Check system manifest / matrix including fragments (excluding other framework manifests / matrices, e.g. product);
check_vintf_system_deps := $(filter $(TARGET_OUT)/etc/vintf/%, $(check_vintf_common_srcs))
ifneq ($(check_vintf_system_deps),)
@@ -3718,8 +3747,18 @@
check_vintf_has_vendor := true
check_vintf_vendor_log := $(intermediates)/check_vintf_vendor_log
check_vintf_all_deps += $(check_vintf_vendor_log)
+# Check vendor SKU=(empty) case when:
+# - DEVICE_MANIFEST_FILE is not empty; OR
+# - DEVICE_MANIFEST_FILE is empty AND DEVICE_MANIFEST_SKUS is empty (only vendor manifest fragments are used)
+$(check_vintf_vendor_log): PRIVATE_VENDOR_SKUS := \
+ $(if $(DEVICE_MANIFEST_FILE),EMPTY_VENDOR_SKU_PLACEHOLDER,\
+ $(if $(DEVICE_MANIFEST_SKUS),,EMPTY_VENDOR_SKU_PLACEHOLDER)) \
+ $(DEVICE_MANIFEST_SKUS)
$(check_vintf_vendor_log): $(HOST_OUT_EXECUTABLES)/checkvintf $(check_vintf_vendor_deps)
- @( $< --check-one --dirmap /vendor:$(TARGET_OUT_VENDOR) > $@ 2>&1 ) || ( cat $@ && exit 1 )
+ $(foreach vendor_sku,$(PRIVATE_VENDOR_SKUS), \
+ ( $< --check-one --dirmap /vendor:$(TARGET_OUT_VENDOR) \
+ --property ro.boot.product.vendor.sku=$(filter-out EMPTY_VENDOR_SKU_PLACEHOLDER,$(vendor_sku)) \
+ > $@ 2>&1 ) || ( cat $@ && exit 1 ); )
check_vintf_vendor_log :=
endif # check_vintf_vendor_deps
check_vintf_vendor_deps :=
@@ -3813,17 +3852,31 @@
$(check_vintf_compatible_log): PRIVATE_CHECK_VINTF_ARGS := $(check_vintf_compatible_args)
$(check_vintf_compatible_log): PRIVATE_CHECK_VINTF_DEPS := $(check_vintf_compatible_deps)
+# Check ODM SKU=(empty) case when:
+# - ODM_MANIFEST_FILES is not empty; OR
+# - ODM_MANIFEST_FILES is empty AND ODM_MANIFEST_SKUS is empty (only ODM manifest fragments are used)
+$(check_vintf_compatible_log): PRIVATE_ODM_SKUS := \
+ $(if $(ODM_MANIFEST_FILES),EMPTY_ODM_SKU_PLACEHOLDER,\
+ $(if $(ODM_MANIFEST_SKUS),,EMPTY_ODM_SKU_PLACEHOLDER)) \
+ $(ODM_MANIFEST_SKUS)
+# Check vendor SKU=(empty) case when:
+# - DEVICE_MANIFEST_FILE is not empty; OR
+# - DEVICE_MANIFEST_FILE is empty AND DEVICE_MANIFEST_SKUS is empty (only vendor manifest fragments are used)
+$(check_vintf_compatible_log): PRIVATE_VENDOR_SKUS := \
+ $(if $(DEVICE_MANIFEST_FILE),EMPTY_VENDOR_SKU_PLACEHOLDER,\
+ $(if $(DEVICE_MANIFEST_SKUS),,EMPTY_VENDOR_SKU_PLACEHOLDER)) \
+ $(DEVICE_MANIFEST_SKUS)
$(check_vintf_compatible_log): $(HOST_OUT_EXECUTABLES)/checkvintf $(check_vintf_compatible_deps)
@echo -n -e 'Deps: \n ' > $@
@sed 's/ /\n /g' <<< "$(PRIVATE_CHECK_VINTF_DEPS)" >> $@
@echo -n -e 'Args: \n ' >> $@
@cat <<< "$(PRIVATE_CHECK_VINTF_ARGS)" >> $@
- @echo -n -e 'For empty SKU:' >> $@
- @( $< --check-compat $(PRIVATE_CHECK_VINTF_ARGS) >> $@ 2>&1 ) || ( cat $@ && exit 1 )
- $(foreach sku,$(ODM_MANIFEST_SKUS), \
- echo "For SKU = $(sku):" >> $@; \
+ $(foreach odm_sku,$(PRIVATE_ODM_SKUS), $(foreach vendor_sku,$(PRIVATE_VENDOR_SKUS), \
+ echo "For ODM SKU = $(odm_sku), vendor SKU = $(vendor_sku)" >> $@; \
( $< --check-compat $(PRIVATE_CHECK_VINTF_ARGS) \
- --property ro.boot.product.hardware.sku=$(sku) >> $@ 2>&1 ) || ( cat $@ && exit 1 ); )
+ --property ro.boot.product.hardware.sku=$(filter-out EMPTY_ODM_SKU_PLACEHOLDER,$(odm_sku)) \
+ --property ro.boot.product.vendor.sku=$(filter-out EMPTY_VENDOR_SKU_PLACEHOLDER,$(vendor_sku)) \
+ >> $@ 2>&1 ) || (cat $@ && exit 1); ))
check_vintf_compatible_log :=
check_vintf_compatible_args :=
@@ -3945,6 +3998,7 @@
INTERNAL_OTATOOLS_MODULES := \
aapt2 \
add_img_to_target_files \
+ aftltool \
append2simg \
avbtool \
blk_alloc_to_base_fs \
@@ -4222,6 +4276,15 @@
ifdef ODM_MANIFEST_SKUS
$(hide) echo "vintf_odm_manifest_skus=$(ODM_MANIFEST_SKUS)" >> $@
endif
+ifdef ODM_MANIFEST_FILES
+ $(hide) echo "vintf_include_empty_odm_sku=true" >> $@
+endif
+ifdef DEVICE_MANIFEST_SKUS
+ $(hide) echo "vintf_vendor_manifest_skus=$(DEVICE_MANIFEST_SKUS)" >> $@
+endif
+ifdef DEVICE_MANIFEST_FILE
+ $(hide) echo "vintf_include_empty_vendor_sku=true" >> $@
+endif
.PHONY: misc_info
misc_info: $(INSTALLED_MISC_INFO_TARGET)
@@ -4429,7 +4492,7 @@
$(hide) $(call package_files-copy-root, \
$(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/$(PRIVATE_RECOVERY_OUT)/RAMDISK)
ifdef INSTALLED_KERNEL_TARGET
- cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/kernel
+ cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/
endif
ifdef INSTALLED_VENDOR_BOOTIMAGE_TARGET
echo "$(GENERIC_KERNEL_CMDLINE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/cmdline
@@ -4850,6 +4913,19 @@
$(hide) find $(TARGET_OUT_COVERAGE) | sort >$(PRIVATE_LIST_FILE)
$(hide) $(SOONG_ZIP) -d -o $@ -C $(TARGET_OUT_COVERAGE) -l $(PRIVATE_LIST_FILE)
+#------------------------------------------------------------------
+# Export the LLVM profile data tool and dependencies for Clang coverage processing
+#
+ifeq (true,$(CLANG_COVERAGE))
+ LLVM_PROFDATA := $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-profdata
+ LIBCXX := $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/lib64/libc++.so.1
+ PROFDATA_ZIP := $(PRODUCT_OUT)/llvm-profdata.zip
+ $(PROFDATA_ZIP): $(SOONG_ZIP)
+ $(hide) $(SOONG_ZIP) -d -o $@ -C $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION) -f $(LLVM_PROFDATA) -f $(LIBCXX)
+
+ $(call dist-for-goals,droidcore,$(PROFDATA_ZIP))
+endif
+
# -----------------------------------------------------------------
# A zip of the Android Apps. Not keeping full path so that we don't
# include product names when distributing
@@ -5201,7 +5277,6 @@
$(ALL_DEFAULT_INSTALLED_MODULES) \
$(INSTALLED_RAMDISK_TARGET) \
$(ALL_DOCS) \
- $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/api-stubs-docs_annotations.zip \
$(ALL_SDK_FILES)
endif
diff --git a/core/app_prebuilt_internal.mk b/core/app_prebuilt_internal.mk
index ce554c9..05d9001 100644
--- a/core/app_prebuilt_internal.mk
+++ b/core/app_prebuilt_internal.mk
@@ -167,6 +167,9 @@
include $(BUILD_SYSTEM)/app_certificate_validate.mk
+# Set a actual_partition_tag (calculated in base_rules.mk) for the package.
+PACKAGES.$(LOCAL_MODULE).PARTITION := $(actual_partition_tag)
+
# Disable dex-preopt of prebuilts to save space, if requested.
ifndef LOCAL_DEX_PREOPT
ifeq ($(DONT_DEXPREOPT_PREBUILTS),true)
diff --git a/core/base_rules.mk b/core/base_rules.mk
index cce6ec1..f78e509 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -208,23 +208,39 @@
my_module_relative_path := $(strip $(LOCAL_MODULE_RELATIVE_PATH))
ifdef LOCAL_IS_HOST_MODULE
partition_tag :=
+ actual_partition_tag :=
else
ifeq (true,$(strip $(LOCAL_VENDOR_MODULE)))
partition_tag := _VENDOR
+ # A vendor module could be on the vendor partition at "vendor" or the system
+ # partition at "system/vendor".
+ actual_partition_tag := $(if $(filter true,$(BOARD_USES_VENDORIMAGE)),vendor,system)
else ifeq (true,$(strip $(LOCAL_OEM_MODULE)))
partition_tag := _OEM
+ actual_partition_tag := oem
else ifeq (true,$(strip $(LOCAL_ODM_MODULE)))
partition_tag := _ODM
+ # An ODM module could be on the odm partition at "odm", the vendor partition
+ # at "vendor/odm", or the system partition at "system/vendor/odm".
+ actual_partition_tag := $(if $(filter true,$(BOARD_USES_ODMIMAGE)),odm,$(if $(filter true,$(BOARD_USES_VENDORIMAGE)),vendor,system))
else ifeq (true,$(strip $(LOCAL_PRODUCT_MODULE)))
partition_tag := _PRODUCT
+ # A product module could be on the product partition at "product" or the
+ # system partition at "system/product".
+ actual_partition_tag := $(if $(filter true,$(BOARD_USES_PRODUCTIMAGE)),product,system)
else ifeq (true,$(strip $(LOCAL_SYSTEM_EXT_MODULE)))
partition_tag := _SYSTEM_EXT
+ # A system_ext-specific module could be on the system_ext partition at
+ # "system_ext" or the system partition at "system/system_ext".
+ actual_partition_tag := $(if $(filter true,$(BOARD_USES_SYSTEM_EXTIMAGE)),system_ext,system)
else ifeq (NATIVE_TESTS,$(LOCAL_MODULE_CLASS))
partition_tag := _DATA
+ actual_partition_tag := data
else
# The definition of should-install-to-system will be different depending
# on which goal (e.g., sdk or just droid) is being built.
partition_tag := $(if $(call should-install-to-system,$(my_module_tags)),,_DATA)
+ actual_partition_tag := $(if $(partition_tag),data,system)
endif
endif
# For test modules that lack a suite tag, set null-suite as the default.
@@ -705,13 +721,19 @@
ifeq ($(use_testcase_folder),true)
ifneq ($(my_test_data_file_pairs),)
+# Filter out existng installed test data paths when collecting test data files to be installed and
+# indexed as they cause build rule conflicts. Instead put them in a separate list which is only
+# used for indexing.
$(foreach pair, $(my_test_data_file_pairs), \
$(eval parts := $(subst :,$(space),$(pair))) \
$(eval src_path := $(word 1,$(parts))) \
$(eval file := $(word 2,$(parts))) \
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
$(eval my_compat_dist_$(suite) += $(foreach dir, $(call compatibility_suite_dirs,$(suite),$(arch_dir)), \
- $(call filter-copy-pair,$(src_path),$(call append-path,$(dir),$(file)),$(my_installed_test_data))))))
+ $(call filter-copy-pair,$(src_path),$(call append-path,$(dir),$(file)),$(my_installed_test_data)))) \
+ $(eval my_compat_dist_test_data_$(suite) += \
+ $(foreach dir, $(call compatibility_suite_dirs,$(suite),$(arch_dir)), \
+ $(filter $(my_installed_test_data),$(call append-path,$(dir),$(file)))))))
endif
else
ifneq ($(my_test_data_file_pairs),)
@@ -732,7 +754,8 @@
$(call create-suite-dependencies)
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
- $(eval my_compat_dist_config_$(suite) := ))
+ $(eval my_compat_dist_config_$(suite) := ) \
+ $(eval my_compat_dist_test_data_$(suite) := ))
endif # LOCAL_COMPATIBILITY_SUITE
diff --git a/core/binary.mk b/core/binary.mk
index 38ff9d6..e021b7d 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -110,19 +110,8 @@
# Make sure we've built the NDK.
my_additional_dependencies += $(SOONG_OUT_DIR)/ndk_base.timestamp
- # mips32r6 is not supported by the NDK. No released NDK contains these
- # libraries, but the r10 in prebuilts/ndk had a local hack to add them :(
- #
- # We need to find a real solution to this problem, but until we do just drop
- # mips32r6 things back to r10 to get the tree building again.
- ifeq (mips32r6,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH_VARIANT))
- ifeq ($(LOCAL_NDK_VERSION), current)
- LOCAL_NDK_VERSION := r10
- endif
- endif
-
my_arch := $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)
- ifneq (,$(filter arm64 mips64 x86_64,$(my_arch)))
+ ifneq (,$(filter arm64 x86_64,$(my_arch)))
my_min_sdk_version := 21
else
my_min_sdk_version := $(MIN_SUPPORTED_SDK_VERSION)
@@ -156,17 +145,11 @@
$(my_built_ndk)/sysroot/usr/include/$(my_ndk_triple) \
$(my_ndk_sysroot)/usr/include \
- # x86_64 and and mips64 are both multilib toolchains, so their libraries are
+ # x86_64 is a multilib toolchain, so their libraries are
# installed in /usr/lib64. Aarch64, on the other hand, is not a multilib
# compiler, so its libraries are in /usr/lib.
- #
- # Mips32r6 is yet another variation, with libraries installed in libr6.
- #
- # For the rest, the libraries are installed simply to /usr/lib.
- ifneq (,$(filter x86_64 mips64,$(my_arch)))
+ ifneq (,$(filter x86_64,$(my_arch)))
my_ndk_libdir_name := lib64
- else ifeq (mips32r6,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH_VARIANT))
- my_ndk_libdir_name := libr6
else
my_ndk_libdir_name := lib
endif
@@ -180,11 +163,7 @@
# hashes (which are much faster!), but shipping to older devices requires
# the old style hash. Fortunately, we can build with both and it'll work
# anywhere.
- #
- # This is not currently supported on MIPS architectures.
- ifeq (,$(filter mips mips64,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)))
- my_ldflags += -Wl,--hash-style=both
- endif
+ my_ldflags += -Wl,--hash-style=both
# We don't want to expose the relocation packer to the NDK just yet.
LOCAL_PACK_MODULE_RELOCATIONS := false
@@ -195,9 +174,6 @@
my_ndk_stl_shared_lib_fullpath :=
my_ndk_stl_static_lib :=
my_cpu_variant := $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)CPU_ABI)
- ifeq (mips32r6,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH_VARIANT))
- my_cpu_variant := mips32r6
- endif
LOCAL_NDK_STL_VARIANT := $(strip $(LOCAL_NDK_STL_VARIANT))
ifeq (,$(LOCAL_NDK_STL_VARIANT))
LOCAL_NDK_STL_VARIANT := system
diff --git a/core/board_config.mk b/core/board_config.mk
index 61abc36..8ff16e2 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -362,7 +362,9 @@
BUILDING_VENDOR_BOOT_IMAGE :=
ifdef BOARD_BOOT_HEADER_VERSION
ifneq ($(call math_gt_or_eq,$(BOARD_BOOT_HEADER_VERSION),3),)
- BUILDING_VENDOR_BOOT_IMAGE := true
+ ifneq ($(TARGET_NO_VENDOR_BOOT),true)
+ BUILDING_VENDOR_BOOT_IMAGE := true
+ endif
ifdef BUILDING_RECOVERY_IMAGE
ifneq ($(BOARD_USES_RECOVERY_AS_BOOT),true)
$(error Boot header version >=3 requires recovery as boot)
@@ -622,16 +624,16 @@
###########################################
# Handle BUILD_BROKEN_USES_BUILD_*
-$(foreach m,$(filter-out BUILD_COPY_HEADERS,$(DEFAULT_WARNING_BUILD_MODULE_TYPES)),\
+$(foreach m,$(DEFAULT_WARNING_BUILD_MODULE_TYPES),\
$(if $(filter false,$(BUILD_BROKEN_USES_$(m))),\
$(KATI_obsolete_var $(m),Please convert to Soong),\
$(KATI_deprecated_var $(m),Please convert to Soong)))
-$(if $(filter false,$(BUILD_BROKEN_USES_BUILD_COPY_HEADERS)),\
- $(KATI_obsolete_var BUILD_COPY_HEADERS,See $(CHANGES_URL)#copy_headers),\
- $(KATI_deprecated_var BUILD_COPY_HEADERS,See $(CHANGES_URL)#copy_headers))
+$(if $(filter true,$(BUILD_BROKEN_USES_BUILD_COPY_HEADERS)),\
+ $(KATI_deprecated_var BUILD_COPY_HEADERS,See $(CHANGES_URL)#copy_headers),\
+ $(KATI_obsolete_var BUILD_COPY_HEADERS,See $(CHANGES_URL)#copy_headers))
-$(foreach m,$(DEFAULT_ERROR_BUILD_MODULE_TYPES),\
+$(foreach m,$(filter-out BUILD_COPY_HEADERS,$(DEFAULT_ERROR_BUILD_MODULE_TYPES)),\
$(if $(filter true,$(BUILD_BROKEN_USES_$(m))),\
$(KATI_deprecated_var $(m),Please convert to Soong),\
$(KATI_obsolete_var $(m),Please convert to Soong)))
diff --git a/core/build-system.html b/core/build-system.html
index cc242d9..9cd7b0b 100644
--- a/core/build-system.html
+++ b/core/build-system.html
@@ -467,8 +467,6 @@
<b>TARGET_ARCH</b><br/>
arm<br/>
arm64<br/>
- mips<br/>
- mips64<br/>
x86<br/>
x86_64
</td>
diff --git a/core/clang/TARGET_mips.mk b/core/clang/TARGET_mips.mk
deleted file mode 100644
index 3e54a66..0000000
--- a/core/clang/TARGET_mips.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-$(clang_2nd_arch_prefix)RS_TRIPLE := renderscript32-linux-androideabi
-$(clang_2nd_arch_prefix)RS_TRIPLE_CFLAGS :=
-RS_COMPAT_TRIPLE := mipsel-linux-android
-
-$(clang_2nd_arch_prefix)TARGET_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-mipsel-android.a
-
-# Address sanitizer clang config
-$(clang_2nd_arch_prefix)ADDRESS_SANITIZER_LINKER := /system/bin/linker_asan
-$(clang_2nd_arch_prefix)ADDRESS_SANITIZER_LINKER_FILE := /system/bin/bootstrap/linker_asan
diff --git a/core/clang/TARGET_mips64.mk b/core/clang/TARGET_mips64.mk
deleted file mode 100644
index cb6a3cd..0000000
--- a/core/clang/TARGET_mips64.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-RS_TRIPLE := renderscript64-linux-android
-RS_TRIPLE_CFLAGS :=
-RS_COMPAT_TRIPLE := mips64el-linux-android
-
-TARGET_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-mips64el-android.a
-
-# Address sanitizer clang config
-$(clang_2nd_arch_prefix)ADDRESS_SANITIZER_LINKER := /system/bin/linker_asan64
-$(clang_2nd_arch_prefix)ADDRESS_SANITIZER_LINKER_FILE := /system/bin/bootstrap/linker_asan64
diff --git a/core/combo/TARGET_linux-mips.mk b/core/combo/TARGET_linux-mips.mk
deleted file mode 100644
index 9f14aa2..0000000
--- a/core/combo/TARGET_linux-mips.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright (C) 2010 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Configuration for Linux on MIPS.
-# Included by combo/select.mk
-
-# You can set TARGET_ARCH_VARIANT to use an arch version other
-# than mips32r2-fp. Each value should correspond to a file named
-# $(BUILD_COMBOS)/arch/<name>.mk which must contain
-# makefile variable definitions. Their
-# purpose is to allow module Android.mk files to selectively compile
-# different versions of code based upon the funtionality and
-# instructions available in a given architecture version.
-#
-# The blocks also define specific arch_variant_cflags, which
-# include defines, and compiler settings for the given architecture
-# version.
-#
-ifeq ($(strip $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT)),)
-TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT := mips32r2-fp
-endif
-
-include $(BUILD_SYSTEM)/combo/fdo.mk
-
-define $(combo_var_prefix)transform-shared-lib-to-toc
-$(call _gen_toc_command_for_elf,$(1),$(2))
-endef
-
-$(combo_2nd_arch_prefix)TARGET_PACK_MODULE_RELOCATIONS := true
-
-$(combo_2nd_arch_prefix)TARGET_LINKER := /system/bin/linker
diff --git a/core/combo/TARGET_linux-mips64.mk b/core/combo/TARGET_linux-mips64.mk
deleted file mode 100644
index ae17e46..0000000
--- a/core/combo/TARGET_linux-mips64.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright (C) 2013 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Configuration for Linux on MIPS64.
-# Included by combo/select.mk
-
-# You can set TARGET_ARCH_VARIANT to use an arch version other
-# than mips64r6. Each value should correspond to a file named
-# $(BUILD_COMBOS)/arch/<name>.mk which must contain
-# makefile variable definitions. Their
-# purpose is to allow module Android.mk files to selectively compile
-# different versions of code based upon the funtionality and
-# instructions available in a given architecture version.
-#
-# The blocks also define specific arch_variant_cflags, which
-# include defines, and compiler settings for the given architecture
-# version.
-#
-ifeq ($(strip $(TARGET_ARCH_VARIANT)),)
-TARGET_ARCH_VARIANT := mips64r6
-endif
-
-include $(BUILD_SYSTEM)/combo/fdo.mk
-
-define $(combo_var_prefix)transform-shared-lib-to-toc
-$(call _gen_toc_command_for_elf,$(1),$(2))
-endef
-
-TARGET_PACK_MODULE_RELOCATIONS := true
-
-TARGET_LINKER := /system/bin/linker64
diff --git a/core/config.mk b/core/config.mk
index ba77990..b329b0d 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -1219,23 +1219,6 @@
# These goals don't need to collect and include Android.mks/CleanSpec.mks
# in the source tree.
dont_bother_goals := out \
- snod systemimage-nodeps \
- userdataimage-nodeps \
- cacheimage-nodeps \
- bptimage-nodeps \
- vnod vendorimage-nodeps \
- pnod productimage-nodeps \
- senod systemextimage-nodeps \
- onod odmimage-nodeps \
- systemotherimage-nodeps \
- ramdisk-nodeps \
- ramdisk_debug-nodeps \
- ramdisk_test_harness-nodeps \
- bootimage-nodeps \
- bootimage_debug-nodeps \
- bootimage_test_harness-nodeps \
- recoveryimage-nodeps \
- vbmetaimage-nodeps \
product-graph dump-products
ifeq ($(CALLED_FROM_SETUP),true)
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index efb21e7..8c76a8d 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -134,12 +134,6 @@
my_sanitize_diag := $(filter-out cfi,$(my_sanitize_diag))
endif
-# CFI needs gold linker, and mips toolchain does not have one.
-ifneq ($(filter mips mips64,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)),)
- my_sanitize := $(filter-out cfi,$(my_sanitize))
- my_sanitize_diag := $(filter-out cfi,$(my_sanitize_diag))
-endif
-
# Disable sanitizers which need the UBSan runtime for host targets.
ifdef LOCAL_IS_HOST_MODULE
my_sanitize := $(filter-out cfi,$(my_sanitize))
diff --git a/core/definitions.mk b/core/definitions.mk
index fb11ab6..3499da9 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2897,7 +2897,8 @@
$(if $(filter $(suite),$(ALL_COMPATIBILITY_SUITES)),,$(eval ALL_COMPATIBILITY_SUITES += $(suite))) \
$(eval COMPATIBILITY.$(suite).FILES := \
$$(COMPATIBILITY.$(suite).FILES) $$(foreach f,$$(my_compat_dist_$(suite)),$$(call word-colon,2,$$(f))) \
- $$(foreach f,$$(my_compat_dist_config_$(suite)),$$(call word-colon,2,$$(f)))) \
+ $$(foreach f,$$(my_compat_dist_config_$(suite)),$$(call word-colon,2,$$(f))) \
+ $$(my_compat_dist_test_data_$(suite))) \
$(eval COMPATIBILITY.$(suite).MODULES := \
$$(COMPATIBILITY.$(suite).MODULES) $$(my_register_name))) \
$(eval $(my_all_targets) : $(call copy-many-files, \
diff --git a/core/deprecation.mk b/core/deprecation.mk
index cc620a3..19bd4cf 100644
--- a/core/deprecation.mk
+++ b/core/deprecation.mk
@@ -24,10 +24,6 @@
# relevant BUILD_BROKEN_USES_BUILD_* variables, then these would move to
# DEFAULT_ERROR_BUILD_MODULE_TYPES.
DEFAULT_WARNING_BUILD_MODULE_TYPES :=$= \
- BUILD_COPY_HEADERS \
- BUILD_HOST_EXECUTABLE \
- BUILD_HOST_SHARED_LIBRARY \
- BUILD_HOST_STATIC_LIBRARY \
# These are BUILD_* variables that are errors to reference, but you can set
# BUILD_BROKEN_USES_BUILD_* in your BoardConfig.mk in order to turn them back
@@ -35,8 +31,12 @@
DEFAULT_ERROR_BUILD_MODULE_TYPES :=$= \
BUILD_AUX_EXECUTABLE \
BUILD_AUX_STATIC_LIBRARY \
+ BUILD_COPY_HEADERS \
+ BUILD_HOST_EXECUTABLE \
BUILD_HOST_FUZZ_TEST \
BUILD_HOST_NATIVE_TEST \
+ BUILD_HOST_SHARED_LIBRARY \
+ BUILD_HOST_STATIC_LIBRARY \
BUILD_HOST_STATIC_TEST_LIBRARY \
BUILD_HOST_TEST_CONFIG \
BUILD_NATIVE_BENCHMARK \
diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk
index 55eeec6..20b4051 100644
--- a/core/dex_preopt.mk
+++ b/core/dex_preopt.mk
@@ -18,9 +18,35 @@
ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(DEXPREOPT_IMAGE_PROFILE_BUILT_INSTALLED),$(PRODUCT_OUT))
# Install boot images. Note that there can be multiple.
+my_boot_image_arch := TARGET_ARCH
+my_boot_image_out := $(PRODUCT_OUT)
+my_boot_image_syms := $(TARGET_OUT_UNSTRIPPED)
+my_boot_image_root := DEFAULT_DEX_PREOPT_INSTALLED_IMAGE
DEFAULT_DEX_PREOPT_INSTALLED_IMAGE :=
-$(TARGET_2ND_ARCH_VAR_PREFIX)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE :=
$(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk))
+ifdef TARGET_2ND_ARCH
+ my_boot_image_arch := TARGET_2ND_ARCH
+ my_boot_image_root := 2ND_DEFAULT_DEX_PREOPT_INSTALLED_IMAGE
+ 2ND_DEFAULT_DEX_PREOPT_INSTALLED_IMAGE :=
+ $(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk))
+endif
+# Install boot images for testing on host. We exclude framework image as it is not part of art manifest.
+my_boot_image_arch := HOST_ARCH
+my_boot_image_out := $(HOST_OUT)
+my_boot_image_syms := $(HOST_OUT)/symbols
+my_boot_image_root := HOST_BOOT_IMAGE
+HOST_BOOT_IMAGE :=
+$(foreach my_boot_image_name,art_host,$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk))
+ifdef HOST_2ND_ARCH
+ my_boot_image_arch := HOST_2ND_ARCH
+ my_boot_image_root := 2ND_HOST_BOOT_IMAGE
+ 2ND_HOST_BOOT_IMAGE :=
+ $(foreach my_boot_image_name,art_host,$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk))
+endif
+my_boot_image_arch :=
+my_boot_image_out :=
+my_boot_image_syms :=
+my_boot_image_root :=
# Build the boot.zip which contains the boot jars and their compilation output
# We can do this only if preopt is enabled and if the product uses libart config (which sets the
diff --git a/core/dex_preopt_config.mk b/core/dex_preopt_config.mk
index ccf53f5..598ac2d 100644
--- a/core/dex_preopt_config.mk
+++ b/core/dex_preopt_config.mk
@@ -56,16 +56,6 @@
DEX2OAT_XMS := $(call get-product-default-property,dalvik.vm.dex2oat-Xms)
DEX2OAT_XMX := $(call get-product-default-property,dalvik.vm.dex2oat-Xmx)
-ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),mips mips64))
-# MIPS specific overrides.
-# For MIPS the ART image is loaded at a lower address. This causes issues
-# with the image overlapping with memory on the host cross-compiling and
-# building the image. We therefore limit the Xmx value. This isn't done
-# via a property as we want the larger Xmx value if we're running on a
-# MIPS device.
-DEX2OAT_XMX := 128m
-endif
-
ifeq ($(WRITE_SOONG_VARIABLES),true)
$(call json_start)
diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk
index 79d5f8c..12b29f4 100644
--- a/core/dex_preopt_libart.mk
+++ b/core/dex_preopt_libart.mk
@@ -1,45 +1,42 @@
####################################
# ART boot image installation
-# Input variable:
+# Input variables:
# my_boot_image_name: the boot image to install
+# my_boot_image_arch: the architecture to install (e.g. TARGET_ARCH, not expanded)
+# my_boot_image_out: the install directory (e.g. $(PRODUCT_OUT))
+# my_boot_image_syms: the symbols director (e.g. $(TARGET_OUT_UNSTRIPPED))
+# my_boot_image_root: make variable used to store installed image path
#
####################################
-# Install primary arch vdex files into a shared location, and then symlink them to both the primary
-# and secondary arch directories.
-my_vdex_copy_pairs := $(DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_$(my_boot_image_name)_$(TARGET_ARCH))
-my_installed := $(foreach v,$(my_vdex_copy_pairs),$(PRODUCT_OUT)$(call word-colon,2,$(v)))
+# Install $(1) to $(2) so that it is shared between architectures.
+define copy-vdex-file
+my_vdex_shared := $$(dir $$(patsubst %/,%,$$(dir $(2))))$$(notdir $(2)) # Remove the arch dir.
+ifneq ($(my_boot_image_arch),$(filter $(my_boot_image_arch), TARGET_2ND_ARCH HOST_2ND_ARCH))
+$$(my_vdex_shared): $(1) # Copy $(1) to directory one level up (i.e. with the arch dir removed).
+ @echo "Install: $$@"
+ $$(copy-file-to-target)
+endif
+$(2): $$(my_vdex_shared) # Create symlink at $(2) which points to the actual physical copy.
+ @echo "Symlink: $$@"
+ mkdir -p $$(dir $$@)
+ ln -sfn ../$$(notdir $$@) $$@
+my_vdex_shared :=
+endef
+
+# Same as 'copy-many-files' but it uses the vdex-specific helper above.
+define copy-vdex-files
+$(foreach v,$(1),$(eval $(call copy-vdex-file, $(call word-colon,1,$(v)), $(2)$(call word-colon,2,$(v)))))
+$(foreach v,$(1),$(2)$(call word-colon,2,$(v)))
+endef
+
+# Install the boot images compiled by Soong.
+# The first file is saved in $(my_boot_image_root) and the rest are added as it's dependencies.
+my_suffix := BUILT_INSTALLED_$(my_boot_image_name)_$($(my_boot_image_arch))
+my_installed := $(call copy-many-files,$(DEXPREOPT_IMAGE_$(my_suffix)),$(my_boot_image_out))
+my_installed += $(call copy-many-files,$(DEXPREOPT_IMAGE_UNSTRIPPED_$(my_suffix)),$(my_boot_image_syms))
+my_installed += $(call copy-vdex-files,$(DEXPREOPT_IMAGE_VDEX_$(my_suffix)),$(my_boot_image_out))
+$(my_boot_image_root) += $(firstword $(my_installed))
$(firstword $(my_installed)): $(wordlist 2,9999,$(my_installed))
-
-my_built_vdex_dir := $(dir $(call word-colon,1,$(firstword $(my_vdex_copy_pairs))))
-my_installed_vdex_dir := $(PRODUCT_OUT)$(dir $(call word-colon,2,$(firstword $(my_vdex_copy_pairs))))
-
-$(my_installed): $(my_installed_vdex_dir)% : $(my_built_vdex_dir)%
- @echo "Install: $@"
- @rm -f $@
- $(copy-file-to-target)
- mkdir -p $(dir $@)/$(TARGET_ARCH)
- ln -sfn ../$(notdir $@) $(dir $@)/$(TARGET_ARCH)
-ifdef TARGET_2ND_ARCH
- mkdir -p $(dir $@)/$(TARGET_2ND_ARCH)
- ln -sfn ../$(notdir $@) $(dir $@)/$(TARGET_2ND_ARCH)
-endif
-
-my_dexpreopt_image_extra_deps := $(firstword $(my_installed))
-
-my_2nd_arch_prefix :=
-include $(BUILD_SYSTEM)/dex_preopt_libart_boot.mk
-
-ifdef TARGET_2ND_ARCH
- my_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
- include $(BUILD_SYSTEM)/dex_preopt_libart_boot.mk
-endif
-
-my_2nd_arch_prefix :=
-
-
-my_vdex_copy_pairs :=
my_installed :=
-my_built_vdex_dir :=
-my_installed_vdex_dir :=
-my_dexpreopt_image_extra_deps :=
+my_suffix :=
diff --git a/core/dex_preopt_libart_boot.mk b/core/dex_preopt_libart_boot.mk
deleted file mode 100644
index 34b8526..0000000
--- a/core/dex_preopt_libart_boot.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-# Rules to install a boot image built by dexpreopt_bootjars.go
-# Input variables:
-# my_boot_image_name: the boot image to install
-# my_2nd_arch_prefix: indicates if this is to build for the 2nd arch.
-# my_dexpreopt_image_extra_deps: extra dependencies to add on the installed boot.art
-
-# Install the boot images compiled by Soong
-# The first file (generally boot.art) is saved as DEFAULT_DEX_PREOPT_INSTALLED_IMAGE,
-# and the rest are added as dependencies of the first.
-
-my_installed := $(call copy-many-files,$(DEXPREOPT_IMAGE_BUILT_INSTALLED_$(my_boot_image_name)_$(TARGET_$(my_2nd_arch_prefix)ARCH)),$(PRODUCT_OUT))
-$(firstword $(my_installed)): $(wordlist 2,9999,$(my_installed))
-$(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE += $(firstword $(my_installed))
-
-# Install the unstripped boot images compiled by Soong into the symbols directory
-# The first file (generally boot.art) made a dependency of DEFAULT_DEX_PREOPT_INSTALLED_IMAGE,
-# and the rest are added as dependencies of the first.
-my_installed := $(call copy-many-files,$(DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_$(my_boot_image_name)_$(TARGET_$(my_2nd_arch_prefix)ARCH)),$(TARGET_OUT_UNSTRIPPED))
-$(firstword $(my_installed)): $(wordlist 2,9999,$(my_installed))
-$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE): $(firstword $(my_installed))
-
-$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE): $(my_dexpreopt_image_extra_deps)
-
-my_installed :=
-my_built_installed :=
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 04a970f..ac3d5cf 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -101,7 +101,7 @@
# ---------------------------------------------------------------
# Set up configuration for host machine. We don't do cross-
-# compiles except for arm/mips, so the HOST is whatever we are
+# compiles except for arm, so the HOST is whatever we are
# running on
# HOST_OS
@@ -259,8 +259,6 @@
# Jars present in the ART apex. These should match exactly the list of
# Java libraries in the ART apex build rule.
ART_APEX_JARS := core-oj core-libart core-icu4j okhttp bouncycastle apache-xml
-TARGET_CORE_JARS := $(ART_APEX_JARS) conscrypt
-HOST_CORE_JARS := $(addsuffix -hostdex,$(TARGET_CORE_JARS))
#################################################################
# Read the product specs so we can get TARGET_DEVICE and other
diff --git a/core/goma.mk b/core/goma.mk
index c265259..2b51d8b 100644
--- a/core/goma.mk
+++ b/core/goma.mk
@@ -27,7 +27,8 @@
# use both ccache and gomacc.
CC_WRAPPER := $(strip $(CC_WRAPPER) $(GOMA_CC))
CXX_WRAPPER := $(strip $(CXX_WRAPPER) $(GOMA_CC))
- JAVAC_WRAPPER := $(strip $(JAVAC_WRAPPER) $(GOMA_CC))
+ # b/143658984: goma can't handle the --system argument to javac
+ #JAVAC_WRAPPER := $(strip $(JAVAC_WRAPPER) $(GOMA_CC))
goma_dir :=
endif
diff --git a/core/host_dalvik_java_library.mk b/core/host_dalvik_java_library.mk
index 882fe3a..5021510 100644
--- a/core/host_dalvik_java_library.mk
+++ b/core/host_dalvik_java_library.mk
@@ -79,7 +79,8 @@
$(java_source_list_file): $(java_sources_deps)
$(write-java-source-list)
-$(full_classes_compiled_jar): .KATI_NINJA_POOL := $(GOMA_POOL)
+# TODO(b/143658984): goma can't handle the --system argument to javac.
+#$(full_classes_compiled_jar): .KATI_NINJA_POOL := $(GOMA_POOL)
$(full_classes_compiled_jar): PRIVATE_JAVA_LAYERS_FILE := $(layers_file)
$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags)
$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES :=
diff --git a/core/host_java_library.mk b/core/host_java_library.mk
index beaea2a..8998d52 100644
--- a/core/host_java_library.mk
+++ b/core/host_java_library.mk
@@ -70,7 +70,8 @@
$(java_source_list_file): $(java_sources_deps)
$(write-java-source-list)
-$(full_classes_compiled_jar): .KATI_NINJA_POOL := $(GOMA_POOL)
+# TODO(b/143658984): goma can't handle the --system argument to javac.
+#$(full_classes_compiled_jar): .KATI_NINJA_POOL := $(GOMA_POOL)
$(full_classes_compiled_jar): PRIVATE_JAVA_LAYERS_FILE := $(layers_file)
$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags)
$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES :=
diff --git a/core/host_shared_library.mk b/core/host_shared_library.mk
index c22af97..fbe6442 100644
--- a/core/host_shared_library.mk
+++ b/core/host_shared_library.mk
@@ -38,6 +38,8 @@
## Copy headers to the install tree
###########################################################
ifdef LOCAL_COPY_HEADERS
-$(call pretty-warning,LOCAL_COPY_HEADERS is deprecated. See $(CHANGES_URL)#copy_headers)
+$(if $(filter true,$(BUILD_BROKEN_USES_BUILD_COPY_HEADERS)),\
+ $(call pretty-warning,LOCAL_COPY_HEADERS is deprecated. See $(CHANGES_URL)#copy_headers),\
+ $(call pretty-error,LOCAL_COPY_HEADERS is obsolete. See $(CHANGES_URL)#copy_headers))
include $(BUILD_SYSTEM)/copy_headers.mk
endif
diff --git a/core/host_static_library.mk b/core/host_static_library.mk
index 3dbd144..23d809c 100644
--- a/core/host_static_library.mk
+++ b/core/host_static_library.mk
@@ -38,6 +38,8 @@
## Copy headers to the install tree
###########################################################
ifdef LOCAL_COPY_HEADERS
-$(call pretty-warning,LOCAL_COPY_HEADERS is deprecated. See $(CHANGES_URL)#copy_headers)
+$(if $(filter true,$(BUILD_BROKEN_USES_BUILD_COPY_HEADERS)),\
+ $(call pretty-warning,LOCAL_COPY_HEADERS is deprecated. See $(CHANGES_URL)#copy_headers),\
+ $(call pretty-error,LOCAL_COPY_HEADERS is obsolete. See $(CHANGES_URL)#copy_headers))
include $(BUILD_SYSTEM)/copy_headers.mk
endif
diff --git a/core/java.mk b/core/java.mk
index a041321..44e005d 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -274,7 +274,8 @@
endif # TURBINE_ENABLED != false
-$(full_classes_compiled_jar): .KATI_NINJA_POOL := $(GOMA_POOL)
+# TODO(b/143658984): goma can't handle the --system argument to javac.
+#$(full_classes_compiled_jar): .KATI_NINJA_POOL := $(GOMA_POOL)
$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags)
$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES := $(LOCAL_JAR_EXCLUDE_FILES)
$(full_classes_compiled_jar): PRIVATE_JAR_PACKAGES := $(LOCAL_JAR_PACKAGES)
diff --git a/core/java_renderscript.mk b/core/java_renderscript.mk
index 672863b..bfcf59e 100644
--- a/core/java_renderscript.mk
+++ b/core/java_renderscript.mk
@@ -129,7 +129,7 @@
endif
my_arch := $(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)
-ifneq (,$(filter arm64 mips64 x86_64,$(my_arch)))
+ifneq (,$(filter arm64 x86_64,$(my_arch)))
my_min_sdk_version := 21
else
my_min_sdk_version := $(MIN_SUPPORTED_SDK_VERSION)
diff --git a/core/main.mk b/core/main.mk
index dc8080d..5fb3810 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -222,9 +222,6 @@
ADDITIONAL_BUILD_PROPERTIES += persist.debug.dalvik.vm.core_platform_api_policy=just-warn
endif
-# Define ro.sanitize.<name> properties for all global sanitizers.
-ADDITIONAL_BUILD_PROPERTIES += $(foreach s,$(SANITIZE_TARGET),ro.sanitize.$(s)=true)
-
# Sets the default value of ro.postinstall.fstab.prefix to /system.
# Device board config should override the value to /product when needed by:
#
@@ -313,7 +310,7 @@
endif
ifndef is_sdk_build
# To speedup startup of non-preopted builds, don't verify or compile the boot image.
- ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.image-dex2oat-filter=verify-at-runtime
+ ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.image-dex2oat-filter=extract
endif
endif
@@ -1033,6 +1030,7 @@
define auto-included-modules
$(if $(BOARD_VNDK_VERSION),vndk_package) \
$(if $(DEVICE_MANIFEST_FILE),vendor_manifest.xml) \
+ $(if $(DEVICE_MANIFEST_SKUS),$(foreach sku, $(DEVICE_MANIFEST_SKUS),vendor_manifest_$(sku).xml)) \
$(if $(ODM_MANIFEST_FILES),odm_manifest.xml) \
$(if $(ODM_MANIFEST_SKUS),$(foreach sku, $(ODM_MANIFEST_SKUS),odm_manifest_$(sku).xml)) \
@@ -1254,6 +1252,7 @@
$(CUSTOM_MODULES) \
)
+ifdef FULL_BUILD
#
# Used by the cleanup logic in soong_ui to remove files that should no longer
# be installed.
@@ -1274,6 +1273,7 @@
$(test_files)))))
test_files :=
+endif
# Don't include any GNU General Public License shared objects or static
diff --git a/core/ninja_config.mk b/core/ninja_config.mk
index b1f4b03..3f2e5de 100644
--- a/core/ninja_config.mk
+++ b/core/ninja_config.mk
@@ -40,15 +40,13 @@
sdk \
sdk_addon \
sdk_repo \
- snod \
stnod \
- systemimage-nodeps \
target-files-package \
test-art% \
user \
userdataimage \
userdebug \
- vts \
+ vts10 \
win_sdk \
winsdk-tools
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 7bbaeb6..c6c2cf5 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -100,19 +100,19 @@
# Determine whether auto-RRO is enabled for this package.
enforce_rro_enabled :=
ifneq (,$(filter *, $(PRODUCT_ENFORCE_RRO_TARGETS)))
- # * means all system APKs, so enable conditionally based on module path.
+ # * means all system and system_ext APKs, so enable conditionally based on module path.
+ # Note that modules in PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS are excluded even if it is '*'
# Note that base_rules.mk has not yet been included, so it's likely that only
# one of LOCAL_MODULE_PATH and the LOCAL_X_MODULE flags has been set.
ifeq (,$(LOCAL_MODULE_PATH))
- non_system_module := $(filter true,\
+ non_rro_target_module := $(filter true,\
$(LOCAL_ODM_MODULE) \
$(LOCAL_OEM_MODULE) \
$(LOCAL_PRODUCT_MODULE) \
- $(LOCAL_SYSTEM_EXT_MODULE) \
$(LOCAL_PROPRIETARY_MODULE) \
$(LOCAL_VENDOR_MODULE))
- enforce_rro_enabled := $(if $(non_system_module),,true)
+ enforce_rro_enabled := $(if $(non_rro_target_module),,true)
else ifneq ($(filter $(TARGET_OUT)/%,$(LOCAL_MODULE_PATH)),)
enforce_rro_enabled := true
endif
@@ -120,6 +120,12 @@
enforce_rro_enabled := true
endif
+# TODO(b/150820813) Some modules depend on static overlay, remove this after eliminating the dependency.
+ifneq (,$(filter $(LOCAL_PACKAGE_NAME), $(PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS)))
+ enforce_rro_enabled :=
+endif
+
+
product_package_overlays := $(strip \
$(wildcard $(foreach dir, $(PRODUCT_PACKAGE_OVERLAYS), \
$(addprefix $(dir)/, $(LOCAL_RESOURCE_DIR)))))
@@ -465,6 +471,9 @@
$(LOCAL_BUILT_MODULE): $(additional_certificates)
$(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CERTIFICATES := $(additional_certificates)
+# Set a actual_partition_tag (calculated in base_rules.mk) for the package.
+PACKAGES.$(LOCAL_PACKAGE_NAME).PARTITION := $(actual_partition_tag)
+
# Verify LOCAL_USES_LIBRARIES/LOCAL_OPTIONAL_USES_LIBRARIES
# If LOCAL_ENFORCE_USES_LIBRARIES is not set, default to true if either of LOCAL_USES_LIBRARIES or
# LOCAL_OPTIONAL_USES_LIBRARIES are specified.
diff --git a/core/product.mk b/core/product.mk
index 25a9c44..b497abb 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -193,6 +193,9 @@
# Package list to apply enforcing RRO.
_product_list_vars += PRODUCT_ENFORCE_RRO_TARGETS
+# Packages to skip auto-generating RROs for when PRODUCT_ENFORCE_RRO_TARGETS is set to *.
+_product_list_vars += PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS
+
_product_list_vars += PRODUCT_SDK_ATREE_FILES
_product_list_vars += PRODUCT_SDK_ADDON_NAME
_product_list_vars += PRODUCT_SDK_ADDON_COPY_FILES
@@ -213,6 +216,12 @@
# A list of module names of BOOTCLASSPATH (jar files)
_product_list_vars += PRODUCT_BOOT_JARS
+
+# A list of extra BOOTCLASSPATH jars (to be appended after common jars).
+# Products that include device-specific makefiles before AOSP makefiles should use this
+# instead of PRODUCT_BOOT_JARS, so that device-specific jars go after common jars.
+_product_list_vars += PRODUCT_BOOT_JARS_EXTRA
+
_product_list_vars += PRODUCT_SUPPORTS_BOOT_SIGNER
_product_list_vars += PRODUCT_SUPPORTS_VBOOT
_product_list_vars += PRODUCT_SUPPORTS_VERITY
diff --git a/core/product_config.mk b/core/product_config.mk
index c4361d0..aabd472 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -228,6 +228,9 @@
PRODUCT_AAPT_CONFIG_SP := $(PRODUCT_AAPT_CONFIG)
PRODUCT_AAPT_CONFIG := $(subst $(space),$(comma),$(PRODUCT_AAPT_CONFIG))
+# Extra boot jars must be appended at the end after common boot jars.
+PRODUCT_BOOT_JARS += $(PRODUCT_BOOT_JARS_EXTRA)
+
ifndef PRODUCT_SYSTEM_NAME
PRODUCT_SYSTEM_NAME := $(PRODUCT_NAME)
endif
diff --git a/core/rbe.mk b/core/rbe.mk
index 7886e1a..019ac04 100644
--- a/core/rbe.mk
+++ b/core/rbe.mk
@@ -46,8 +46,12 @@
d8_exec_strategy := "local"
endif
+ platform := "container-image=docker://gcr.io/androidbuild-re-dockerimage/android-build-remoteexec-image@sha256:582efb38f0c229ea39952fff9e132ccbe183e14869b39888010dacf56b360d62"
+ cxx_platform := $(platform)",Pool=default"
+ java_r8_d8_platform := $(platform)",Pool=java16"
+
RBE_WRAPPER := $(rbe_dir)/rewrapper
- RBE_CXX := --labels=type=compile,lang=cpp,compiler=clang --env_var_whitelist=PWD --exec_strategy=$(cxx_rbe_exec_strategy)
+ RBE_CXX := --labels=type=compile,lang=cpp,compiler=clang --env_var_whitelist=PWD --exec_strategy=$(cxx_rbe_exec_strategy) --platform="$(cxx_platform)"
# Append rewrapper to existing *_WRAPPER variables so it's possible to
# use both ccache and rewrapper.
@@ -55,16 +59,17 @@
CXX_WRAPPER := $(strip $(CXX_WRAPPER) $(RBE_WRAPPER) $(RBE_CXX))
ifdef RBE_JAVAC
- JAVAC_WRAPPER := $(strip $(JAVAC_WRAPPER) $(RBE_WRAPPER) --labels=type=compile,lang=java,compiler=javac,shallow=true --exec_strategy=$(javac_exec_strategy))
+ JAVAC_WRAPPER := $(strip $(JAVAC_WRAPPER) $(RBE_WRAPPER) --labels=type=compile,lang=java,compiler=javac --exec_strategy=$(javac_exec_strategy) --platform="$(java_r8_d8_platform)")
endif
ifdef RBE_R8
- R8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=r8,shallow=true --exec_strategy=$(r8_exec_strategy))
+ R8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=r8 --exec_strategy=$(r8_exec_strategy) --platform="$(java_r8_d8_platform)" --inputs=out/soong/host/linux-x86/framework/r8-compat-proguard.jar,build/make/core/proguard_basic_keeps.flags --toolchain_inputs=prebuilts/jdk/jdk11/linux-x86/bin/java)
endif
ifdef RBE_D8
- D8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=d8,shallow=true --exec_strategy=$(d8_exec_strategy))
+ D8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=d8 --exec_strategy=$(d8_exec_strategy) --platform="$(java_r8_d8_platform)" --inputs=out/soong/host/linux-x86/framework/d8.jar --toolchain_inputs=prebuilts/jdk/jdk11/linux-x86/bin/java)
endif
rbe_dir :=
endif
+
diff --git a/core/shared_library.mk b/core/shared_library.mk
index ca17151..29d8276 100644
--- a/core/shared_library.mk
+++ b/core/shared_library.mk
@@ -57,6 +57,8 @@
## Copy headers to the install tree
###########################################################
ifdef LOCAL_COPY_HEADERS
-$(call pretty-warning,LOCAL_COPY_HEADERS is deprecated. See $(CHANGES_URL)#copy_headers)
+$(if $(filter true,$(BUILD_BROKEN_USES_BUILD_COPY_HEADERS)),\
+ $(call pretty-warning,LOCAL_COPY_HEADERS is deprecated. See $(CHANGES_URL)#copy_headers),\
+ $(call pretty-error,LOCAL_COPY_HEADERS is obsolete. See $(CHANGES_URL)#copy_headers))
include $(BUILD_SYSTEM)/copy_headers.mk
endif
diff --git a/core/soong_app_prebuilt.mk b/core/soong_app_prebuilt.mk
index 0a5ba9d..6dc396c 100644
--- a/core/soong_app_prebuilt.mk
+++ b/core/soong_app_prebuilt.mk
@@ -157,6 +157,9 @@
include $(BUILD_SYSTEM)/app_certificate_validate.mk
PACKAGES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))
+# Set a actual_partition_tag (calculated in base_rules.mk) for the package.
+PACKAGES.$(LOCAL_MODULE).PARTITION := $(actual_partition_tag)
+
ifdef LOCAL_SOONG_BUNDLE
ALL_MODULES.$(LOCAL_MODULE).BUNDLE := $(LOCAL_SOONG_BUNDLE)
endif
@@ -202,4 +205,11 @@
)
endif
+ifdef LOCAL_PREBUILT_COVERAGE_ARCHIVE
+ my_coverage_dir := $(TARGET_OUT_COVERAGE)/$(patsubst $(PRODUCT_OUT)/%,%,$(my_module_path))
+ my_coverage_copy_pairs := $(foreach f,$(LOCAL_PREBUILT_COVERAGE_ARCHIVE),$(f):$(my_coverage_dir)/$(notdir $(f)))
+ my_coverage_files := $(call copy-many-files,$(my_coverage_copy_pairs))
+ $(LOCAL_INSTALLED_MODULE): $(my_coverage_files)
+endif
+
SOONG_ALREADY_CONV := $(SOONG_ALREADY_CONV) $(LOCAL_MODULE)
diff --git a/core/soong_cc_prebuilt.mk b/core/soong_cc_prebuilt.mk
index 7853890..6317b53 100644
--- a/core/soong_cc_prebuilt.mk
+++ b/core/soong_cc_prebuilt.mk
@@ -112,7 +112,9 @@
my_check_same_vndk_variants :=
ifeq ($(LOCAL_CHECK_SAME_VNDK_VARIANTS),true)
ifeq ($(filter hwaddress address, $(SANITIZE_TARGET)),)
- my_check_same_vndk_variants := true
+ ifneq ($(CLANG_COVERAGE),true)
+ my_check_same_vndk_variants := true
+ endif
endif
endif
diff --git a/core/soong_config.mk b/core/soong_config.mk
index abe1923..c91639c 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -81,6 +81,7 @@
$(call add_json_list, DeviceResourceOverlays, $(DEVICE_PACKAGE_OVERLAYS))
$(call add_json_list, ProductResourceOverlays, $(PRODUCT_PACKAGE_OVERLAYS))
$(call add_json_list, EnforceRROTargets, $(PRODUCT_ENFORCE_RRO_TARGETS))
+$(call add_json_list, EnforceRROExemptedTargets, $(PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS))
$(call add_json_list, EnforceRROExcludedOverlays, $(PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS))
$(call add_json_str, AAPTCharacteristics, $(TARGET_AAPT_CHARACTERISTICS))
@@ -116,6 +117,8 @@
$(call add_json_list, CoveragePaths, $(COVERAGE_PATHS))
$(call add_json_list, CoverageExcludePaths, $(COVERAGE_EXCLUDE_PATHS))
+$(call add_json_bool, SamplingPGO, $(filter true,$(SAMPLING_PGO)))
+
$(call add_json_bool, ArtUseReadBarrier, $(call invert_bool,$(filter false,$(PRODUCT_ART_USE_READ_BARRIER))))
$(call add_json_bool, Binder32bit, $(BINDER32BIT))
$(call add_json_str, BtConfigIncludeDir, $(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR))
diff --git a/core/static_library.mk b/core/static_library.mk
index 78908cf..a450092 100644
--- a/core/static_library.mk
+++ b/core/static_library.mk
@@ -42,6 +42,8 @@
## Copy headers to the install tree
###########################################################
ifdef LOCAL_COPY_HEADERS
-$(call pretty-warning,LOCAL_COPY_HEADERS is deprecated. See $(CHANGES_URL)#copy_headers)
+$(if $(filter true,$(BUILD_BROKEN_USES_BUILD_COPY_HEADERS)),\
+ $(call pretty-warning,LOCAL_COPY_HEADERS is deprecated. See $(CHANGES_URL)#copy_headers),\
+ $(call pretty-error,LOCAL_COPY_HEADERS is obsolete. See $(CHANGES_URL)#copy_headers))
include $(BUILD_SYSTEM)/copy_headers.mk
endif
diff --git a/core/tasks/device-tests.mk b/core/tasks/device-tests.mk
index f071c7c..73fad7c 100644
--- a/core/tasks/device-tests.mk
+++ b/core/tasks/device-tests.mk
@@ -21,30 +21,38 @@
# Create an artifact to include all test config files in device-tests.
device-tests-configs-zip := $(PRODUCT_OUT)/device-tests_configs.zip
my_host_shared_lib_for_device_tests := $(call copy-many-files,$(COMPATIBILITY.device-tests.HOST_SHARED_LIBRARY.FILES))
-$(device-tests-zip) : .KATI_IMPLICIT_OUTPUTS := $(device-tests-list-zip) $(device-tests-configs-zip)
+device_tests_host_shared_libs_zip := $(PRODUCT_OUT)/device-tests_host-shared-libs.zip
+
+$(device-tests-zip) : .KATI_IMPLICIT_OUTPUTS := $(device-tests-list-zip) $(device-tests-configs-zip) $(device_tests_host_shared_libs_zip)
$(device-tests-zip) : PRIVATE_device_tests_list := $(PRODUCT_OUT)/device-tests_list
$(device-tests-zip) : PRIVATE_HOST_SHARED_LIBS := $(my_host_shared_lib_for_device_tests)
+$(device-tests-zip) : PRIVATE_device_host_shared_libs_zip := $(device_tests_host_shared_libs_zip)
$(device-tests-zip) : $(COMPATIBILITY.device-tests.FILES) $(my_host_shared_lib_for_device_tests) $(SOONG_ZIP)
+ rm -f $@-shared-libs.list
echo $(sort $(COMPATIBILITY.device-tests.FILES)) | tr " " "\n" > $@.list
grep $(HOST_OUT_TESTCASES) $@.list > $@-host.list || true
grep -e .*\\.config$$ $@-host.list > $@-host-test-configs.list || true
$(hide) for shared_lib in $(PRIVATE_HOST_SHARED_LIBS); do \
echo $$shared_lib >> $@-host.list; \
+ echo $$shared_lib >> $@-shared-libs.list; \
done
+ grep $(HOST_OUT_TESTCASES) $@-shared-libs.list > $@-host-shared-libs.list || true
grep $(TARGET_OUT_TESTCASES) $@.list > $@-target.list || true
grep -e .*\\.config$$ $@-target.list > $@-target-test-configs.list || true
$(hide) $(SOONG_ZIP) -d -o $@ -P host -C $(HOST_OUT) -l $@-host.list -P target -C $(PRODUCT_OUT) -l $@-target.list
$(hide) $(SOONG_ZIP) -d -o $(device-tests-configs-zip) \
-P host -C $(HOST_OUT) -l $@-host-test-configs.list \
-P target -C $(PRODUCT_OUT) -l $@-target-test-configs.list
+ $(SOONG_ZIP) -d -o $(PRIVATE_device_host_shared_libs_zip) \
+ -P host -C $(HOST_OUT) -l $@-host-shared-libs.list
rm -f $(PRIVATE_device_tests_list)
$(hide) grep -e .*\\.config$$ $@-host.list | sed s%$(HOST_OUT)%host%g > $(PRIVATE_device_tests_list)
$(hide) grep -e .*\\.config$$ $@-target.list | sed s%$(PRODUCT_OUT)%target%g >> $(PRIVATE_device_tests_list)
$(hide) $(SOONG_ZIP) -d -o $(device-tests-list-zip) -C $(dir $@) -f $(PRIVATE_device_tests_list)
rm -f $@.list $@-host.list $@-target.list $@-host-test-configs.list $@-target-test-configs.list \
- $(PRIVATE_device_tests_list)
+ $@-shared-libs.list $@-host-shared-libs.list $(PRIVATE_device_tests_list)
device-tests: $(device-tests-zip)
-$(call dist-for-goals, device-tests, $(device-tests-zip) $(device-tests-list-zip) $(device-tests-configs-zip))
+$(call dist-for-goals, device-tests, $(device-tests-zip) $(device-tests-list-zip) $(device-tests-configs-zip) $(device_tests_host_shared_libs_zip))
tests: device-tests
diff --git a/core/tasks/general-tests.mk b/core/tasks/general-tests.mk
index 53ebddc..1cf7ef8 100644
--- a/core/tasks/general-tests.mk
+++ b/core/tasks/general-tests.mk
@@ -14,12 +14,12 @@
.PHONY: general-tests
-# TODO(b/149249068): Remove vts-tradefed.jar after all VTS tests are converted
+# TODO(b/149249068): Remove vts10-tradefed.jar after all VTS tests are converted
general_tests_tools := \
$(HOST_OUT_JAVA_LIBRARIES)/cts-tradefed.jar \
$(HOST_OUT_JAVA_LIBRARIES)/compatibility-host-util.jar \
$(HOST_OUT_JAVA_LIBRARIES)/vts-core-tradefed.jar \
- $(HOST_OUT_JAVA_LIBRARIES)/vts-tradefed.jar
+ $(HOST_OUT_JAVA_LIBRARIES)/vts10-tradefed.jar
intermediates_dir := $(call intermediates-dir-for,PACKAGING,general-tests)
general_tests_zip := $(PRODUCT_OUT)/general-tests.zip
diff --git a/core/tasks/tools/package-modules.mk b/core/tasks/tools/package-modules.mk
index 55a08f5..6cafa4a 100644
--- a/core/tasks/tools/package-modules.mk
+++ b/core/tasks/tools/package-modules.mk
@@ -16,7 +16,16 @@
#
my_makefile := $(lastword $(filter-out $(lastword $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
-my_staging_dir := $(call intermediates-dir-for,PACKAGING,$(my_package_name))
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := $(my_package_name)
+LOCAL_MODULE_CLASS := PACKAGING
+LOCAL_MODULE_STEM := $(my_package_name).zip
+LOCAL_UNINSTALLABLE_MODULE := true
+include $(BUILD_SYSTEM)/base_rules.mk
+my_staging_dir := $(intermediates)
+my_package_zip := $(LOCAL_BUILT_MODULE)
+
my_built_modules := $(foreach p,$(my_copy_pairs),$(call word-colon,1,$(p)))
my_copy_pairs := $(foreach p,$(my_copy_pairs),$(call word-colon,1,$(p)):$(my_staging_dir)/$(call word-colon,2,$(p)))
my_pickup_files :=
@@ -80,7 +89,6 @@
$(error done)
endif
-my_package_zip := $(my_staging_dir)/$(my_package_name).zip
$(my_package_zip): PRIVATE_COPY_PAIRS := $(my_copy_pairs)
$(my_package_zip): PRIVATE_PICKUP_FILES := $(my_pickup_files)
$(my_package_zip) : $(my_built_modules)
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 57268ce..ab7783f 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -250,7 +250,7 @@
# It must be of the form "YYYY-MM-DD" on production devices.
# It must match one of the Android Security Patch Level strings of the Public Security Bulletins.
# If there is no $PLATFORM_SECURITY_PATCH set, keep it empty.
- PLATFORM_SECURITY_PATCH := 2020-02-05
+ PLATFORM_SECURITY_PATCH := 2020-03-05
endif
.KATI_READONLY := PLATFORM_SECURITY_PATCH
diff --git a/envsetup.sh b/envsetup.sh
index d533d0d..791a43d 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -8,7 +8,7 @@
Selects <product_name> as the product to build, and <build_variant> as the variant to
build, and stores those selections in the environment to be read by subsequent
invocations of 'm' etc.
-- tapas: tapas [<App1> <App2> ...] [arm|x86|mips|arm64|x86_64|mips64] [eng|userdebug|user]
+- tapas: tapas [<App1> <App2> ...] [arm|x86|arm64|x86_64] [eng|userdebug|user]
- croot: Changes directory to the top of the tree, or a subdirectory thereof.
- m: Makes from the top of the tree.
- mm: Builds and installs all of the modules in the current directory, and their
@@ -218,8 +218,6 @@
arm64) toolchaindir=aarch64/aarch64-linux-android-$targetgccversion/bin;
toolchaindir2=arm/arm-linux-androideabi-$targetgccversion2/bin
;;
- mips|mips64) toolchaindir=mips/mips64el-linux-android-$targetgccversion/bin
- ;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
@@ -701,10 +699,10 @@
function tapas()
{
local showHelp="$(echo $* | xargs -n 1 echo | \grep -E '^(help)$' | xargs)"
- local arch="$(echo $* | xargs -n 1 echo | \grep -E '^(arm|x86|mips|arm64|x86_64|mips64)$' | xargs)"
+ local arch="$(echo $* | xargs -n 1 echo | \grep -E '^(arm|x86|arm64|x86_64)$' | xargs)"
local variant="$(echo $* | xargs -n 1 echo | \grep -E '^(user|userdebug|eng)$' | xargs)"
local density="$(echo $* | xargs -n 1 echo | \grep -E '^(ldpi|mdpi|tvdpi|hdpi|xhdpi|xxhdpi|xxxhdpi|alldpi)$' | xargs)"
- local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|arm|x86|mips|arm64|x86_64|mips64|ldpi|mdpi|tvdpi|hdpi|xhdpi|xxhdpi|xxxhdpi|alldpi)$' | xargs)"
+ local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|arm|x86|arm64|x86_64|ldpi|mdpi|tvdpi|hdpi|xhdpi|xxhdpi|xxxhdpi|alldpi)$' | xargs)"
if [ "$showHelp" != "" ]; then
$(gettop)/build/make/tapasHelp.sh
@@ -727,10 +725,8 @@
local product=aosp_arm
case $arch in
x86) product=aosp_x86;;
- mips) product=aosp_mips;;
arm64) product=aosp_arm64;;
x86_64) product=aosp_x86_64;;
- mips64) product=aosp_mips64;;
esac
if [ -z "$variant" ]; then
variant=eng
@@ -954,7 +950,7 @@
Darwin)
function sgrep()
{
- find -E . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.(c|h|cc|cpp|hpp|S|java|xml|sh|mk|aidl|vts)' \
+ find -E . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.(c|h|cc|cpp|hpp|S|java|xml|sh|mk|aidl|vts|proto)' \
-exec grep --color -n "$@" {} +
}
@@ -962,7 +958,7 @@
*)
function sgrep()
{
- find . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.\(c\|h\|cc\|cpp\|hpp\|S\|java\|xml\|sh\|mk\|aidl\|vts\)' \
+ find . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.\(c\|h\|cc\|cpp\|hpp\|S\|java\|xml\|sh\|mk\|aidl\|vts\|proto\)' \
-exec grep --color -n "$@" {} +
}
;;
diff --git a/rbesetup.sh b/rbesetup.sh
new file mode 100644
index 0000000..7e9b2ea
--- /dev/null
+++ b/rbesetup.sh
@@ -0,0 +1,25 @@
+source build/envsetup.sh
+
+# This function prefixes the given command with appropriate variables needed
+# for the build to be executed with RBE.
+function use_rbe() {
+ local RBE_LOG_DIR="/tmp"
+ local RBE_BINARIES_DIR="prebuilts/remoteexecution-client/latest/"
+ local DOCKER_IMAGE="gcr.io/androidbuild-re-dockerimage/android-build-remoteexec-image@sha256:582efb38f0c229ea39952fff9e132ccbe183e14869b39888010dacf56b360d62"
+
+ # Do not set an invocation-ID and let reproxy auto-generate one.
+ USE_RBE="true" \
+ FLAG_server_address="unix:///tmp/reproxy_$RANDOM.sock" \
+ FLAG_exec_root="$(gettop)" \
+ FLAG_platform="container-image=docker://${DOCKER_IMAGE}" \
+ RBE_use_application_default_credentials="true" \
+ RBE_log_dir="${RBE_LOG_DIR}" \
+ RBE_reproxy_wait_seconds="20" \
+ RBE_output_dir="${RBE_LOG_DIR}" \
+ RBE_log_path="text://${RBE_LOG_DIR}/reproxy_log.txt" \
+ RBE_CXX_EXEC_STRATEGY="remote_local_fallback" \
+ RBE_cpp_dependency_scanner_plugin="${RBE_BINARIES_DIR}/dependency_scanner_go_plugin.so" \
+ RBE_DIR=${RBE_BINARIES_DIR} \
+ RBE_re_proxy="${RBE_BINARIES_DIR}/reproxy" \
+ $@
+}
diff --git a/tapasHelp.sh b/tapasHelp.sh
index 38b3e34..0f46130 100755
--- a/tapasHelp.sh
+++ b/tapasHelp.sh
@@ -6,7 +6,7 @@
cd ../..
TOP="${PWD}"
-message='usage: tapas [<App1> <App2> ...] [arm|x86|mips|arm64|x86_64|mips64] [eng|userdebug|user]
+message='usage: tapas [<App1> <App2> ...] [arm|x86|arm64|x86_64] [eng|userdebug|user]
tapas selects individual apps to be built by the Android build system. Unlike
"lunch", "tapas" does not request the building of images for a device.
diff --git a/target/board/Android.mk b/target/board/Android.mk
index 2c7d2da..9edc85c 100644
--- a/target/board/Android.mk
+++ b/target/board/Android.mk
@@ -52,6 +52,43 @@
include $(BUILD_PREBUILT)
endif
+# DEVICE_MANIFEST_SKUS: a list of SKUS where DEVICE_MANIFEST_<sku>_FILES is defined.
+ifdef DEVICE_MANIFEST_SKUS
+
+# Install /vendor/etc/vintf/manifest_$(sku).xml
+# $(1): sku
+define _add_device_sku_manifest
+my_fragment_files_var := DEVICE_MANIFEST_$$(call to-upper,$(1))_FILES
+ifndef $$(my_fragment_files_var)
+$$(error $(1) is in DEVICE_MANIFEST_SKUS but $$(my_fragment_files_var) is not defined)
+endif
+my_fragment_files := $$($$(my_fragment_files_var))
+include $$(CLEAR_VARS)
+LOCAL_MODULE := vendor_manifest_$(1).xml
+LOCAL_MODULE_STEM := manifest_$(1).xml
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/vintf
+
+GEN := $$(local-generated-sources-dir)/manifest_$(1).xml
+$$(GEN): PRIVATE_SRC_FILES := $$(my_fragment_files)
+$$(GEN): $$(my_fragment_files) $$(HOST_OUT_EXECUTABLES)/assemble_vintf
+ BOARD_SEPOLICY_VERS=$$(BOARD_SEPOLICY_VERS) \
+ PRODUCT_ENFORCE_VINTF_MANIFEST=$$(PRODUCT_ENFORCE_VINTF_MANIFEST) \
+ PRODUCT_SHIPPING_API_LEVEL=$$(PRODUCT_SHIPPING_API_LEVEL) \
+ $$(HOST_OUT_EXECUTABLES)/assemble_vintf -o $$@ \
+ -i $$(call normalize-path-list,$$(PRIVATE_SRC_FILES))
+
+LOCAL_PREBUILT_MODULE_FILE := $$(GEN)
+include $$(BUILD_PREBUILT)
+my_fragment_files_var :=
+my_fragment_files :=
+endef
+
+$(foreach sku, $(DEVICE_MANIFEST_SKUS), $(eval $(call _add_device_sku_manifest,$(sku))))
+_add_device_sku_manifest :=
+
+endif # DEVICE_MANIFEST_SKUS
+
# ODM manifest
ifdef ODM_MANIFEST_FILES
# ODM_MANIFEST_FILES is a list of files that is combined and installed as the default ODM manifest.
diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk
index f5caf70..a5264e4 100644
--- a/target/board/generic_arm64/BoardConfig.mk
+++ b/target/board/generic_arm64/BoardConfig.mk
@@ -23,7 +23,7 @@
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
-ifneq ($(TARGET_BUILD_APPS)$(filter cts sdk vts,$(MAKECMDGOALS)),)
+ifneq ($(TARGET_BUILD_APPS)$(filter cts sdk vts10,$(MAKECMDGOALS)),)
# DO NOT USE
# DO NOT USE
#
@@ -55,8 +55,16 @@
include build/make/target/board/BoardConfigGsiCommon.mk
include build/make/target/board/BoardConfigEmuCommon.mk
+TARGET_NO_KERNEL := false
+TARGET_NO_VENDOR_BOOT := true
+BOARD_USES_RECOVERY_AS_BOOT := true
+
+BOARD_BOOTIMAGE_PARTITION_SIZE := 0x02000000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800
+BOARD_BOOT_HEADER_VERSION := 3
+BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
+
# Emulator system image is going to be used as GSI and some vendor still hasn't
# cleaned up all device specific directories under root!
diff --git a/target/board/generic_arm64/device.mk b/target/board/generic_arm64/device.mk
index e5d8e61..4fcae46 100644
--- a/target/board/generic_arm64/device.mk
+++ b/target/board/generic_arm64/device.mk
@@ -14,6 +14,16 @@
# limitations under the License.
#
+# Cuttlefish has GKI kernel prebuilts, so use those for the GKI boot.img.
+ifeq ($(TARGET_PREBUILT_KERNEL),)
+ LOCAL_KERNEL := device/google/cuttlefish_kernel/5.4-arm64/kernel
+else
+ LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
+endif
+
+PRODUCT_COPY_FILES += \
+ $(LOCAL_KERNEL):kernel
+
# Adjust the Dalvik heap to be appropriate for a tablet.
$(call inherit-product-if-exists, frameworks/base/build/tablet-dalvik-heap.mk)
$(call inherit-product-if-exists, frameworks/native/build/tablet-dalvik-heap.mk)
diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk
index e133db4..491397f 100644
--- a/target/product/aosp_arm64.mk
+++ b/target/product/aosp_arm64.mk
@@ -53,7 +53,6 @@
#
# All components inherited here go to vendor image
#
-$(call inherit-product-if-exists, device/generic/goldfish/arm64-vendor.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk)
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index b795dbb..434cbfc 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -27,6 +27,7 @@
android.test.base \
android.test.mock \
android.test.runner \
+ ANGLE \
apexd \
appops \
app_process \
@@ -63,7 +64,6 @@
com.android.tzdata \
ContactsProvider \
content \
- crash_dump \
debuggerd\
device_config \
dmctl \
@@ -311,8 +311,8 @@
tz_version_host \
tz_version_host_tzdata_apex \
-ifeq ($(TARGET_CORE_JARS),)
-$(error TARGET_CORE_JARS is empty; cannot initialize PRODUCT_BOOT_JARS variable)
+ifeq ($(ART_APEX_JARS),)
+$(error ART_APEX_JARS is empty; cannot initialize PRODUCT_BOOT_JARS variable)
endif
# The order matters for runtime class lookup performance.
diff --git a/target/product/base_system_ext.mk b/target/product/base_system_ext.mk
index 6847bfa..b67549a 100644
--- a/target/product/base_system_ext.mk
+++ b/target/product/base_system_ext.mk
@@ -17,4 +17,5 @@
# Base modules and settings for the system_ext partition.
PRODUCT_PACKAGES += \
group_system_ext \
+ system_ext_manifest.xml \
passwd_system_ext \
diff --git a/target/product/emulator_system.mk b/target/product/emulator_system.mk
new file mode 100644
index 0000000..4b6987c
--- /dev/null
+++ b/target/product/emulator_system.mk
@@ -0,0 +1,24 @@
+#
+# Copyright (C) 2019 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# This file lists emulator experimental modules added to PRODUCT_PACKAGES,
+# only included by targets sdk_phone_x86/64 and sdk_gphone_x86/64
+
+PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST := \
+ system/lib/libemulator_multidisplay_jni.so \
+ system/lib64/libemulator_multidisplay_jni.so \
+ system/priv-app/MultiDisplayProvider/MultiDisplayProvider.apk \
+
+PRODUCT_PACKAGES += MultiDisplayProvider
diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk
index cf0d5c7..c491d4a 100644
--- a/target/product/gsi/Android.mk
+++ b/target/product/gsi/Android.mk
@@ -156,10 +156,6 @@
ifneq ($(TARGET_SKIP_CURRENT_VNDK),true)
LOCAL_REQUIRED_MODULES += \
- llndk.libraries.txt \
- vndksp.libraries.txt \
- vndkcore.libraries.txt \
- vndkprivate.libraries.txt \
vndkcorevariant.libraries.txt \
$(addsuffix .vendor,$(VNDK_CORE_LIBRARIES)) \
$(addsuffix .vendor,$(VNDK_SAMEPROCESS_LIBRARIES)) \
@@ -169,25 +165,10 @@
include $(BUILD_PHONY_PACKAGE)
include $(CLEAR_VARS)
-LOCAL_MODULE := vndk_snapshot_package
-_binder32 :=
-ifneq ($(TARGET_USES_64_BIT_BINDER),true)
-ifneq ($(TARGET_IS_64_BIT),true)
-_binder32 := _binder32
-endif
-endif
_vndk_versions := $(PRODUCT_EXTRA_VNDK_VERSIONS)
ifneq ($(BOARD_VNDK_VERSION),current)
_vndk_versions += $(BOARD_VNDK_VERSION)
endif
-# Phony targets are installed for **.libraries.txt files.
-# TODO(b/141450808): remove following VNDK phony targets when **.libraries.txt files are provided by apexes.
-LOCAL_REQUIRED_MODULES := \
- $(foreach vndk_ver,$(_vndk_versions),vndk_v$(vndk_ver)_$(TARGET_ARCH)$(_binder32))
-_binder32 :=
-include $(BUILD_PHONY_PACKAGE)
-
-include $(CLEAR_VARS)
LOCAL_MODULE := vndk_apex_snapshot_package
LOCAL_REQUIRED_MODULES := $(foreach vndk_ver,$(_vndk_versions),com.android.vndk.v$(vndk_ver))
include $(BUILD_PHONY_PACKAGE)
diff --git a/target/product/mainline_arm64.mk b/target/product/mainline_arm64.mk
index 52b3222..850c775 100644
--- a/target/product/mainline_arm64.mk
+++ b/target/product/mainline_arm64.mk
@@ -29,7 +29,8 @@
PRODUCT_SHIPPING_API_LEVEL := 29
-PRODUCT_RESTRICT_VENDOR_FILES := all
+# TODO(b/137033385): change this back to "all"
+PRODUCT_RESTRICT_VENDOR_FILES := owner
PRODUCT_NAME := mainline_arm64
PRODUCT_DEVICE := mainline_arm64
diff --git a/target/product/mainline_system.mk b/target/product/mainline_system.mk
index ccbc907..a8b75e0 100644
--- a/target/product/mainline_system.mk
+++ b/target/product/mainline_system.mk
@@ -125,6 +125,9 @@
PRODUCT_ENFORCE_RRO_TARGETS := *
+# TODO(b/150820813) Settings depends on static overlay, remove this after eliminating the dependency.
+PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS := Settings
+
PRODUCT_NAME := mainline_system
PRODUCT_BRAND := generic
diff --git a/target/product/mainline_system_arm64.mk b/target/product/mainline_system_arm64.mk
index 772c687..60035c1 100644
--- a/target/product/mainline_system_arm64.mk
+++ b/target/product/mainline_system_arm64.mk
@@ -36,7 +36,8 @@
PRODUCT_SHIPPING_API_LEVEL := 29
-PRODUCT_RESTRICT_VENDOR_FILES := all
+# TODO(b/137033385): change this back to "all"
+PRODUCT_RESTRICT_VENDOR_FILES := owner
PRODUCT_NAME := mainline_system_arm64
PRODUCT_DEVICE := mainline_arm64
diff --git a/target/product/mainline_system_x86.mk b/target/product/mainline_system_x86.mk
index 05e51a9..a30a1fc 100644
--- a/target/product/mainline_system_x86.mk
+++ b/target/product/mainline_system_x86.mk
@@ -35,7 +35,8 @@
PRODUCT_SHIPPING_API_LEVEL := 29
-PRODUCT_RESTRICT_VENDOR_FILES := all
+# TODO(b/137033385): change this back to "all"
+PRODUCT_RESTRICT_VENDOR_FILES := owner
PRODUCT_NAME := mainline_system_x86
PRODUCT_DEVICE := mainline_x86
diff --git a/target/product/mainline_system_x86_arm.mk b/target/product/mainline_system_x86_arm.mk
index cc11c55..2e01cde 100644
--- a/target/product/mainline_system_x86_arm.mk
+++ b/target/product/mainline_system_x86_arm.mk
@@ -35,7 +35,8 @@
PRODUCT_SHIPPING_API_LEVEL := 29
-PRODUCT_RESTRICT_VENDOR_FILES := all
+# TODO(b/137033385): change this back to "all"
+PRODUCT_RESTRICT_VENDOR_FILES := owner
PRODUCT_NAME := mainline_system_x86_arm
PRODUCT_DEVICE := mainline_x86_arm
diff --git a/target/product/media_system.mk b/target/product/media_system.mk
index 5174ec3..a83e609 100644
--- a/target/product/media_system.mk
+++ b/target/product/media_system.mk
@@ -36,7 +36,6 @@
make_f2fs \
requestsync \
StatementService \
- vndk_snapshot_package \
PRODUCT_HOST_PACKAGES += \
fsck.f2fs \
@@ -51,10 +50,10 @@
# The order here is the same order they end up on the classpath, so it matters.
PRODUCT_SYSTEM_SERVER_JARS := \
+ com.android.location.provider \
services \
ethernet-service \
wifi-service \
- com.android.location.provider \
# system server jars which are updated via apex modules.
# The values should be of the format <apex name>:<jar name>
diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk
index b8cb2ff..5184016 100644
--- a/target/product/runtime_libart.mk
+++ b/target/product/runtime_libart.mk
@@ -16,10 +16,6 @@
# Provides a functioning ART environment without Android frameworks
-ifeq ($(TARGET_CORE_JARS),)
-$(error TARGET_CORE_JARS is empty; cannot update PRODUCT_PACKAGES variable)
-endif
-
# Additional mixins to the boot classpath.
PRODUCT_PACKAGES += \
android.test.base \
@@ -33,8 +29,7 @@
# ART APEX module.
# Note that this package includes the minimal boot classpath JARs (listed in
-# TARGET_CORE_JARS), which should no longer be added directly to
-# PRODUCT_PACKAGES.
+# ART_APEX_JARS), which should no longer be added directly to PRODUCT_PACKAGES.
PRODUCT_PACKAGES += com.android.art
PRODUCT_HOST_PACKAGES += com.android.art
diff --git a/target/product/sdk_phone_arm64.mk b/target/product/sdk_phone_arm64.mk
index ad72633..9024890 100644
--- a/target/product/sdk_phone_arm64.mk
+++ b/target/product/sdk_phone_arm64.mk
@@ -16,6 +16,7 @@
QEMU_USE_SYSTEM_EXT_PARTITIONS := true
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_arm64.mk)
+$(call inherit-product-if-exists, device/generic/goldfish/arm64-vendor.mk)
# Define the host tools and libs that are parts of the SDK.
$(call inherit-product, sdk/build/product_sdk.mk)
diff --git a/target/product/userspace_reboot.mk b/target/product/userspace_reboot.mk
index 76ec83d..3f881af 100644
--- a/target/product/userspace_reboot.mk
+++ b/target/product/userspace_reboot.mk
@@ -16,6 +16,4 @@
# Inherit this when the target supports userspace reboot
-PRODUCT_PROPERTY_OVERRIDES := ro.init.userspace_reboot.is_supported=true
-
-# TODO(b/135984674): configure userspace reboot related properties
+PRODUCT_PROPERTY_OVERRIDES := init.userspace_reboot.is_supported=true
diff --git a/tools/releasetools/Android.bp b/tools/releasetools/Android.bp
index 90a6485..d6f2116 100644
--- a/tools/releasetools/Android.bp
+++ b/tools/releasetools/Android.bp
@@ -188,6 +188,7 @@
"imgdiff",
"minigzip",
"mkbootfs",
+ "signapk",
],
}
@@ -237,6 +238,16 @@
embedded_launcher: false,
},
},
+ // TODO (b/140144201) Build imgdiff from releasetools_common
+ required: [
+ "aapt2",
+ "boot_signer",
+ "brotli",
+ "bsdiff",
+ "imgdiff",
+ "minigzip",
+ "mkbootfs",
+ ],
}
python_binary_host {
diff --git a/tools/releasetools/apex_utils.py b/tools/releasetools/apex_utils.py
index 4fac6f3..ae9b793 100644
--- a/tools/releasetools/apex_utils.py
+++ b/tools/releasetools/apex_utils.py
@@ -27,6 +27,8 @@
OPTIONS = common.OPTIONS
+APEX_PAYLOAD_IMAGE = 'apex_payload.img'
+
class ApexInfoError(Exception):
"""An Exception raised during Apex Information command."""
@@ -50,15 +52,11 @@
self.key_passwords = key_passwords
self.codename_to_api_level_map = codename_to_api_level_map
- def ProcessApexFile(self, apk_keys, payload_key, payload_public_key,
- signing_args=None):
+ def ProcessApexFile(self, apk_keys, payload_key, signing_args=None):
"""Scans and signs the apk files and repack the apex
Args:
apk_keys: A dict that holds the signing keys for apk files.
- payload_key: The path to the apex payload signing key.
- payload_public_key: The path to the public key corresponding to the
- payload signing key.
Returns:
The repacked apex file containing the signed apk files.
@@ -89,8 +87,7 @@
logger.info('No apk file has been signed in %s', self.apex_path)
return self.apex_path
- return self.RepackApexPayload(payload_dir, payload_key, payload_public_key,
- signing_args)
+ return self.RepackApexPayload(payload_dir, payload_key, signing_args)
def ExtractApexPayloadAndSignApks(self, apk_entries, apk_keys):
"""Extracts the payload image and signs the containing apk files."""
@@ -118,27 +115,15 @@
has_signed_apk = True
return payload_dir, has_signed_apk
- def RepackApexPayload(self, payload_dir, payload_key, payload_public_key,
- signing_args=None):
+ def RepackApexPayload(self, payload_dir, payload_key, signing_args=None):
"""Rebuilds the apex file with the updated payload directory."""
apex_dir = common.MakeTempDir()
# Extract the apex file and reuse its meta files as repack parameters.
common.UnzipToDir(self.apex_path, apex_dir)
-
- android_jar_path = common.OPTIONS.android_jar_path
- if not android_jar_path:
- android_jar_path = os.path.join(os.environ.get('ANDROID_BUILD_TOP', ''),
- 'prebuilts', 'sdk', 'current', 'public',
- 'android.jar')
- logger.warning('android_jar_path not found in options, falling back to'
- ' use %s', android_jar_path)
-
arguments_dict = {
'manifest': os.path.join(apex_dir, 'apex_manifest.pb'),
'build_info': os.path.join(apex_dir, 'apex_build_info.pb'),
- 'android_jar_path': android_jar_path,
'key': payload_key,
- 'pubkey': payload_public_key,
}
for filename in arguments_dict.values():
assert os.path.exists(filename), 'file {} not found'.format(filename)
@@ -151,29 +136,36 @@
elif os.path.isdir(path):
shutil.rmtree(path)
- repacked_apex = common.MakeTempFile(suffix='.apex')
- repack_cmd = ['apexer', '--force', '--include_build_info',
- '--do_not_check_keyname', '--apexer_tool_path',
- os.getenv('PATH')]
+ # TODO(xunchang) the signing process can be improved by using
+ # '--unsigned_payload_only'. But we need to parse the vbmeta earlier for
+ # the signing arguments, e.g. algorithm, salt, etc.
+ payload_img = os.path.join(apex_dir, APEX_PAYLOAD_IMAGE)
+ generate_image_cmd = ['apexer', '--force', '--payload_only',
+ '--do_not_check_keyname', '--apexer_tool_path',
+ os.getenv('PATH')]
for key, val in arguments_dict.items():
- repack_cmd.extend(['--' + key, val])
+ generate_image_cmd.extend(['--' + key, val])
+
# Add quote to the signing_args as we will pass
# --signing_args "--signing_helper_with_files=%path" to apexer
if signing_args:
- repack_cmd.extend(['--signing_args', '"{}"'.format(signing_args)])
+ generate_image_cmd.extend(['--signing_args', '"{}"'.format(signing_args)])
+
# optional arguments for apex repacking
manifest_json = os.path.join(apex_dir, 'apex_manifest.json')
if os.path.exists(manifest_json):
- repack_cmd.extend(['--manifest_json', manifest_json])
- assets_dir = os.path.join(apex_dir, 'assets')
- if os.path.isdir(assets_dir):
- repack_cmd.extend(['--assets_dir', assets_dir])
- repack_cmd.extend([payload_dir, repacked_apex])
+ generate_image_cmd.extend(['--manifest_json', manifest_json])
+ generate_image_cmd.extend([payload_dir, payload_img])
if OPTIONS.verbose:
- repack_cmd.append('-v')
- common.RunAndCheckOutput(repack_cmd)
+ generate_image_cmd.append('-v')
+ common.RunAndCheckOutput(generate_image_cmd)
- return repacked_apex
+ # Add the payload image back to the apex file.
+ common.ZipDelete(self.apex_path, APEX_PAYLOAD_IMAGE)
+ with zipfile.ZipFile(self.apex_path, 'a') as output_apex:
+ common.ZipWrite(output_apex, payload_img, APEX_PAYLOAD_IMAGE,
+ compress_type=zipfile.ZIP_STORED)
+ return self.apex_path
def SignApexPayload(avbtool, payload_file, payload_key_path, payload_key_name,
@@ -311,16 +303,13 @@
with open(apex_file, 'wb') as apex_fp:
apex_fp.write(apex_data)
- APEX_PAYLOAD_IMAGE = 'apex_payload.img'
APEX_PUBKEY = 'apex_pubkey'
# 1. Extract the apex payload image and sign the containing apk files. Repack
# the apex file after signing.
- payload_public_key = common.ExtractAvbPublicKey(avbtool, payload_key)
apk_signer = ApexApkSigner(apex_file, container_pw,
codename_to_api_level_map)
- apex_file = apk_signer.ProcessApexFile(apk_keys, payload_key,
- payload_public_key, signing_args)
+ apex_file = apk_signer.ProcessApexFile(apk_keys, payload_key, signing_args)
# 2a. Extract and sign the APEX_PAYLOAD_IMAGE entry with the given
# payload_key.
@@ -341,7 +330,7 @@
signing_args)
# 2b. Update the embedded payload public key.
-
+ payload_public_key = common.ExtractAvbPublicKey(avbtool, payload_key)
common.ZipDelete(apex_file, APEX_PAYLOAD_IMAGE)
if APEX_PUBKEY in zip_items:
common.ZipDelete(apex_file, APEX_PUBKEY)
diff --git a/tools/releasetools/check_target_files_vintf.py b/tools/releasetools/check_target_files_vintf.py
index f41df37..b3d491f 100755
--- a/tools/releasetools/check_target_files_vintf.py
+++ b/tools/releasetools/check_target_files_vintf.py
@@ -67,13 +67,18 @@
def GetArgsForSkus(info_dict):
- skus = info_dict.get('vintf_odm_manifest_skus', '').strip().split()
- if not skus:
- logger.info("ODM_MANIFEST_SKUS is not defined. Check once without SKUs.")
- skus = ['']
- return [['--property', 'ro.boot.product.hardware.sku=' + sku]
- for sku in skus]
+ odm_skus = info_dict.get('vintf_odm_manifest_skus', '').strip().split()
+ if info_dict.get('vintf_include_empty_odm_sku', '') == "true" or not odm_skus:
+ odm_skus += ['']
+ vendor_skus = info_dict.get('vintf_vendor_manifest_skus', '').strip().split()
+ if info_dict.get('vintf_include_empty_vendor_sku', '') == "true" or \
+ not vendor_skus:
+ vendor_skus += ['']
+
+ return [['--property', 'ro.boot.product.hardware.sku=' + odm_sku,
+ '--property', 'ro.boot.product.vendor.sku=' + vendor_sku]
+ for odm_sku in odm_skus for vendor_sku in vendor_skus]
def GetArgsForShippingApiLevel(info_dict):
shipping_api_level = info_dict['vendor.build.prop'].get(
@@ -89,7 +94,7 @@
config_path = os.path.join(input_tmp, 'META/kernel_configs.txt')
if not os.path.isfile(version_path) or not os.path.isfile(config_path):
- logger.info('Skipping kernel config checks because ' +
+ logger.info('Skipping kernel config checks because '
'PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS is not set')
return []
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 3276b29..9ea3ea8 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -77,6 +77,7 @@
self.boot_signer_args = []
self.verity_signer_path = None
self.verity_signer_args = []
+ self.aftl_tool_path = None
self.aftl_server = None
self.aftl_key_path = None
self.aftl_manufacturer_key_path = None
@@ -931,6 +932,39 @@
return "{}:{}:{}".format(partition, rollback_index_location, pubkey_path)
+def AddAftlInclusionProof(output_image):
+ """Appends the aftl inclusion proof to the vbmeta image."""
+
+ # Ensure the other AFTL parameters are set as well.
+ assert OPTIONS.aftl_tool_path is not None, 'No aftl tool provided.'
+ assert OPTIONS.aftl_key_path is not None, 'No AFTL key provided.'
+ assert OPTIONS.aftl_manufacturer_key_path is not None, \
+ 'No AFTL manufacturer key provided.'
+
+ vbmeta_image = MakeTempFile()
+ os.rename(output_image, vbmeta_image)
+ build_info = BuildInfo(OPTIONS.info_dict)
+ version_incremental = build_info.GetBuildProp("ro.build.version.incremental")
+ aftltool = OPTIONS.aftl_tool_path
+ aftl_cmd = [aftltool, "make_icp_from_vbmeta",
+ "--vbmeta_image_path", vbmeta_image,
+ "--output", output_image,
+ "--version_incremental", version_incremental,
+ "--transparency_log_servers", OPTIONS.aftl_server,
+ "--transparency_log_pub_keys", OPTIONS.aftl_key_path,
+ "--manufacturer_key", OPTIONS.aftl_manufacturer_key_path,
+ "--algorithm", "SHA256_RSA4096",
+ "--padding", "4096"]
+ if OPTIONS.aftl_signer_helper:
+ aftl_cmd.extend(shlex.split(OPTIONS.aftl_signer_helper))
+ RunAndCheckOutput(aftl_cmd)
+
+ verify_cmd = ['aftltool', 'verify_image_icp', '--vbmeta_image_path',
+ output_image, '--transparency_log_pub_keys',
+ OPTIONS.aftl_key_path]
+ RunAndCheckOutput(verify_cmd)
+
+
def BuildVBMeta(image_path, partitions, name, needed_partitions):
"""Creates a VBMeta image.
@@ -973,28 +1007,26 @@
# zip only). For such cases, we additionally scan other locations (e.g.
# IMAGES/, RADIO/, etc) before bailing out.
if arg == '--include_descriptors_from_image':
- image_path = split_args[index + 1]
- if os.path.exists(image_path):
+ chained_image = split_args[index + 1]
+ if os.path.exists(chained_image):
continue
found = False
for dir_name in ['IMAGES', 'RADIO', 'PREBUILT_IMAGES']:
alt_path = os.path.join(
- OPTIONS.input_tmp, dir_name, os.path.basename(image_path))
+ OPTIONS.input_tmp, dir_name, os.path.basename(chained_image))
if os.path.exists(alt_path):
split_args[index + 1] = alt_path
found = True
break
- assert found, 'Failed to find {}'.format(image_path)
+ assert found, 'Failed to find {}'.format(chained_image)
cmd.extend(split_args)
RunAndCheckOutput(cmd)
+ # Generate the AFTL inclusion proof.
if OPTIONS.aftl_server is not None:
- # Ensure the other AFTL parameters are set as well.
- assert OPTIONS.aftl_key_path is not None, 'No AFTL key provided.'
- assert OPTIONS.aftl_manufacturer_key_path is not None, 'No AFTL manufacturer key provided.'
- assert OPTIONS.aftl_signer_helper is not None, 'No AFTL signer helper provided.'
- # AFTL inclusion proof generation code will go here.
+ AddAftlInclusionProof(image_path)
+
def _MakeRamdisk(sourcedir, fs_config_file=None):
ramdisk_img = tempfile.NamedTemporaryFile()
@@ -1754,7 +1786,8 @@
continue
m = re.match(
r'^name="(?P<NAME>.*)"\s+certificate="(?P<CERT>.*)"\s+'
- r'private_key="(?P<PRIVKEY>.*?)"(\s+compressed="(?P<COMPRESSED>.*)")?$',
+ r'private_key="(?P<PRIVKEY>.*?)"(\s+compressed="(?P<COMPRESSED>.*)")?'
+ r'(\s+partition="(?P<PARTITION>.*)")?$',
line)
if not m:
continue
@@ -1846,9 +1879,9 @@
"java_path=", "java_args=", "android_jar_path=", "public_key_suffix=",
"private_key_suffix=", "boot_signer_path=", "boot_signer_args=",
"verity_signer_path=", "verity_signer_args=", "device_specific=",
- "extra=", "logfile=", "aftl_server=", "aftl_key_path=",
- "aftl_manufacturer_key_path=", "aftl_signer_helper="] +
- list(extra_long_opts))
+ "extra=", "logfile=", "aftl_tool_path=", "aftl_server=",
+ "aftl_key_path=", "aftl_manufacturer_key_path=",
+ "aftl_signer_helper="] + list(extra_long_opts))
except getopt.GetoptError as err:
Usage(docstring)
print("**", str(err), "**")
@@ -1886,6 +1919,8 @@
OPTIONS.verity_signer_path = a
elif o in ("--verity_signer_args",):
OPTIONS.verity_signer_args = shlex.split(a)
+ elif o in ("--aftl_tool_path",):
+ OPTIONS.aftl_tool_path = a
elif o in ("--aftl_server",):
OPTIONS.aftl_server = a
elif o in ("--aftl_key_path",):
diff --git a/tools/releasetools/merge_target_files.py b/tools/releasetools/merge_target_files.py
index eb68bc3..8e97509 100755
--- a/tools/releasetools/merge_target_files.py
+++ b/tools/releasetools/merge_target_files.py
@@ -79,6 +79,7 @@
import fnmatch
import logging
import os
+import re
import shutil
import subprocess
import sys
@@ -109,6 +110,27 @@
OPTIONS.rebuild_recovery = False
OPTIONS.keep_tmp = False
+# In an item list (framework or vendor), we may see entries that select whole
+# partitions. Such an entry might look like this 'SYSTEM/*' (e.g., for the
+# system partition). The following regex matches this and extracts the
+# partition name.
+
+PARTITION_ITEM_PATTERN = re.compile(r'^([A-Z_]+)/\*$')
+
+# In apexkeys.txt or apkcerts.txt, we may find partition tags on the various
+# entries in the file. We use these partition tags to filter the entries in
+# those files from the two different target files packages to produce a merged
+# apexkeys.txt or apkcerts.txt file. A partition tag (e.g., for the product
+# partition) looks like this: 'partition="_PRODUCT"' or 'partition="product".
+# We use the group syntax grab the value of the tag.
+
+PARTITION_TAG_PATTERN = re.compile(r'partition="(.*)"')
+
+# The sorting algorithm for apexkeys.txt and apkcerts.txt does not include the
+# ".apex" or ".apk" suffix, so we use the following pattern to extract a key.
+
+MODULE_KEY_PATTERN = re.compile(r'name="(.+)\.(apex|apk)"')
+
# DEFAULT_FRAMEWORK_ITEM_LIST is a list of items to extract from the partial
# framework target files package as is, meaning these items will land in the
# output target files package exactly as they appear in the input partial
@@ -484,9 +506,40 @@
path=output_dynamic_partitions_info_txt)
+def item_list_to_partition_set(item_list):
+ """Converts a target files item list to a partition set.
+
+ The item list contains items that might look like 'SYSTEM/*' or 'VENDOR/*' or
+ 'OTA/android-info.txt'. Items that end in '/*' are assumed to match entire
+ directories where 'SYSTEM' or 'VENDOR' is a directory name that identifies the
+ contents of a partition of the same name. Other items in the list, such as the
+ 'OTA' example contain metadata. This function iterates such a list, returning
+ a set that contains the partition entries.
+
+ Args:
+ item_list: A list of items in a target files package.
+ Returns:
+ A set of partitions extracted from the list of items.
+ """
+
+ partition_set = set()
+
+ for item in item_list:
+ match = PARTITION_ITEM_PATTERN.search(item.strip())
+ partition_tag = match.group(1).lower() if match else None
+
+ if partition_tag:
+ partition_set.add(partition_tag)
+
+ return partition_set
+
+
def process_apex_keys_apk_certs_common(framework_target_files_dir,
vendor_target_files_dir,
- output_target_files_dir, file_name):
+ output_target_files_dir,
+ framework_partition_set,
+ vendor_partition_set, file_name):
+
"""Performs special processing for META/apexkeys.txt or META/apkcerts.txt.
This function merges the contents of the META/apexkeys.txt or
@@ -502,6 +555,10 @@
items extracted from the vendor target files package.
output_target_files_dir: The name of a directory that will be used to create
the output target files package after all the special cases are processed.
+ framework_partition_set: Partitions that are considered framework
+ partitions. Used to filter apexkeys.txt and apkcerts.txt.
+ vendor_partition_set: Partitions that are considered vendor partitions. Used
+ to filter apexkeys.txt and apkcerts.txt.
file_name: The name of the file to merge. One of apkcerts.txt or
apexkeys.txt.
"""
@@ -512,21 +569,44 @@
with open(file_path) as f:
for line in f:
if line.strip():
- temp[line.split()[0]] = line.strip()
+ name = line.split()[0]
+ match = MODULE_KEY_PATTERN.search(name)
+ temp[match.group(1)] = line.strip()
return temp
framework_dict = read_helper(framework_target_files_dir)
vendor_dict = read_helper(vendor_target_files_dir)
+ merged_dict = {}
- for key in framework_dict:
- if key in vendor_dict and vendor_dict[key] != framework_dict[key]:
- raise ValueError('Conflicting entries found in %s:\n %s and\n %s' %
- (file_name, framework_dict[key], vendor_dict[key]))
- vendor_dict[key] = framework_dict[key]
+ def filter_into_merged_dict(item_dict, partition_set):
+ for key, value in item_dict.items():
+ match = PARTITION_TAG_PATTERN.search(value)
+
+ if match is None:
+ raise ValueError('Entry missing partition tag: %s' % value)
+
+ partition_tag = match.group(1)
+
+ if partition_tag in partition_set:
+ if key in merged_dict:
+ raise ValueError('Duplicate key %s' % key)
+
+ merged_dict[key] = value
+
+ filter_into_merged_dict(framework_dict, framework_partition_set)
+ filter_into_merged_dict(vendor_dict, vendor_partition_set)
output_file = os.path.join(output_target_files_dir, 'META', file_name)
- write_sorted_data(data=vendor_dict.values(), path=output_file)
+ # The following code is similar to write_sorted_data, but different enough
+ # that we couldn't use that function. We need the output to be sorted by the
+ # basename of the apex/apk (without the ".apex" or ".apk" suffix). This
+ # allows the sort to be consistent with the framework/vendor input data and
+ # eases comparison of input data with merged data.
+ with open(output_file, 'w') as output:
+ for key in sorted(merged_dict.keys()):
+ out_str = merged_dict[key] + '\n'
+ output.write(out_str)
def copy_file_contexts(framework_target_files_dir, vendor_target_files_dir,
@@ -559,7 +639,9 @@
def process_special_cases(framework_target_files_temp_dir,
vendor_target_files_temp_dir,
output_target_files_temp_dir,
- framework_misc_info_keys):
+ framework_misc_info_keys,
+ framework_partition_set,
+ vendor_partition_set):
"""Performs special-case processing for certain target files items.
Certain files in the output target files package require special-case
@@ -576,6 +658,10 @@
framework_misc_info_keys: A list of keys to obtain from the framework
instance of META/misc_info.txt. The remaining keys from the vendor
instance.
+ framework_partition_set: Partitions that are considered framework
+ partitions. Used to filter apexkeys.txt and apkcerts.txt.
+ vendor_partition_set: Partitions that are considered vendor partitions. Used
+ to filter apexkeys.txt and apkcerts.txt.
"""
if 'ab_update' in framework_misc_info_keys:
@@ -604,12 +690,16 @@
framework_target_files_dir=framework_target_files_temp_dir,
vendor_target_files_dir=vendor_target_files_temp_dir,
output_target_files_dir=output_target_files_temp_dir,
+ framework_partition_set=framework_partition_set,
+ vendor_partition_set=vendor_partition_set,
file_name='apkcerts.txt')
process_apex_keys_apk_certs_common(
framework_target_files_dir=framework_target_files_temp_dir,
vendor_target_files_dir=vendor_target_files_temp_dir,
output_target_files_dir=output_target_files_temp_dir,
+ framework_partition_set=framework_partition_set,
+ vendor_partition_set=vendor_partition_set,
file_name='apexkeys.txt')
@@ -716,7 +806,9 @@
framework_target_files_temp_dir=framework_target_files_temp_dir,
vendor_target_files_temp_dir=vendor_target_files_temp_dir,
output_target_files_temp_dir=output_target_files_temp_dir,
- framework_misc_info_keys=framework_misc_info_keys)
+ framework_misc_info_keys=framework_misc_info_keys,
+ framework_partition_set=item_list_to_partition_set(framework_item_list),
+ vendor_partition_set=item_list_to_partition_set(vendor_item_list))
return output_target_files_temp_dir
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index 7a0d994..92a46a2 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -318,7 +318,7 @@
common.RunAndCheckOutput(cmd)
with open(out_signature_size_file) as f:
signature_size = f.read().rstrip()
- logger.info("% outputs the maximum signature size: %", cmd[0],
+ logger.info("%s outputs the maximum signature size: %s", cmd[0],
signature_size)
return int(signature_size)
@@ -631,7 +631,7 @@
partition_target_info = target_info["fstab"]["/" + name]
disable_imgdiff = (partition_source_info.fs_type == "squashfs" or
partition_target_info.fs_type == "squashfs")
- return common.BlockDifference(name, partition_src, partition_tgt,
+ return common.BlockDifference(name, partition_tgt, partition_src,
check_first_block,
version=blockimgdiff_version,
disable_imgdiff=disable_imgdiff)
diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py
index 5b7c2ac..783d63c 100755
--- a/tools/releasetools/sign_target_files_apks.py
+++ b/tools/releasetools/sign_target_files_apks.py
@@ -1082,7 +1082,8 @@
r'public_key="(?P<PAYLOAD_PUBLIC_KEY>.*)"\s+'
r'private_key="(?P<PAYLOAD_PRIVATE_KEY>.*)"\s+'
r'container_certificate="(?P<CONTAINER_CERT>.*)"\s+'
- r'container_private_key="(?P<CONTAINER_PRIVATE_KEY>.*)"$',
+ r'container_private_key="(?P<CONTAINER_PRIVATE_KEY>.*)"\s+'
+ r'partition="(?P<PARTITION>.*)"$',
line)
if not matches:
continue
diff --git a/tools/releasetools/test_apex_utils.py b/tools/releasetools/test_apex_utils.py
index 07284ad..e19bc90 100644
--- a/tools/releasetools/test_apex_utils.py
+++ b/tools/releasetools/test_apex_utils.py
@@ -14,8 +14,10 @@
# limitations under the License.
#
+import re
import os
import os.path
+import shutil
import zipfile
import apex_utils
@@ -32,6 +34,7 @@
self.testdata_dir = test_utils.get_testdata_dir()
# The default payload signing key.
self.payload_key = os.path.join(self.testdata_dir, 'testkey.key')
+ self.apex_with_apk = os.path.join(self.testdata_dir, 'has_apk.apex')
common.OPTIONS.search_path = test_utils.get_search_path()
@@ -134,35 +137,43 @@
def test_ApexApkSigner_noApkPresent(self):
apex_path = os.path.join(self.testdata_dir, 'foo.apex')
signer = apex_utils.ApexApkSigner(apex_path, None, None)
- processed_apex = signer.ProcessApexFile({}, self.payload_key,
- None)
+ processed_apex = signer.ProcessApexFile({}, self.payload_key)
self.assertEqual(apex_path, processed_apex)
@test_utils.SkipIfExternalToolsUnavailable()
def test_ApexApkSigner_apkKeyNotPresent(self):
- apex_path = os.path.join(self.testdata_dir, 'has_apk.apex')
+ apex_path = common.MakeTempFile(suffix='.apex')
+ shutil.copy(self.apex_with_apk, apex_path)
signer = apex_utils.ApexApkSigner(apex_path, None, None)
- self.assertRaises(apex_utils.ApexSigningError, signer.ProcessApexFile, {},
- self.payload_key, None)
+ self.assertRaises(apex_utils.ApexSigningError, signer.ProcessApexFile,
+ {}, self.payload_key)
@test_utils.SkipIfExternalToolsUnavailable()
def test_ApexApkSigner_signApk(self):
- apex_path = os.path.join(self.testdata_dir, 'has_apk.apex')
+ apex_path = common.MakeTempFile(suffix='.apex')
+ shutil.copy(self.apex_with_apk, apex_path)
signer = apex_utils.ApexApkSigner(apex_path, None, None)
apk_keys = {'wifi-service-resources.apk': os.path.join(
self.testdata_dir, 'testkey')}
self.payload_key = os.path.join(self.testdata_dir, 'testkey_RSA4096.key')
- payload_pubkey = common.ExtractAvbPublicKey('avbtool',
- self.payload_key)
- signer.ProcessApexFile(apk_keys, self.payload_key, payload_pubkey)
+ apex_file = signer.ProcessApexFile(apk_keys, self.payload_key)
+ package_name_extract_cmd = ['aapt', 'dump', 'badging', apex_file]
+ output = common.RunAndCheckOutput(package_name_extract_cmd)
+ for line in output.splitlines():
+ # Sample output from aapt: "package: name='com.google.android.wifi'
+ # versionCode='1' versionName='' platformBuildVersionName='R'
+ # compileSdkVersion='29' compileSdkVersionCodename='R'"
+ match = re.search(r"^package:.* name='([\w|\.]+)'", line, re.IGNORECASE)
+ if match:
+ package_name = match.group(1)
+ self.assertEquals('com.google.android.wifi', package_name)
@test_utils.SkipIfExternalToolsUnavailable()
def test_ApexApkSigner_noAssetDir(self):
- apex_path = os.path.join(self.testdata_dir, 'has_apk.apex')
no_asset = common.MakeTempFile(suffix='.apex')
with zipfile.ZipFile(no_asset, 'w') as output_zip:
- with zipfile.ZipFile(apex_path, 'r') as input_zip:
+ with zipfile.ZipFile(self.apex_with_apk, 'r') as input_zip:
name_list = input_zip.namelist()
for name in name_list:
if not name.startswith('assets'):
@@ -173,23 +184,4 @@
self.testdata_dir, 'testkey')}
self.payload_key = os.path.join(self.testdata_dir, 'testkey_RSA4096.key')
- payload_pubkey = common.ExtractAvbPublicKey('avbtool',
- self.payload_key)
- signer.ProcessApexFile(apk_keys, self.payload_key, payload_pubkey)
-
- @test_utils.SkipIfExternalToolsUnavailable()
- def test_ApexApkSigner_withSignerHelper(self):
- apex_path = os.path.join(self.testdata_dir, 'has_apk.apex')
- signer = apex_utils.ApexApkSigner(apex_path, None, None)
- apk_keys = {'wifi-service-resources.apk': os.path.join(
- self.testdata_dir, 'testkey')}
-
- self.payload_key = os.path.join(self.testdata_dir, 'testkey_RSA4096.key')
- payload_pubkey = common.ExtractAvbPublicKey('avbtool', self.payload_key)
-
- signing_helper = os.path.join(self.testdata_dir, 'signing_helper.sh')
- os.chmod(signing_helper, 0o700)
- payload_signer_args = '--signing_helper_with_files={}'.format(
- signing_helper)
- signer.ProcessApexFile(apk_keys, self.payload_key, payload_pubkey,
- payload_signer_args)
+ signer.ProcessApexFile(apk_keys, self.payload_key)
diff --git a/tools/releasetools/test_common.py b/tools/releasetools/test_common.py
index da92163..9195e49 100644
--- a/tools/releasetools/test_common.py
+++ b/tools/releasetools/test_common.py
@@ -1404,6 +1404,47 @@
self.assertEqual('3', chained_partition_args[1])
self.assertTrue(os.path.exists(chained_partition_args[2]))
+ @test_utils.SkipIfExternalToolsUnavailable()
+ def test_BuildVBMeta_appendAftl(self):
+ testdata_dir = test_utils.get_testdata_dir()
+ common.OPTIONS.info_dict = {
+ 'ab_update': 'true',
+ 'avb_avbtool': 'avbtool',
+ 'build.prop': {
+ 'ro.build.version.incremental': '6285659',
+ 'ro.product.device': 'coral',
+ 'ro.build.fingerprint': 'google/coral/coral:R/RP1A.200311.002/'
+ '6285659:userdebug/dev-keys'
+ }
+ }
+ common.OPTIONS.aftl_tool_path = "aftltool"
+ common.OPTIONS.aftl_server = "log.endpoints.aftl-dev.cloud.goog:9000"
+ common.OPTIONS.aftl_key_path = os.path.join(testdata_dir,
+ 'test_transparency_key.pub')
+ common.OPTIONS.aftl_manufacturer_key_path = os.path.join(
+ testdata_dir, 'test_aftl_rsa4096.pem')
+
+ input_dir = common.MakeTempDir()
+ system_image = common.MakeTempFile()
+ build_image_cmd = ['mkuserimg_mke2fs', input_dir, system_image, 'ext4',
+ '/system', str(4096 * 100), '-j', '0', '-s']
+ common.RunAndCheckOutput(build_image_cmd)
+
+ add_footer_cmd = ['avbtool', 'add_hashtree_footer',
+ '--partition_size', str(4096 * 150),
+ '--partition_name', 'system',
+ '--image', system_image]
+ common.RunAndCheckOutput(add_footer_cmd)
+
+ vbmeta_image = common.MakeTempFile()
+ common.BuildVBMeta(vbmeta_image, {'system': system_image}, 'vbmeta',
+ ['system'])
+
+ verify_cmd = ['aftltool', 'verify_image_icp', '--vbmeta_image_path',
+ vbmeta_image, '--transparency_log_pub_keys',
+ common.OPTIONS.aftl_key_path]
+ common.RunAndCheckOutput(verify_cmd)
+
class InstallRecoveryScriptFormatTest(test_utils.ReleaseToolsTestCase):
"""Checks the format of install-recovery.sh.
diff --git a/tools/releasetools/test_merge_target_files.py b/tools/releasetools/test_merge_target_files.py
index 1abe83c..ff8593b 100644
--- a/tools/releasetools/test_merge_target_files.py
+++ b/tools/releasetools/test_merge_target_files.py
@@ -22,6 +22,7 @@
DEFAULT_FRAMEWORK_ITEM_LIST,
DEFAULT_VENDOR_ITEM_LIST,
DEFAULT_FRAMEWORK_MISC_INFO_KEYS, copy_items,
+ item_list_to_partition_set,
process_apex_keys_apk_certs_common)
@@ -142,6 +143,8 @@
os.path.join(vendor_dir, 'META', 'apexkeys.txt'))
process_apex_keys_apk_certs_common(framework_dir, vendor_dir, output_dir,
+ set(['product', 'system', 'system_ext']),
+ set(['odm', 'vendor']),
'apexkeys.txt')
merged_entries = []
@@ -175,4 +178,54 @@
os.path.join(conflict_dir, 'META', 'apexkeys.txt'))
self.assertRaises(ValueError, process_apex_keys_apk_certs_common,
- framework_dir, conflict_dir, output_dir, 'apexkeys.txt')
+ framework_dir, conflict_dir, output_dir,
+ set(['product', 'system', 'system_ext']),
+ set(['odm', 'vendor']),
+ 'apexkeys.txt')
+
+ def test_process_apex_keys_apk_certs_HandlesApkCertsSyntax(self):
+ output_dir = common.MakeTempDir()
+ os.makedirs(os.path.join(output_dir, 'META'))
+
+ framework_dir = common.MakeTempDir()
+ os.makedirs(os.path.join(framework_dir, 'META'))
+ os.symlink(
+ os.path.join(self.testdata_dir, 'apkcerts_framework.txt'),
+ os.path.join(framework_dir, 'META', 'apkcerts.txt'))
+
+ vendor_dir = common.MakeTempDir()
+ os.makedirs(os.path.join(vendor_dir, 'META'))
+ os.symlink(
+ os.path.join(self.testdata_dir, 'apkcerts_vendor.txt'),
+ os.path.join(vendor_dir, 'META', 'apkcerts.txt'))
+
+ process_apex_keys_apk_certs_common(framework_dir, vendor_dir, output_dir,
+ set(['product', 'system', 'system_ext']),
+ set(['odm', 'vendor']),
+ 'apkcerts.txt')
+
+ merged_entries = []
+ merged_path = os.path.join(self.testdata_dir, 'apkcerts_merge.txt')
+
+ with open(merged_path) as f:
+ merged_entries = f.read().split('\n')
+
+ output_entries = []
+ output_path = os.path.join(output_dir, 'META', 'apkcerts.txt')
+
+ with open(output_path) as f:
+ output_entries = f.read().split('\n')
+
+ return self.assertEqual(merged_entries, output_entries)
+
+ def test_item_list_to_partition_set(self):
+ item_list = [
+ 'META/apexkeys.txt',
+ 'META/apkcerts.txt',
+ 'META/filesystem_config.txt',
+ 'PRODUCT/*',
+ 'SYSTEM/*',
+ 'SYSTEM_EXT/*',
+ ]
+ partition_set = item_list_to_partition_set(item_list)
+ self.assertEqual(set(['product', 'system', 'system_ext']), partition_set)
diff --git a/tools/releasetools/test_sign_target_files_apks.py b/tools/releasetools/test_sign_target_files_apks.py
index 2b84413..2dacd50 100644
--- a/tools/releasetools/test_sign_target_files_apks.py
+++ b/tools/releasetools/test_sign_target_files_apks.py
@@ -36,8 +36,8 @@
</policy>"""
# pylint: disable=line-too-long
- APEX_KEYS_TXT = """name="apex.apexd_test.apex" public_key="system/apex/apexd/apexd_testdata/com.android.apex.test_package.avbpubkey" private_key="system/apex/apexd/apexd_testdata/com.android.apex.test_package.pem" container_certificate="build/make/target/product/security/testkey.x509.pem" container_private_key="build/make/target/product/security/testkey.pk8"
-name="apex.apexd_test_different_app.apex" public_key="system/apex/apexd/apexd_testdata/com.android.apex.test_package_2.avbpubkey" private_key="system/apex/apexd/apexd_testdata/com.android.apex.test_package_2.pem" container_certificate="build/make/target/product/security/testkey.x509.pem" container_private_key="build/make/target/product/security/testkey.pk8"
+ APEX_KEYS_TXT = """name="apex.apexd_test.apex" public_key="system/apex/apexd/apexd_testdata/com.android.apex.test_package.avbpubkey" private_key="system/apex/apexd/apexd_testdata/com.android.apex.test_package.pem" container_certificate="build/make/target/product/security/testkey.x509.pem" container_private_key="build/make/target/product/security/testkey.pk8" partition="system"
+name="apex.apexd_test_different_app.apex" public_key="system/apex/apexd/apexd_testdata/com.android.apex.test_package_2.avbpubkey" private_key="system/apex/apexd/apexd_testdata/com.android.apex.test_package_2.pem" container_certificate="build/make/target/product/security/testkey.x509.pem" container_private_key="build/make/target/product/security/testkey.pk8" partition="system"
"""
def setUp(self):
@@ -484,7 +484,8 @@
'public_key="system/apex/apexd/apexd_testdata/com.android.apex.test_package_2.avbpubkey" '
'private_key="system/apex/apexd/apexd_testdata/com.android.apex.test_package_2.pem" '
'container_certificate="build/make/target/product/security/testkey.x509.pem" '
- 'container_private_key="build/make/target/product/security/testkey2.pk8"')
+ 'container_private_key="build/make/target/product/security/testkey2.pk8" '
+ 'partition="system"')
target_files = common.MakeTempFile(suffix='.zip')
with zipfile.ZipFile(target_files, 'w') as target_files_zip:
target_files_zip.writestr('META/apexkeys.txt', apex_keys)
diff --git a/tools/releasetools/testdata/apexkeys_framework.txt b/tools/releasetools/testdata/apexkeys_framework.txt
index 2346668..b9caf9e 100644
--- a/tools/releasetools/testdata/apexkeys_framework.txt
+++ b/tools/releasetools/testdata/apexkeys_framework.txt
@@ -1,2 +1,7 @@
-name="com.android.runtime.debug.apex" public_key="art/build/apex/com.android.runtime.avbpubkey" private_key="art/build/apex/com.android.runtime.pem" container_certificate="art/build/apex/com.android.runtime.debug.x509.pem" container_private_key="art/build/apex/com.android.runtime.debug.pk8"
-name="com.android.conscrypt.apex" public_key="external/conscrypt/apex/com.android.conscrypt.avbpubkey" private_key="external/conscrypt/apex/com.android.conscrypt.pem" container_certificate="external/conscrypt/apex/com.android.conscrypt.x509.pem" container_private_key="external/conscrypt/apex/com.android.conscrypt.pk8"
+name="com.android.conscrypt.apex" public_key="external/conscrypt/apex/com.android.conscrypt.avbpubkey" private_key="external/conscrypt/apex/com.android.conscrypt.pem" container_certificate="external/conscrypt/apex/com.android.conscrypt.x509.pem" container_private_key="external/conscrypt/apex/com.android.conscrypt.pk8" partition="system"
+name="com.android.dummy_product.apex" public_key="selected" private_key="selected" container_certificate="selected" container_private_key="selected" partition="product"
+name="com.android.runtime.apex" public_key="bionic/apex/com.android.runtime.avbpubkey" private_key="bionic/apex/com.android.runtime.pem" container_certificate="bionic/apex/com.android.runtime.x509.pem" container_private_key="bionic/apex/com.android.runtime.pk8" partition="system"
+name="com.android.vndk.current.on_vendor.apex" public_key="not_selected" private_key="not_selected" container_certificate="not_selected" container_private_key="not_selected" partition="vendor"
+name="com.android.vndk.v27.apex" public_key="packages/modules/vndk/apex/com.android.vndk.v27.pubkey" private_key="packages/modules/vndk/apex/com.android.vndk.v27.pem" container_certificate="packages/modules/vndk/apex/com.android.vndk.v27.x509.pem" container_private_key="packages/modules/vndk/apex/com.android.vndk.v27.pk8" partition="system_ext"
+name="com.android.vndk.v28.apex" public_key="packages/modules/vndk/apex/com.android.vndk.v28.pubkey" private_key="packages/modules/vndk/apex/com.android.vndk.v28.pem" container_certificate="packages/modules/vndk/apex/com.android.vndk.v28.x509.pem" container_private_key="packages/modules/vndk/apex/com.android.vndk.v28.pk8" partition="system_ext"
+name="com.android.vndk.v29.apex" public_key="packages/modules/vndk/apex/com.android.vndk.v29.pubkey" private_key="packages/modules/vndk/apex/com.android.vndk.v29.pem" container_certificate="packages/modules/vndk/apex/com.android.vndk.v29.x509.pem" container_private_key="packages/modules/vndk/apex/com.android.vndk.v29.pk8" partition="system_ext"
diff --git a/tools/releasetools/testdata/apexkeys_framework_conflict.txt b/tools/releasetools/testdata/apexkeys_framework_conflict.txt
index caa21c2..9a055f4 100644
--- a/tools/releasetools/testdata/apexkeys_framework_conflict.txt
+++ b/tools/releasetools/testdata/apexkeys_framework_conflict.txt
@@ -1 +1 @@
-name="com.android.runtime.debug.apex" public_key="art/build/apex/com.android.runtime.avbpubkey" private_key="art/build/apex/com.android.runtime.pem" container_certificate="art/build/apex/com.android.runtime.release.x509.pem" container_private_key="art/build/apex/com.android.runtime.debug.pk8"
+name="com.android.conscrypt.apex" public_key="external/conscrypt/apex/com.android.conscrypt.avbpubkey" private_key="external/conscrypt/apex/com.android.conscrypt.pem" container_certificate="external/conscrypt/apex/com.android.conscrypt.x509.pem" container_private_key="external/conscrypt/apex/com.android.conscrypt.pk8" partition="vendor"
diff --git a/tools/releasetools/testdata/apexkeys_merge.txt b/tools/releasetools/testdata/apexkeys_merge.txt
index 48e789f..a9355d7 100644
--- a/tools/releasetools/testdata/apexkeys_merge.txt
+++ b/tools/releasetools/testdata/apexkeys_merge.txt
@@ -1,4 +1,7 @@
-name="com.android.conscrypt.apex" public_key="external/conscrypt/apex/com.android.conscrypt.avbpubkey" private_key="external/conscrypt/apex/com.android.conscrypt.pem" container_certificate="external/conscrypt/apex/com.android.conscrypt.x509.pem" container_private_key="external/conscrypt/apex/com.android.conscrypt.pk8"
-name="com.android.runtime.debug.apex" public_key="art/build/apex/com.android.runtime.avbpubkey" private_key="art/build/apex/com.android.runtime.pem" container_certificate="art/build/apex/com.android.runtime.debug.x509.pem" container_private_key="art/build/apex/com.android.runtime.debug.pk8"
-name="com.android.runtime.release.apex" public_key="art/build/apex/com.android.runtime.avbpubkey" private_key="art/build/apex/com.android.runtime.pem" container_certificate="art/build/apex/com.android.runtime.release.x509.pem" container_private_key="art/build/apex/com.android.runtime.release.pk8"
-name="com.android.support.apexer.apex" public_key="system/apex/apexer/etc/com.android.support.apexer.avbpubkey" private_key="system/apex/apexer/etc/com.android.support.apexer.pem" container_certificate="build/target/product/security/testkey.x509.pem" container_private_key="build/target/product/security/testkey.pk8"
+name="com.android.conscrypt.apex" public_key="external/conscrypt/apex/com.android.conscrypt.avbpubkey" private_key="external/conscrypt/apex/com.android.conscrypt.pem" container_certificate="external/conscrypt/apex/com.android.conscrypt.x509.pem" container_private_key="external/conscrypt/apex/com.android.conscrypt.pk8" partition="system"
+name="com.android.dummy_product.apex" public_key="selected" private_key="selected" container_certificate="selected" container_private_key="selected" partition="product"
+name="com.android.runtime.apex" public_key="bionic/apex/com.android.runtime.avbpubkey" private_key="bionic/apex/com.android.runtime.pem" container_certificate="bionic/apex/com.android.runtime.x509.pem" container_private_key="bionic/apex/com.android.runtime.pk8" partition="system"
+name="com.android.vndk.current.on_vendor.apex" public_key="packages/modules/vndk/apex/com.android.vndk.current.pubkey" private_key="packages/modules/vndk/apex/com.android.vndk.current.pem" container_certificate="packages/modules/vndk/apex/com.android.vndk.current.x509.pem" container_private_key="packages/modules/vndk/apex/com.android.vndk.current.pk8" partition="vendor"
+name="com.android.vndk.v27.apex" public_key="packages/modules/vndk/apex/com.android.vndk.v27.pubkey" private_key="packages/modules/vndk/apex/com.android.vndk.v27.pem" container_certificate="packages/modules/vndk/apex/com.android.vndk.v27.x509.pem" container_private_key="packages/modules/vndk/apex/com.android.vndk.v27.pk8" partition="system_ext"
+name="com.android.vndk.v28.apex" public_key="packages/modules/vndk/apex/com.android.vndk.v28.pubkey" private_key="packages/modules/vndk/apex/com.android.vndk.v28.pem" container_certificate="packages/modules/vndk/apex/com.android.vndk.v28.x509.pem" container_private_key="packages/modules/vndk/apex/com.android.vndk.v28.pk8" partition="system_ext"
+name="com.android.vndk.v29.apex" public_key="packages/modules/vndk/apex/com.android.vndk.v29.pubkey" private_key="packages/modules/vndk/apex/com.android.vndk.v29.pem" container_certificate="packages/modules/vndk/apex/com.android.vndk.v29.x509.pem" container_private_key="packages/modules/vndk/apex/com.android.vndk.v29.pk8" partition="system_ext"
diff --git a/tools/releasetools/testdata/apexkeys_vendor.txt b/tools/releasetools/testdata/apexkeys_vendor.txt
index b751227..7dd3964 100644
--- a/tools/releasetools/testdata/apexkeys_vendor.txt
+++ b/tools/releasetools/testdata/apexkeys_vendor.txt
@@ -1,3 +1,7 @@
-name="com.android.runtime.release.apex" public_key="art/build/apex/com.android.runtime.avbpubkey" private_key="art/build/apex/com.android.runtime.pem" container_certificate="art/build/apex/com.android.runtime.release.x509.pem" container_private_key="art/build/apex/com.android.runtime.release.pk8"
-name="com.android.support.apexer.apex" public_key="system/apex/apexer/etc/com.android.support.apexer.avbpubkey" private_key="system/apex/apexer/etc/com.android.support.apexer.pem" container_certificate="build/target/product/security/testkey.x509.pem" container_private_key="build/target/product/security/testkey.pk8"
-name="com.android.runtime.debug.apex" public_key="art/build/apex/com.android.runtime.avbpubkey" private_key="art/build/apex/com.android.runtime.pem" container_certificate="art/build/apex/com.android.runtime.debug.x509.pem" container_private_key="art/build/apex/com.android.runtime.debug.pk8"
+name="com.android.conscrypt.apex" public_key="not_selected" private_key="not_selected" container_certificate="not_selected" container_private_key="not_selected" partition="system"
+name="com.android.dummy_product.apex" public_key="not_selected" private_key="not_selected" container_certificate="not_selected" container_private_key="not_selected" partition="product"
+name="com.android.runtime.apex" public_key="not_selected" private_key="not_selected" container_certificate="not_selected" container_private_key="not_selected" partition="system"
+name="com.android.vndk.current.on_vendor.apex" public_key="packages/modules/vndk/apex/com.android.vndk.current.pubkey" private_key="packages/modules/vndk/apex/com.android.vndk.current.pem" container_certificate="packages/modules/vndk/apex/com.android.vndk.current.x509.pem" container_private_key="packages/modules/vndk/apex/com.android.vndk.current.pk8" partition="vendor"
+name="com.android.vndk.v27.apex" public_key="not_selected" private_key="not_selected" container_certificate="not_selected" container_private_key="not_selected" partition="system_ext"
+name="com.android.vndk.v28.apex" public_key="not_selected" private_key="not_selected" container_certificate="not_selected" container_private_key="not_selected" partition="system_ext"
+name="com.android.vndk.v29.apex" public_key="not_selected" private_key="not_selected" container_certificate="not_selected" container_private_key="not_selected" partition="system_ext"
diff --git a/tools/releasetools/testdata/apkcerts_framework.txt b/tools/releasetools/testdata/apkcerts_framework.txt
new file mode 100644
index 0000000..a75f55c
--- /dev/null
+++ b/tools/releasetools/testdata/apkcerts_framework.txt
@@ -0,0 +1,6 @@
+name="TestSystem1.apk" certificate="build/make/target/product/security/testkey.x509.pem" private_key="build/make/target/product/security/testkey.pk8" partition="system"
+name="TestSystem2.apk" certificate="build/make/target/product/security/testkey.x509.pem" private_key="build/make/target/product/security/testkey.pk8" partition="system"
+name="TestVendor.apk" certificate="not_selected" private_key="not_selected" partition="vendor"
+name="TestOdm.apk" certificate="not_selected" private_key="not_selected" partition="odm"
+name="TestProduct.apk" certificate="build/make/target/product/security/testkey.x509.pem" private_key="build/make/target/product/security/testkey.pk8" partition="product"
+name="TestSystemExt.apk" certificate="build/make/target/product/security/testkey.x509.pem" private_key="build/make/target/product/security/testkey.pk8" partition="system_ext"
diff --git a/tools/releasetools/testdata/apkcerts_merge.txt b/tools/releasetools/testdata/apkcerts_merge.txt
new file mode 100644
index 0000000..0425e96
--- /dev/null
+++ b/tools/releasetools/testdata/apkcerts_merge.txt
@@ -0,0 +1,6 @@
+name="TestOdm.apk" certificate="build/make/target/product/security/testkey.x509.pem" private_key="build/make/target/product/security/testkey.pk8" partition="odm"
+name="TestProduct.apk" certificate="build/make/target/product/security/testkey.x509.pem" private_key="build/make/target/product/security/testkey.pk8" partition="product"
+name="TestSystem1.apk" certificate="build/make/target/product/security/testkey.x509.pem" private_key="build/make/target/product/security/testkey.pk8" partition="system"
+name="TestSystem2.apk" certificate="build/make/target/product/security/testkey.x509.pem" private_key="build/make/target/product/security/testkey.pk8" partition="system"
+name="TestSystemExt.apk" certificate="build/make/target/product/security/testkey.x509.pem" private_key="build/make/target/product/security/testkey.pk8" partition="system_ext"
+name="TestVendor.apk" certificate="build/make/target/product/security/testkey.x509.pem" private_key="build/make/target/product/security/testkey.pk8" partition="vendor"
diff --git a/tools/releasetools/testdata/apkcerts_vendor.txt b/tools/releasetools/testdata/apkcerts_vendor.txt
new file mode 100644
index 0000000..13d5255
--- /dev/null
+++ b/tools/releasetools/testdata/apkcerts_vendor.txt
@@ -0,0 +1,6 @@
+name="TestSystem1.apk" certificate="not_selected" private_key="not_selected" partition="system"
+name="TestSystem2.apk" certificate="not_selected" private_key="not_selected" partition="system"
+name="TestVendor.apk" certificate="build/make/target/product/security/testkey.x509.pem" private_key="build/make/target/product/security/testkey.pk8" partition="vendor"
+name="TestOdm.apk" certificate="build/make/target/product/security/testkey.x509.pem" private_key="build/make/target/product/security/testkey.pk8" partition="odm"
+name="TestProduct.apk" certificate="not_selected" private_key="not_selected" partition="product"
+name="TestSystemExt.apk" certificate="not_selected" private_key="not_selected" partition="system_ext"
diff --git a/tools/releasetools/testdata/test_aftl_rsa4096.pem b/tools/releasetools/testdata/test_aftl_rsa4096.pem
new file mode 100644
index 0000000..89f1ef3
--- /dev/null
+++ b/tools/releasetools/testdata/test_aftl_rsa4096.pem
@@ -0,0 +1,52 @@
+-----BEGIN PRIVATE KEY-----
+MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDDlhUPUgtWL6LB
+Wybp6wsEJeioV1aRLPGSA2/xIpTiJUK46cb/MD5eBTWjKENoIgX23eL/ePy2I68e
++WvcZ5ITGOTRQqNVZIdc5qvr03wkV0BsJQMHSMAHacePpB/4xM5MzN/6Ku1wA8Dw
+uK+v/Cw4hqq8H/gP0oPVQ1bwcIePzRPX4YkkyXusoyzTIm5DJ9reVtyFucKqANCN
+aFmGxcaEc2nADtARQWJpO95joFsMvr68+JBxpCt8aWbxuSz/rLJ9Y8Z46V/++XG+
+E4QEob/WVY5pUD/RyogLrfhIf+zO7R3wJklXElSFacIX9+RzR9dgkQVbqxLfBKIP
+XWLCsF4I4EnvqUtaVjIMl8UpZpoq8pDLRqZ71Os5xZYq06x9E02M6DnvFbZEdaOX
+MCz2mmNX3g5FahvJayBhCuNhyTkd79MFR71Wp48TvWxKz3S7q0T0cWHNhtPkHSCa
+KwD93AQnqtLKYDGkHIZBzJPcs+QxbzdHyGzhXZb+qh5KmQvNA9HRBQY1RkMmzIbI
+8pzYTwpOkbCEhVoCWcRaaF1Pgl+zcpgJOMbBBUabx/dConFIhMDW/I5fHgKgwGqm
+tWUibrMPdnfS6W5MXi8jC0eDuZl0VwmdE+4dLujiOofUYnb7D+GXojf3PrSLcTw1
+PmG0f7l5xDKN9a0N+IXqvD2oAANTsQIDAQABAoICAQCW5HXw8OogHvYg2HMIKrbA
+B4McRO1baWIhtRcq4PQeGIMGaA2HmS+0l65O5uRCNWWGlJ7pW+0TlCop6mHFk/4F
+T8JQk2mxmrI4ARqIAQwYeVwRUuioOP81eO1mK0gjQ6qpY7I0reOq9KpozQN18UYo
+gfS82Kkng9EDukUbkKV1UtFJTw3gXLVWdjlB1qFcnCXmPPs7DBpbz+8V+XiAWpsS
+WnwumP77IQeMiozDLdaw2YQMBHRjyDVocWTjfmpyAkleJZjcdagC7W1MKIBElomL
+EUyigTALaYZWBGy1ekQ3TIY5XUBdtZ2RpAsDNNOCAN3v+VI565zOhCOHWRO1gh24
+vyhBFR0HYqBRoLbLAqo8bM5iLPz1EWGyaTnfxt38J8Va0TD7KihcBnphiA+dkhEF
+oc0yIp/8S2o3CfkNok7Ju8Amb7M4JJuKhuP8wxn86fAHpjjd3Y4SlZp0NrTrd7T2
+msLIneb1OUZZxFxyJG1XQGEZplLPalnGadIF4p3q/3nd1rVb491qCNl/A5QwhI9r
+ZV62O90M9fu3+cAynBLbMT09IZecNwP1gXmunlY6YH+ymM+3NFqC8q2tnzomiz8/
+Fee0ftZ2C/jK62fET0Y8LPWGkVQGHtvZH0FPg4suA0GMmYAe0tQl93A+jFltfKKZ
+RgCDrYs6Wv76E9gnWVnEdQKCAQEA8L76LjZUTKOg83Bra+hP+cXnwGsgwOwJfGBp
+OM++5HzlpYjtbD38esBZVJtwb/8xJGdsHtP2n7ZgbSDuAnRj5S50QHIApvRkz1Y+
+1hL8tAdgVP2JkYjpyG3bPk4QVKyXkKvBcp2BCidXs75+HzfOxqkazumaYOYo2guh
+azHdka2xSqxcZqo4yyORc/oue25RU4skmuNDOlP0+OTxU/uXnl7QZmlaOfT5TqO4
+s7uER4BXt/87j44mnOBdXmtqrsL49+R9bzVskx76aeuaBbwf7jnpR058E71OZwSd
+F1P3fx6hl0yLOZF/5Jnq+14rEna6jH50XtzlhB6deSZFTOw2gwKCAQEAz/qXRzwH
+I0YWISgkUG2zBJseHmfHqV4CDzb5+tTJ3B2I8cXE0m2sQJXi2s7oMhWSc1cQOHCX
+txpgWaD59uBz2lcwnGRNp27TRXv8Wo+X0+O+lGWU2cO+j8AB2Vtb7F7rCySp0+Uu
+z+dBfoQ2zhKEQlkX0YldVILGzCL3QBHVvPC4iDlwkMRbcejDoh9NsBtHL8lG+MAw
+ZXbwJjhaJkhTXJFpJpejq70naS8VVlLt8Os80iuBXe5JK/ecAHtsNcJlXO02sMNZ
+Fbcy8WosGyvRKQ/tHtTjAlxZ7Ey8usWE8BvWBdUgiIBkIcjLtE2GrA8eOGNb3v1I
+HRt8NsV8yaLWuwKCAQAR7SaT6le8nTKO7gARuOq7npDzMwbtVqYeLM+o+08rlGFF
+QjzronH6cfg05J4quMXgABN8+CuVGO91MM6IQEJv/lWJtvN1ex1GkxV6u0812JbD
+vV1RCPDfi86XhRiSNYfTrfZponDJYMSXDcg2auFqyYzFe3+TV5ATLGqIoN3uyxA4
+jz0SJ/qypaNfD3IGnuBPaD0Bi4ql/TpwjhuqNUHE+SprdczSI/usb2SBfaUL7fKa
+MNcuiVc2tz48maMIAFypmMn+TewXyGa9HF4Lr0ZxZr6IIL/8eEwuP5my8v2q6Yz+
+xyRW1Q7A5vUoYoqyhUS+0Wu45JnyjJUNQFxIrg4hAoIBAF1uBIGSvN4iwRQ6FT4w
+WahrCre8BVzXh3NQTjJZXylL91YtcwLZE/Wbn+KN6o99U2IPLZE9O1qdNcVt5Hz8
+Te87FfJbuOrLhYuEbFQ+h4U/nUDK9XhyT+wB5JLBUOU5qrtByC0Rmtr411o/iONA
+PDwWC/YskEnDygywdIRKvsr3FN7VdvUB0Na2KxRsnZjMWElmUUS0Ccm7CZ0R2aWy
+/gfqpuMYYgVnnwnIhfxWmt+MvbDorGAHCMYAoQsyZuUrpB9/zP7RcvanavI6sP+v
+ynF43xvnpOdNl3Po8SuyScsXpijOmqPXkaP/sUsZPLOUww2vzPi6raetzjpIs4td
+ZLsCggEAe42Zj3FEbruJZeDgmd9lSc0j8UF90mNw8KH44IbuA6R9fGv3WkrNHEVd
+XZOwjWqAxhOj6pFoJk8n6h5d8iS/yXFZ0AfBMc21XMecu9mnfx9E9LFAIWmv7Wut
+vy3h2BqY+crglpg5RAw+3J97HAGMYCvp+hH2il+9zzjpmCtTD21LRMkw34szY7RR
+CDy9G5FTmKVlxw5eegvyj164olQRLurEdUIfSr5UnBjrWftJHy9JW8KWCeFDSmm9
+xCl3nGDyQuZmOTngxPtrOYAhb5LoKR9BeGcy6jlom7V4nYYqm3t1IDBgMqjYGT9c
+vqQgxO2OFsQOJQ/4PRYEKd1neTlZrw==
+-----END PRIVATE KEY-----
diff --git a/tools/releasetools/testdata/test_transparency_key.pub b/tools/releasetools/testdata/test_transparency_key.pub
new file mode 100644
index 0000000..8bfd816
--- /dev/null
+++ b/tools/releasetools/testdata/test_transparency_key.pub
@@ -0,0 +1,15 @@
+-----BEGIN PUBLIC KEY-----
+MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA4ilqCNsenNA013iCdwgD
+YPxZ853nbHG9lMBp9boXiwRcqT/8bUKHIL7YX5z7s+QoRYVY3rkMKppRabclXzyx
+H59YnPMaU4uv7NqwWzjgaZo7E+vo7IF+KBjV3cJulId5Av0yIYUCsrwd7MpGtWdC
+Q3S+7Vd4zwzCKEhcvliNIhnNlp1U3wNkPCxOyCAsMEn6k8O5ar12ke5TvxDv15db
+rPDeHh8G2OYWoCkWL+lSN35L2kOJqKqVbLKWrrOd96RCYrrtbPCi580OADJRcUlG
+lgcjwmNwmypBWvQMZ6ITj0P0ksHnl1zZz1DE2rXe1goLI1doghb5KxLaezlR8c2C
+E3w/uo9KJgNmNgUVzzqZZ6FE0moyIDNOpP7KtZAL0DvEZj6jqLbB0ccPQElrg52m
+Dv2/A3nYSr0mYBKeskT4+Bg7PGgoC8p7WyLSxMyzJEDYdtrj9OFx6eZaA23oqTQx
+k3Qq5H8RfNBeeSUEeKF7pKH/7gyqZ2bNzBFMA2EBZgBozwRfaeN/HCv3qbaCnwvu
+6caacmAsK+RxiYxSL1QsJqyhCWWGxVyenmxdc1KG/u5ypi7OIioztyzR3t2tAzD3
+Nb+2t8lgHBRxbV24yiPlnvPmB1ZYEctXnlRR9Evpl1o9xA9NnybPHKr9rozN39CZ
+V/USB8K6ao1y5xPZxa8CZksCAwEAAQ==
+-----END PUBLIC KEY-----
+