Merge "Remove GKI APEX from build."
diff --git a/core/Makefile b/core/Makefile
index 6420024..1a60157 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -83,7 +83,7 @@
$(pcf_ignored_file):
echo "$(PRIVATE_IGNORED)" | tr " " "\n" >$@
-$(call dist-for-goals,droidcore,$(pcf_ignored_file):logs/$(notdir $(pcf_ignored_file)))
+$(call dist-for-goals,droidcore-unbundled,$(pcf_ignored_file):logs/$(notdir $(pcf_ignored_file)))
pcf_ignored_file :=
product_copy_files_ignored :=
@@ -586,7 +586,7 @@
@rm -f $@
@$(foreach s,$(STATS.MODULE_TYPE),echo "modules_type_make,$(s),$(words $(STATS.MODULE_TYPE.$(s)))" >>$@;)
@$(foreach s,$(STATS.SOONG_MODULE_TYPE),echo "modules_type_soong,$(s),$(STATS.SOONG_MODULE_TYPE.$(s))" >>$@;)
-$(call dist-for-goals,droidcore,$(BUILD_SYSTEM_STATS))
+$(call dist-for-goals,droidcore-unbundled,$(BUILD_SYSTEM_STATS))
# -----------------------------------------------------------------
# build /product/etc/security/avb/system_other.avbpubkey if needed
@@ -611,7 +611,7 @@
$(SOONG_TO_CONVERT): $(SOONG_CONV_DATA) $(SOONG_TO_CONVERT_SCRIPT)
@rm -f $@
$(hide) $(SOONG_TO_CONVERT_SCRIPT) $< >$@
-$(call dist-for-goals,droidcore,$(SOONG_TO_CONVERT))
+$(call dist-for-goals,droidcore-unbundled,$(SOONG_TO_CONVERT))
MK2BP_CATALOG_SCRIPT := build/make/tools/mk2bp_catalog.py
MK2BP_REMAINING_HTML := $(PRODUCT_OUT)/mk2bp_remaining.html
@@ -625,7 +625,7 @@
--out_dir="$(OUT_DIR)" \
--mode=html \
> $@
-$(call dist-for-goals,droidcore,$(MK2BP_REMAINING_HTML))
+$(call dist-for-goals,droidcore-unbundled,$(MK2BP_REMAINING_HTML))
MK2BP_REMAINING_CSV := $(PRODUCT_OUT)/mk2bp_remaining.csv
$(MK2BP_REMAINING_CSV): $(SOONG_CONV_DATA) $(MK2BP_CATALOG_SCRIPT)
@@ -635,7 +635,7 @@
--out_dir="$(OUT_DIR)" \
--mode=csv \
> $@
-$(call dist-for-goals,droidcore,$(MK2BP_REMAINING_CSV))
+$(call dist-for-goals,droidcore-unbundled,$(MK2BP_REMAINING_CSV))
# -----------------------------------------------------------------
# Modules use -Wno-error, or added default -Wall -Werror
@@ -647,11 +647,11 @@
echo "# Modules added default -Wall" >> $@
for m in $(sort $(SOONG_MODULES_ADDED_WALL) $(MODULES_ADDED_WALL)); do echo $$m >> $@; done
-$(call dist-for-goals,droidcore,$(WALL_WERROR))
+$(call dist-for-goals,droidcore-unbundled,$(WALL_WERROR))
# -----------------------------------------------------------------
# C/C++ flag information for modules
-$(call dist-for-goals,droidcore,$(SOONG_MODULES_CFLAG_ARTIFACTS))
+$(call dist-for-goals,droidcore-unbundled,$(SOONG_MODULES_CFLAG_ARTIFACTS))
# -----------------------------------------------------------------
# Modules missing profile files
@@ -815,8 +815,13 @@
# We just build this directly to the install location.
INSTALLED_RAMDISK_TARGET := $(BUILT_RAMDISK_TARGET)
+$(INSTALLED_RAMDISK_TARGET): PRIVATE_DIRS := debug_ramdisk dev metadata mnt proc second_stage_resources sys
$(INSTALLED_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_RAMDISK_FILES) $(INSTALLED_FILES_FILE_RAMDISK) | $(COMPRESSION_COMMAND_DEPS)
$(call pretty,"Target ramdisk: $@")
+ $(hide) mkdir -p $(addprefix $(TARGET_RAMDISK_OUT)/,$(PRIVATE_DIRS))
+ifeq (true,$(BOARD_USES_GENERIC_KERNEL_IMAGE))
+ $(hide) mkdir -p $(addprefix $(TARGET_RAMDISK_OUT)/first_stage_ramdisk/,$(PRIVATE_DIRS))
+endif
$(hide) $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RAMDISK_OUT) | $(COMPRESSION_COMMAND) > $@
.PHONY: ramdisk-nodeps
@@ -1117,11 +1122,6 @@
endif
ifdef INTERNAL_BOOTCONFIG
- ifneq (,$(findstring androidboot.hardware=, $(INTERNAL_BOOTCONFIG)))
- $(error "androidboot.hardware" BOOTCONFIG parameter is not supported due \
- to bootconfig limitations. Use "hardware" instead. INTERNAL_BOOTCONFIG: \
- $(INTERNAL_BOOTCONFIG))
- endif
INTERNAL_VENDOR_BOOTCONFIG_TARGET := $(PRODUCT_OUT)/vendor-bootconfig.img
$(INTERNAL_VENDOR_BOOTCONFIG_TARGET):
rm -f $@
@@ -4257,6 +4257,7 @@
e2fsdroid \
fc_sort \
fec \
+ fsck.f2fs \
fs_config \
generate_verity_key \
host_init_verifier \
@@ -4591,7 +4592,7 @@
.PHONY: misc_info
misc_info: $(INSTALLED_MISC_INFO_TARGET)
-droidcore: $(INSTALLED_MISC_INFO_TARGET)
+droidcore-unbundled: $(INSTALLED_MISC_INFO_TARGET)
# -----------------------------------------------------------------
# A zip of the directories that map to the target filesystem.
@@ -4771,6 +4772,7 @@
ifdef BUILDING_VENDOR_BOOT_IMAGE
$(BUILT_TARGET_FILES_PACKAGE): $(INTERNAL_VENDOR_RAMDISK_FILES)
$(BUILT_TARGET_FILES_PACKAGE): $(INTERNAL_VENDOR_RAMDISK_FRAGMENT_TARGETS)
+ $(BUILT_TARGET_FILES_PACKAGE): $(INTERNAL_VENDOR_BOOTCONFIG_TARGET)
# The vendor ramdisk may be built from the recovery ramdisk.
ifeq (true,$(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT))
$(BUILT_TARGET_FILES_PACKAGE): $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP)
@@ -4844,7 +4846,7 @@
ifdef BOARD_PREBUILT_BOOTLOADER
$(BUILT_TARGET_FILES_PACKAGE): $(INSTALLED_BOOTLOADER_MODULE)
-droidcore: $(INSTALLED_BOOTLOADER_MODULE)
+droidcore-unbundled: $(INSTALLED_BOOTLOADER_MODULE)
endif
# Depending on the various images guarantees that the underlying
@@ -5432,7 +5434,7 @@
$(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))
+ $(call dist-for-goals,droidcore-unbundled,$(PROFDATA_ZIP))
endif
# -----------------------------------------------------------------
@@ -5611,7 +5613,7 @@
$(call build-superimage-target,$(INSTALLED_SUPERIMAGE_TARGET),\
$(call intermediates-dir-for,PACKAGING,superimage_debug)/misc_info.txt)
-droidcore: $(INSTALLED_SUPERIMAGE_TARGET)
+droidcore-unbundled: $(INSTALLED_SUPERIMAGE_TARGET)
# For devices that uses super image directly, the superimage target points to the file in $(PRODUCT_OUT).
.PHONY: superimage
@@ -5697,7 +5699,7 @@
$(MK_COMBINE_QEMU_IMAGE) -i $(INSTALLED_SYSTEM_QEMU_CONFIG) -o $@)
systemimage: $(INSTALLED_QEMU_SYSTEMIMAGE)
-droidcore: $(INSTALLED_QEMU_SYSTEMIMAGE)
+droidcore-unbundled: $(INSTALLED_QEMU_SYSTEMIMAGE)
endif
ifdef INSTALLED_VENDORIMAGE_TARGET
INSTALLED_QEMU_VENDORIMAGE := $(PRODUCT_OUT)/vendor-qemu.img
@@ -5706,7 +5708,7 @@
(export SGDISK=$(SGDISK_HOST) SIMG2IMG=$(SIMG2IMG); $(MK_QEMU_IMAGE_SH) $(INSTALLED_VENDORIMAGE_TARGET))
vendorimage: $(INSTALLED_QEMU_VENDORIMAGE)
-droidcore: $(INSTALLED_QEMU_VENDORIMAGE)
+droidcore-unbundled: $(INSTALLED_QEMU_VENDORIMAGE)
endif
ifdef INSTALLED_RAMDISK_TARGET
@@ -5717,7 +5719,7 @@
@echo Create ramdisk-qemu.img
(cat $(INSTALLED_RAMDISK_TARGET) $(INTERNAL_VENDOR_RAMDISK_TARGET) > $(INSTALLED_QEMU_RAMDISKIMAGE))
-droidcore: $(INSTALLED_QEMU_RAMDISKIMAGE)
+droidcore-unbundled: $(INSTALLED_QEMU_RAMDISKIMAGE)
endif
endif
endif
@@ -5729,7 +5731,7 @@
(export SGDISK=$(SGDISK_HOST) SIMG2IMG=$(SIMG2IMG); $(MK_QEMU_IMAGE_SH) $(INSTALLED_PRODUCTIMAGE_TARGET))
productimage: $(INSTALLED_QEMU_PRODUCTIMAGE)
-droidcore: $(INSTALLED_QEMU_PRODUCTIMAGE)
+droidcore-unbundled: $(INSTALLED_QEMU_PRODUCTIMAGE)
endif
ifdef INSTALLED_SYSTEM_EXTIMAGE_TARGET
INSTALLED_QEMU_SYSTEM_EXTIMAGE := $(PRODUCT_OUT)/system_ext-qemu.img
@@ -5738,7 +5740,7 @@
(export SGDISK=$(SGDISK_HOST) SIMG2IMG=$(SIMG2IMG); $(MK_QEMU_IMAGE_SH) $(INSTALLED_SYSTEM_EXTIMAGE_TARGET))
systemextimage: $(INSTALLED_QEMU_SYSTEM_EXTIMAGE)
-droidcore: $(INSTALLED_QEMU_SYSTEM_EXTIMAGE)
+droidcore-unbundled: $(INSTALLED_QEMU_SYSTEM_EXTIMAGE)
endif
ifdef INSTALLED_ODMIMAGE_TARGET
INSTALLED_QEMU_ODMIMAGE := $(PRODUCT_OUT)/odm-qemu.img
@@ -5747,7 +5749,7 @@
(export SGDISK=$(SGDISK_HOST); $(MK_QEMU_IMAGE_SH) $(INSTALLED_ODMIMAGE_TARGET))
odmimage: $(INSTALLED_QEMU_ODMIMAGE)
-droidcore: $(INSTALLED_QEMU_ODMIMAGE)
+droidcore-unbundled: $(INSTALLED_QEMU_ODMIMAGE)
endif
ifdef INSTALLED_VENDOR_DLKMIMAGE_TARGET
@@ -5757,7 +5759,7 @@
(export SGDISK=$(SGDISK_HOST); $(MK_QEMU_IMAGE_SH) $(INSTALLED_VENDOR_DLKMIMAGE_TARGET))
vendor_dlkmimage: $(INSTALLED_QEMU_VENDOR_DLKMIMAGE)
-droidcore: $(INSTALLED_QEMU_VENDOR_DLKMIMAGE)
+droidcore-unbundled: $(INSTALLED_QEMU_VENDOR_DLKMIMAGE)
endif
ifdef INSTALLED_ODM_DLKMIMAGE_TARGET
@@ -5767,7 +5769,7 @@
(export SGDISK=$(SGDISK_HOST); $(MK_QEMU_IMAGE_SH) $(INSTALLED_ODM_DLKMIMAGE_TARGET))
odm_dlkmimage: $(INSTALLED_QEMU_ODM_DLKMIMAGE)
-droidcore: $(INSTALLED_QEMU_ODM_DLKMIMAGE)
+droidcore-unbundled: $(INSTALLED_QEMU_ODM_DLKMIMAGE)
endif
QEMU_VERIFIED_BOOT_PARAMS := $(PRODUCT_OUT)/VerifiedBootParams.textproto
@@ -5778,7 +5780,7 @@
$(INSTALLED_SYSTEMIMAGE_TARGET) $(QEMU_VERIFIED_BOOT_PARAMS))
systemimage: $(QEMU_VERIFIED_BOOT_PARAMS)
-droidcore: $(QEMU_VERIFIED_BOOT_PARAMS)
+droidcore-unbundled: $(QEMU_VERIFIED_BOOT_PARAMS)
endif
# -----------------------------------------------------------------
diff --git a/core/android_soong_config_vars.mk b/core/android_soong_config_vars.mk
index 74558f5..6c39b2b 100644
--- a/core/android_soong_config_vars.mk
+++ b/core/android_soong_config_vars.mk
@@ -28,6 +28,8 @@
$(call add_soong_config_var,ANDROID,TARGET_ENABLE_MEDIADRM_64)
$(call add_soong_config_var,ANDROID,BOARD_USES_ODMIMAGE)
+$(call add_soong_config_var,ANDROID,BOARD_USES_RECOVERY_AS_BOOT)
+$(call add_soong_config_var,ANDROID,BOARD_BUILD_SYSTEM_ROOT_IMAGE)
# TODO(b/172480615): Remove when platform uses ART Module prebuilts by default.
ifeq (,$(filter art_module,$(SOONG_CONFIG_NAMESPACES)))
@@ -60,3 +62,7 @@
ifdef APEX_BUILD_FOR_PRE_S_DEVICES
$(call add_soong_config_var_value,ANDROID,library_linking_strategy,prefer_static)
endif
+
+ifdef MODULE_BUILD_FROM_SOURCE
+$(call add_soong_config_var_value,ANDROID,module_build_from_source,true)
+endif
diff --git a/core/config.mk b/core/config.mk
index d1746ef..e30ff3f 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -603,7 +603,7 @@
# Path to tools.jar
HOST_JDK_TOOLS_JAR := $(ANDROID_JAVA8_HOME)/lib/tools.jar
-APICHECK_COMMAND := $(JAVA) -Xmx4g -jar $(APICHECK) --no-banner --compatible-output=no
+APICHECK_COMMAND := $(JAVA) -Xmx4g -jar $(APICHECK) --no-banner
# Boolean variable determining if the allow list for compatible properties is enabled
PRODUCT_COMPATIBLE_PROPERTY := true
@@ -792,6 +792,7 @@
28.0 \
29.0 \
30.0 \
+ 31.0 \
.KATI_READONLY := \
PLATFORM_SEPOLICY_COMPAT_VERSIONS \
diff --git a/core/definitions.mk b/core/definitions.mk
index c5fe76b..102827b 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -598,7 +598,7 @@
$(_dir)/$(1).meta_lic : $(_deps) $(_notices) $(foreach b,$(_tgts), $(_dir)/$(b).meta_module) build/make/tools/build-license-metadata.sh
rm -f $$@
mkdir -p $$(dir $$@)
- build/make/tools/build-license-metadata.sh -k $$(PRIVATE_KINDS) -c $$(PRIVATE_CONDITIONS) -n $$(PRIVATE_NOTICES) -d $$(PRIVATE_NOTICE_DEPS) -m $$(PRIVATE_INSTALL_MAP) -t $$(PRIVATE_TARGETS) $$(if $$(PRIVATE_IS_CONTAINER),-is_container) -p $$(PRIVATE_PACKAGE_NAME) -o $$@
+ build/make/tools/build-license-metadata.sh -k $$(PRIVATE_KINDS) -c $$(PRIVATE_CONDITIONS) -n $$(PRIVATE_NOTICES) -d $$(PRIVATE_NOTICE_DEPS) -m $$(PRIVATE_INSTALL_MAP) -t $$(PRIVATE_TARGETS) $$(if $$(PRIVATE_IS_CONTAINER),-is_container) -p '$$(PRIVATE_PACKAGE_NAME)' -o $$@
.PHONY: $(1).meta_lic
$(1).meta_lic : $(_dir)/$(1).meta_lic
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index f365347..a2837f3 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -275,7 +275,8 @@
my_dexpreopt_archs :=
my_dexpreopt_images :=
my_dexpreopt_images_deps :=
-my_dexpreopt_image_locations :=
+my_dexpreopt_image_locations_on_host :=
+my_dexpreopt_image_locations_on_device :=
my_dexpreopt_infix := boot
ifeq (true, $(DEXPREOPT_USE_ART_IMAGE))
my_dexpreopt_infix := art
@@ -348,7 +349,8 @@
endif # TARGET_2ND_ARCH
endif # LOCAL_MODULE_CLASS
- my_dexpreopt_image_locations += $(DEXPREOPT_IMAGE_LOCATIONS_$(my_dexpreopt_infix))
+ my_dexpreopt_image_locations_on_host += $(DEXPREOPT_IMAGE_LOCATIONS_ON_HOST$(my_dexpreopt_infix))
+ my_dexpreopt_image_locations_on_device += $(DEXPREOPT_IMAGE_LOCATIONS_ON_DEVICE$(my_dexpreopt_infix))
# Record dex-preopt config.
DEXPREOPT.$(LOCAL_MODULE).DEX_PREOPT := $(LOCAL_DEX_PREOPT)
@@ -387,7 +389,8 @@
$(call end_json_map)
$(call add_json_list, Archs, $(my_dexpreopt_archs))
$(call add_json_list, DexPreoptImages, $(my_dexpreopt_images))
- $(call add_json_list, DexPreoptImageLocationsOnHost, $(my_dexpreopt_image_locations))
+ $(call add_json_list, DexPreoptImageLocationsOnHost, $(my_dexpreopt_image_locations_on_host))
+ $(call add_json_list, DexPreoptImageLocationsOnDevice,$(my_dexpreopt_image_locations_on_device))
$(call add_json_list, PreoptBootClassPathDexFiles, $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES))
$(call add_json_list, PreoptBootClassPathDexLocations,$(DEXPREOPT_BOOTCLASSPATH_DEX_LOCATIONS))
$(call add_json_bool, PreoptExtractedApk, $(my_preopt_for_extracted_apk))
diff --git a/core/main.mk b/core/main.mk
index e8c1ef9..0393bee 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -311,6 +311,13 @@
endif
endif
+# Set build prop. This prop is read by ota_from_target_files when generating OTA,
+# to decide if VABC should be disabled.
+ifeq ($(BOARD_DONT_USE_VABC_OTA),true)
+ADDITIONAL_VENDOR_PROPERTIES += \
+ ro.vendor.build.dont_use_vabc=true
+endif
+
# Set the flag in vendor. So VTS would know if the new fingerprint format is in use when
# the system images are replaced by GSI.
ifeq ($(BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT),true)
@@ -1567,9 +1574,10 @@
.PHONY: vbmetavendorimage
vbmetavendorimage: $(INSTALLED_VBMETA_VENDORIMAGE_TARGET)
-# Build files and then package it into the rom formats
-.PHONY: droidcore
-droidcore: $(filter $(HOST_OUT_ROOT)/%,$(modules_to_install)) \
+# The droidcore-unbundled target depends on the subset of targets necessary to
+# perform a full system build (either unbundled or not).
+.PHONY: droidcore-unbundled
+droidcore-unbundled: $(filter $(HOST_OUT_ROOT)/%,$(modules_to_install)) \
$(INSTALLED_SYSTEMIMAGE_TARGET) \
$(INSTALLED_RAMDISK_TARGET) \
$(INSTALLED_BOOTIMAGE_TARGET) \
@@ -1627,6 +1635,11 @@
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \
soong_docs
+# The droidcore target depends on the droidcore-unbundled subset and any other
+# targets for a non-unbundled (full source) full system build.
+.PHONY: droidcore
+droidcore: droidcore-unbundled
+
# dist_files only for putting your library into the dist directory with a full build.
.PHONY: dist_files
@@ -1702,21 +1715,43 @@
$(apps_only_installed_files)))
-else ifeq (,$(TARGET_BUILD_UNBUNDLED))
+else ifeq ($(TARGET_BUILD_UNBUNDLED),$(TARGET_BUILD_UNBUNDLED_IMAGE))
+
+ # Truth table for entering this block of code:
+ # TARGET_BUILD_UNBUNDLED | TARGET_BUILD_UNBUNDLED_IMAGE | Action
+ # -----------------------|------------------------------|-------------------------
+ # not set | not set | droidcore path
+ # not set | true | invalid
+ # true | not set | skip
+ # true | true | droidcore-unbundled path
+
+ # We dist the following targets only for droidcore full build. These items
+ # can include java-related targets that would cause building framework java
+ # sources in a droidcore full build.
+
$(call dist-for-goals, droidcore, \
+ $(BUILT_OTATOOLS_PACKAGE) \
+ $(APPCOMPAT_ZIP) \
+ $(DEXPREOPT_CONFIG_ZIP) \
+ $(DEXPREOPT_TOOLS_ZIP) \
+ )
+
+ # We dist the following targets for droidcore-unbundled (and droidcore since
+ # droidcore depends on droidcore-unbundled). The droidcore-unbundled target
+ # is a subset of droidcore. It can be used used for an unbundled build to
+ # avoid disting targets that would cause building framework java sources,
+ # which we want to avoid in an unbundled build.
+
+ $(call dist-for-goals, droidcore-unbundled, \
$(INTERNAL_UPDATE_PACKAGE_TARGET) \
$(INTERNAL_OTA_PACKAGE_TARGET) \
$(INTERNAL_OTA_METADATA) \
$(INTERNAL_OTA_PARTIAL_PACKAGE_TARGET) \
$(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET) \
- $(BUILT_OTATOOLS_PACKAGE) \
$(SYMBOLS_ZIP) \
$(PROGUARD_DICT_ZIP) \
$(PROGUARD_USAGE_ZIP) \
$(COVERAGE_ZIP) \
- $(APPCOMPAT_ZIP) \
- $(DEXPREOPT_CONFIG_ZIP) \
- $(DEXPREOPT_TOOLS_ZIP) \
$(INSTALLED_FILES_FILE) \
$(INSTALLED_FILES_JSON) \
$(INSTALLED_FILES_FILE_VENDOR) \
@@ -1745,11 +1780,11 @@
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \
$(INSTALLED_MISC_INFO_TARGET) \
$(INSTALLED_RAMDISK_TARGET) \
- )
+ )
# Put a copy of the radio/bootloader files in the dist dir.
$(foreach f,$(INSTALLED_RADIOIMAGE_TARGET), \
- $(call dist-for-goals, droidcore, $(f)))
+ $(call dist-for-goals, droidcore-unbundled, $(f)))
ifneq ($(ANDROID_BUILD_EMBEDDED),true)
$(call dist-for-goals, droidcore, \
@@ -1758,13 +1793,13 @@
)
endif
- $(call dist-for-goals, droidcore, \
+ $(call dist-for-goals, droidcore-unbundled, \
$(INSTALLED_FILES_FILE_ROOT) \
$(INSTALLED_FILES_JSON_ROOT) \
)
ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
- $(call dist-for-goals, droidcore, \
+ $(call dist-for-goals, droidcore-unbundled, \
$(INSTALLED_FILES_FILE_RAMDISK) \
$(INSTALLED_FILES_JSON_RAMDISK) \
$(INSTALLED_FILES_FILE_DEBUG_RAMDISK) \
@@ -1784,7 +1819,7 @@
endif
ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true)
- $(call dist-for-goals, droidcore, \
+ $(call dist-for-goals, droidcore-unbundled, \
$(recovery_ramdisk) \
)
endif
@@ -1814,10 +1849,25 @@
$(call dist-for-goals,droidcore,$(f):ndk_apis/$(notdir $(f))))
endif
-# Building a full system-- the default is to build droidcore
-droid_targets: droidcore dist_files
+ # For full system build (whether unbundled or not), we configure
+ # droid_targets to depend on droidcore-unbundled, which will set up the full
+ # system dependencies and also dist the subset of targets that correspond to
+ # an unbundled build (exclude building some framework sources).
-endif # !TARGET_BUILD_UNBUNDLED
+ droid_targets: droidcore-unbundled
+
+ ifeq (,$(TARGET_BUILD_UNBUNDLED_IMAGE))
+
+ # If we're building a full system (including the framework sources excluded
+ # by droidcore-unbundled), we configure droid_targets also to depend on
+ # droidcore, which includes all dist for droidcore, and will build the
+ # necessary framework sources.
+
+ droid_targets: droidcore dist_files
+
+ endif
+
+endif # TARGET_BUILD_UNBUNDLED == TARGET_BUILD_UNBUNDLED_IMAGE
.PHONY: docs
docs: $(ALL_DOCS)
diff --git a/core/sysprop.mk b/core/sysprop.mk
index 0fc96e0..be9b1f8 100644
--- a/core/sysprop.mk
+++ b/core/sysprop.mk
@@ -98,7 +98,7 @@
$(eval _option := --allow-dup)\
)
-$(2): $(POST_PROCESS_PROPS) $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) $(3) $(6)
+$(2): $(POST_PROCESS_PROPS) $(INTERNAL_BUILD_ID_MAKEFILE) $(3) $(6)
$(hide) echo Building $$@
$(hide) mkdir -p $$(dir $$@)
$(hide) rm -f $$@ && touch $$@
diff --git a/core/tasks/collect_gpl_sources.mk b/core/tasks/collect_gpl_sources.mk
index ebc4181..9e9ab8e 100644
--- a/core/tasks/collect_gpl_sources.mk
+++ b/core/tasks/collect_gpl_sources.mk
@@ -26,4 +26,4 @@
$(hide) tar cfz $@ --exclude ".git*" $(PRIVATE_PATHS)
# Dist the tgz only if we are doing a full build
-$(call dist-for-goals,droidcore,$(gpl_source_tgz))
+$(call dist-for-goals,droidcore-unbundled,$(gpl_source_tgz))
diff --git a/core/tasks/host_init_verifier.mk b/core/tasks/host_init_verifier.mk
index bdf996c..e463710 100644
--- a/core/tasks/host_init_verifier.mk
+++ b/core/tasks/host_init_verifier.mk
@@ -53,4 +53,4 @@
--out_product $(PRODUCT_OUT)/$(TARGET_COPY_OUT_PRODUCT) \
> $@
-$(call dist-for-goals,droidcore,$(host_init_verifier_output))
+$(call dist-for-goals,droidcore-unbundled,$(host_init_verifier_output))
diff --git a/core/tasks/module-info.mk b/core/tasks/module-info.mk
index c866259..c838264 100644
--- a/core/tasks/module-info.mk
+++ b/core/tasks/module-info.mk
@@ -26,7 +26,7 @@
$(hide) echo '}' >> $@
-droidcore: $(MODULE_INFO_JSON)
+droidcore-unbundled: $(MODULE_INFO_JSON)
$(call dist-for-goals, general-tests, $(MODULE_INFO_JSON))
-$(call dist-for-goals, droidcore, $(MODULE_INFO_JSON))
+$(call dist-for-goals, droidcore-unbundled, $(MODULE_INFO_JSON))
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index f32ea76..6ba86de 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -39,9 +39,9 @@
include $(INTERNAL_BUILD_ID_MAKEFILE)
endif
-DEFAULT_PLATFORM_VERSION := SP1A
-MIN_PLATFORM_VERSION := SP1A
-MAX_PLATFORM_VERSION := SP1A
+DEFAULT_PLATFORM_VERSION := TP1A
+MIN_PLATFORM_VERSION := TP1A
+MAX_PLATFORM_VERSION := TP1A
ALLOWED_VERSIONS := $(call allowed-platform-versions,\
$(MIN_PLATFORM_VERSION),\
@@ -94,6 +94,7 @@
# These are the current development codenames, if the build is not a final
# release build. If this is a final release build, it is simply "REL".
PLATFORM_VERSION_CODENAME.SP1A := S
+PLATFORM_VERSION_CODENAME.TP1A := T
ifndef PLATFORM_VERSION_CODENAME
PLATFORM_VERSION_CODENAME := $(PLATFORM_VERSION_CODENAME.$(TARGET_PLATFORM_VERSION))
@@ -240,7 +241,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 := 2021-05-05
+ PLATFORM_SECURITY_PATCH := 2021-06-05
endif
.KATI_READONLY := PLATFORM_SECURITY_PATCH
diff --git a/envsetup.sh b/envsetup.sh
index 6cb2cc4..4f9440e 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -331,15 +331,15 @@
function bazel()
{
- local T="$(gettop)"
- if [ ! "$T" ]; then
- echo "Couldn't locate the top of the tree. Try setting TOP."
- return
+ if which bazel &>/dev/null; then
+ >&2 echo "NOTE: bazel() function sourced from Android's envsetup.sh is being used instead of $(which bazel)"
+ >&2 echo
fi
- if which bazel &>/dev/null; then
- >&2 echo "NOTE: bazel() function sourced from envsetup.sh is being used instead of $(which bazel)"
- >&2 echo
+ local T="$(gettop)"
+ if [ ! "$T" ]; then
+ >&2 echo "Couldn't locate the top of the Android tree. Try setting TOP. This bazel() function cannot be used outside of the AOSP directory."
+ return
fi
"$T/tools/bazel" "$@"
@@ -703,6 +703,10 @@
build_build_var_cache
if [ $? -ne 0 ]
then
+ if [[ "$product" =~ .*_(eng|user|userdebug) ]]
+ then
+ echo "Did you mean -${product/*_/}? (dash instead of underscore)"
+ fi
return 1
fi
export TARGET_PRODUCT=$(get_build_var TARGET_PRODUCT)
@@ -1692,16 +1696,31 @@
fi
)
+# Convenience entry point (like m) to use Bazel in AOSP.
function b()
(
# Generate BUILD, bzl files into the synthetic Bazel workspace (out/soong/workspace).
- m nothing GENERATE_BAZEL_FILES=true || return 1
+ _trigger_build "all-modules" nothing GENERATE_BAZEL_FILES=true USE_BAZEL_ANALYSIS= || return 1
# Then, run Bazel using the synthetic workspace as the --package_path.
- "$(gettop)/tools/bazel" "$@" --config=bp2build
+ if [[ -z "$@" ]]; then
+ # If there are no args, show help.
+ bazel help
+ else
+ # Else, always run with the bp2build configuration, which sets Bazel's package path to the synthetic workspace.
+ bazel "$@" --config=bp2build
+ fi
)
function m()
(
+ if [[ "${USE_BAZEL_ANALYSIS}" =~ ^(true|1)$ ]]; then
+ # This only short-circuits to Bazel for a single module target now.
+ b cquery "@soong_injection//module_name_to_label:$@" 2>/dev/null
+ if [[ $? == 0 ]]; then
+ bazel build "@soong_injection//module_name_to_label:$@" --config=bp2build
+ return $?
+ fi
+ fi
_trigger_build "all-modules" "$@"
)
diff --git a/target/board/Android.mk b/target/board/Android.mk
index 4dd6b17..142270e 100644
--- a/target/board/Android.mk
+++ b/target/board/Android.mk
@@ -24,8 +24,10 @@
$(call pretty,"Generated: ($@)")
ifdef board_info_txt
$(hide) grep -v '#' $< > $@
-else
+else ifdef TARGET_BOOTLOADER_BOARD_NAME
$(hide) echo "board=$(TARGET_BOOTLOADER_BOARD_NAME)" > $@
+else
+ $(hide) echo "" > $@
endif
# Copy compatibility metadata to the device.
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index 7e4c5ef..de3d63d 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -128,6 +128,7 @@
libaudioeffect_jni \
libbinder \
libbinder_ndk \
+ libbinder_rpc_unstable \
libc.bootstrap \
libcamera2ndk \
libcutils \
diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk
index 0e652c1..f0916f9 100644
--- a/target/product/default_art_config.mk
+++ b/target/product/default_art_config.mk
@@ -48,7 +48,7 @@
PRODUCT_BOOT_JARS += \
com.android.i18n:core-icu4j
-# Updatable APEX jars. Keep the list sorted by module names and then library names.
+# Updatable APEX boot jars. Keep the list sorted by module names and then library names.
PRODUCT_UPDATABLE_BOOT_JARS := \
com.android.conscrypt:conscrypt \
com.android.ipsec:android.net.ipsec.ike \
@@ -60,6 +60,11 @@
com.android.tethering:framework-tethering \
com.android.wifi:framework-wifi
+# Updatable APEX system server jars. Keep the list sorted by module names and then library names.
+PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS := \
+ com.android.art:service-art \
+ com.android.permission:service-permission \
+
# Minimal configuration for running dex2oat (default argument values).
# PRODUCT_USES_DEFAULT_ART_CONFIG must be true to enable boot image compilation.
PRODUCT_USES_DEFAULT_ART_CONFIG := true
diff --git a/target/product/gsi_release.mk b/target/product/gsi_release.mk
index 25fa68b..8591a83 100644
--- a/target/product/gsi_release.mk
+++ b/target/product/gsi_release.mk
@@ -42,6 +42,9 @@
# Enable dynamic partition size
PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true
+# Disable the build-time debugfs restrictions on GSI builds
+PRODUCT_SET_DEBUGFS_RESTRICTIONS := false
+
# GSI targets should install "unflattened" APEXes in /system
TARGET_FLATTEN_APEX := false
diff --git a/target/product/media_system.mk b/target/product/media_system.mk
index c7ac907..30a8621 100644
--- a/target/product/media_system.mk
+++ b/target/product/media_system.mk
@@ -54,12 +54,6 @@
services \
ethernet-service
-# system server jars which are updated via apex modules.
-# The values should be of the format <apex name>:<jar name>
-PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS := \
- com.android.art:service-art \
- com.android.permission:service-permission \
-
PRODUCT_COPY_FILES += \
system/core/rootdir/etc/public.libraries.android.txt:system/etc/public.libraries.txt
diff --git a/tools/releasetools/Android.bp b/tools/releasetools/Android.bp
index 32a5dcb..fc588e4 100644
--- a/tools/releasetools/Android.bp
+++ b/tools/releasetools/Android.bp
@@ -59,6 +59,8 @@
"mkuserimg_mke2fs",
"simg2img",
"tune2fs",
+ "mkf2fsuserimg.sh",
+ "fsck.f2fs",
],
}
@@ -162,6 +164,7 @@
"releasetools_common",
"releasetools_verity_utils",
"apex_manifest",
+ "care_map_proto_py",
],
required: [
"brillo_update_payload",
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py
index c583d01..28a2f5a 100644
--- a/tools/releasetools/add_img_to_target_files.py
+++ b/tools/releasetools/add_img_to_target_files.py
@@ -687,8 +687,10 @@
os.path.join(OPTIONS.input_tmp, "IMAGES",
"{}.img".format(partition_name))))
+
def AddApexInfo(output_zip):
- apex_infos = GetApexInfoFromTargetFiles(OPTIONS.input_tmp, 'system')
+ apex_infos = GetApexInfoFromTargetFiles(OPTIONS.input_tmp, 'system',
+ compressed_only=False)
apex_metadata_proto = ota_metadata_pb2.ApexMetadata()
apex_metadata_proto.apex_info.extend(apex_infos)
apex_info_bytes = apex_metadata_proto.SerializeToString()
diff --git a/tools/releasetools/care_map_pb2.py b/tools/releasetools/care_map_pb2.py
new file mode 100644
index 0000000..06aee25
--- /dev/null
+++ b/tools/releasetools/care_map_pb2.py
@@ -0,0 +1,132 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: bootable/recovery/update_verifier/care_map.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='bootable/recovery/update_verifier/care_map.proto',
+ package='recovery_update_verifier',
+ syntax='proto3',
+ serialized_options=_b('H\003'),
+ serialized_pb=_b('\n0bootable/recovery/update_verifier/care_map.proto\x12\x18recovery_update_verifier\"\x9e\x01\n\x07\x43\x61reMap\x12\x43\n\npartitions\x18\x01 \x03(\x0b\x32/.recovery_update_verifier.CareMap.PartitionInfo\x1aN\n\rPartitionInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06ranges\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\t\x12\x13\n\x0b\x66ingerprint\x18\x04 \x01(\tB\x02H\x03\x62\x06proto3')
+)
+
+
+
+
+_CAREMAP_PARTITIONINFO = _descriptor.Descriptor(
+ name='PartitionInfo',
+ full_name='recovery_update_verifier.CareMap.PartitionInfo',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='name', full_name='recovery_update_verifier.CareMap.PartitionInfo.name', index=0,
+ number=1, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='ranges', full_name='recovery_update_verifier.CareMap.PartitionInfo.ranges', index=1,
+ number=2, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='id', full_name='recovery_update_verifier.CareMap.PartitionInfo.id', index=2,
+ number=3, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='fingerprint', full_name='recovery_update_verifier.CareMap.PartitionInfo.fingerprint', index=3,
+ number=4, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto3',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=159,
+ serialized_end=237,
+)
+
+_CAREMAP = _descriptor.Descriptor(
+ name='CareMap',
+ full_name='recovery_update_verifier.CareMap',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='partitions', full_name='recovery_update_verifier.CareMap.partitions', index=0,
+ number=1, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[_CAREMAP_PARTITIONINFO, ],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto3',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=79,
+ serialized_end=237,
+)
+
+_CAREMAP_PARTITIONINFO.containing_type = _CAREMAP
+_CAREMAP.fields_by_name['partitions'].message_type = _CAREMAP_PARTITIONINFO
+DESCRIPTOR.message_types_by_name['CareMap'] = _CAREMAP
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+CareMap = _reflection.GeneratedProtocolMessageType('CareMap', (_message.Message,), {
+
+ 'PartitionInfo' : _reflection.GeneratedProtocolMessageType('PartitionInfo', (_message.Message,), {
+ 'DESCRIPTOR' : _CAREMAP_PARTITIONINFO,
+ '__module__' : 'bootable.recovery.update_verifier.care_map_pb2'
+ # @@protoc_insertion_point(class_scope:recovery_update_verifier.CareMap.PartitionInfo)
+ })
+ ,
+ 'DESCRIPTOR' : _CAREMAP,
+ '__module__' : 'bootable.recovery.update_verifier.care_map_pb2'
+ # @@protoc_insertion_point(class_scope:recovery_update_verifier.CareMap)
+ })
+_sym_db.RegisterMessage(CareMap)
+_sym_db.RegisterMessage(CareMap.PartitionInfo)
+
+
+DESCRIPTOR._options = None
+# @@protoc_insertion_point(module_scope)
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 985a21a..498e487 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -276,6 +276,9 @@
args = args[:]
args[0] = FindHostToolPath(args[0])
+ if verbose is None:
+ verbose = OPTIONS.verbose
+
# Don't log any if caller explicitly says so.
if verbose:
logger.info(" Running: \"%s\"", " ".join(args))
@@ -451,6 +454,13 @@
return vabc_enabled
@property
+ def vendor_suppressed_vabc(self):
+ vendor_prop = self.info_dict.get("vendor.build.prop")
+ vabc_suppressed = vendor_prop and \
+ vendor_prop.GetProp("ro.vendor.build.dont_use_vabc")
+ return vabc_suppressed and vabc_suppressed.lower() == "true"
+
+ @property
def oem_props(self):
return self._oem_props
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index 229f7e9..bf0b8f1 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -237,6 +237,7 @@
import sys
import zipfile
+import care_map_pb2
import common
import ota_utils
from ota_utils import (UNZIP_PATTERN, FinalizeMetadata, GetPackageMetadata,
@@ -832,6 +833,17 @@
with zipfile.ZipFile(input_file, allowZip64=True) as input_zip:
common.ZipWriteStr(partial_target_zip, 'META/ab_partitions.txt',
'\n'.join(ab_partitions))
+ CARE_MAP_ENTRY = "META/care_map.pb"
+ if CARE_MAP_ENTRY in input_zip.namelist():
+ caremap = care_map_pb2.CareMap()
+ caremap.ParseFromString(input_zip.read(CARE_MAP_ENTRY))
+ filtered = [
+ part for part in caremap.partitions if part.name in ab_partitions]
+ del caremap.partitions[:]
+ caremap.partitions.extend(filtered)
+ common.ZipWriteStr(partial_target_zip, CARE_MAP_ENTRY,
+ caremap.SerializeToString())
+
for info_file in ['META/misc_info.txt', DYNAMIC_PARTITION_INFO]:
if info_file not in input_zip.namelist():
logger.warning('Cannot find %s in input zipfile', info_file)
@@ -841,7 +853,8 @@
content, lambda p: p in ab_partitions)
common.ZipWriteStr(partial_target_zip, info_file, modified_info)
- # TODO(xunchang) handle 'META/care_map.pb', 'META/postinstall_config.txt'
+ # TODO(xunchang) handle META/postinstall_config.txt'
+
common.ZipClose(partial_target_zip)
return partial_target_file
@@ -1063,6 +1076,7 @@
# serve I/O request when device boots. Therefore, disable VABC if source
# build doesn't supports it.
if not source_info.is_vabc or not target_info.is_vabc:
+ logger.info("Either source or target does not support VABC, disabling.")
OPTIONS.disable_vabc = True
else:
@@ -1071,6 +1085,9 @@
target_info = common.BuildInfo(OPTIONS.info_dict, OPTIONS.oem_dicts)
source_info = None
+ if target_info.vendor_suppressed_vabc:
+ logger.info("Vendor suppressed VABC. Disabling")
+ OPTIONS.disable_vabc = True
additional_args = []
# Prepare custom images.
@@ -1166,14 +1183,12 @@
else:
logger.warning("Cannot find care map file in target_file package")
- # Copy apex_info.pb over to generated OTA package.
- try:
- apex_info_entry = target_zip.getinfo("META/apex_info.pb")
- with target_zip.open(apex_info_entry, "r") as zfp:
- common.ZipWriteStr(output_zip, "apex_info.pb", zfp.read(),
- compress_type=zipfile.ZIP_STORED)
- except KeyError:
- logger.warning("target_file doesn't contain apex_info.pb %s", target_file)
+ # Add the source apex version for incremental ota updates, and write the
+ # result apex info to the ota package.
+ ota_apex_info = ota_utils.ConstructOtaApexInfo(target_zip, source_file)
+ if ota_apex_info is not None:
+ common.ZipWriteStr(output_zip, "apex_info.pb", ota_apex_info,
+ compress_type=zipfile.ZIP_STORED)
common.ZipClose(target_zip)
diff --git a/tools/releasetools/ota_metadata.proto b/tools/releasetools/ota_metadata.proto
index ed9d0c3..689ce80 100644
--- a/tools/releasetools/ota_metadata.proto
+++ b/tools/releasetools/ota_metadata.proto
@@ -72,6 +72,8 @@
int64 version = 2;
bool is_compressed = 3;
int64 decompressed_size = 4;
+ // Used in OTA
+ int64 source_version = 5;
}
// Just a container to hold repeated apex_info, so that we can easily serialize
diff --git a/tools/releasetools/ota_utils.py b/tools/releasetools/ota_utils.py
index 104f02f..28c246b 100644
--- a/tools/releasetools/ota_utils.py
+++ b/tools/releasetools/ota_utils.py
@@ -569,3 +569,45 @@
SignFile(temp_zip_name, output_zip_name, OPTIONS.package_key, pw,
whole_file=True)
+
+
+def ConstructOtaApexInfo(target_zip, source_file=None):
+ """If applicable, add the source version to the apex info."""
+
+ def _ReadApexInfo(input_zip):
+ if "META/apex_info.pb" not in input_zip.namelist():
+ logger.warning("target_file doesn't contain apex_info.pb %s", input_zip)
+ return None
+
+ with input_zip.open("META/apex_info.pb", "r") as zfp:
+ return zfp.read()
+
+ target_apex_string = _ReadApexInfo(target_zip)
+ # Return early if the target apex info doesn't exist or is empty.
+ if not target_apex_string:
+ return target_apex_string
+
+ # If the source apex info isn't available, just return the target info
+ if not source_file:
+ return target_apex_string
+
+ with zipfile.ZipFile(source_file, "r", allowZip64=True) as source_zip:
+ source_apex_string = _ReadApexInfo(source_zip)
+ if not source_apex_string:
+ return target_apex_string
+
+ source_apex_proto = ota_metadata_pb2.ApexMetadata()
+ source_apex_proto.ParseFromString(source_apex_string)
+ source_apex_versions = {apex.package_name: apex.version for apex in
+ source_apex_proto.apex_info}
+
+ # If the apex package is available in the source build, initialize the source
+ # apex version.
+ target_apex_proto = ota_metadata_pb2.ApexMetadata()
+ target_apex_proto.ParseFromString(target_apex_string)
+ for target_apex in target_apex_proto.apex_info:
+ name = target_apex.package_name
+ if name in source_apex_versions:
+ target_apex.source_version = source_apex_versions[name]
+
+ return target_apex_proto.SerializeToString()
diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py
index dd2de36..2859948 100755
--- a/tools/releasetools/sign_target_files_apks.py
+++ b/tools/releasetools/sign_target_files_apks.py
@@ -217,6 +217,18 @@
raise RuntimeError("Missing {} in AVB_FOOTER_ARGS".format(partition))
+def IsApexFile(filename):
+ return filename.endswith(".apex") or filename.endswith(".capex")
+
+
+def GetApexFilename(filename):
+ name = os.path.basename(filename)
+ # Replace the suffix for compressed apex
+ if name.endswith(".capex"):
+ return name.replace(".capex", ".apex")
+ return name
+
+
def GetApkCerts(certmap):
# apply the key remapping to the contents of the file
for apk, cert in certmap.items():
@@ -356,8 +368,8 @@
unknown_files = []
for info in input_tf_zip.infolist():
# Handle APEXes on all partitions
- if info.filename.endswith('.apex'):
- name = os.path.basename(info.filename)
+ if IsApexFile(info.filename):
+ name = GetApexFilename(info.filename)
if name not in known_keys:
unknown_files.append(name)
continue
@@ -388,10 +400,11 @@
invalid_apexes = []
for info in input_tf_zip.infolist():
- if not info.filename.endswith('.apex'):
+ if not IsApexFile(info.filename):
continue
- name = os.path.basename(info.filename)
+ name = GetApexFilename(info.filename)
+
(payload_key, container_key) = apex_keys[name]
if ((payload_key in common.SPECIAL_CERT_STRINGS and
container_key not in common.SPECIAL_CERT_STRINGS) or
@@ -541,8 +554,9 @@
common.ZipWriteStr(output_tf_zip, out_info, data)
# Sign bundled APEX files on all partitions
- elif filename.endswith(".apex"):
- name = os.path.basename(filename)
+ elif IsApexFile(filename):
+ name = GetApexFilename(filename)
+
payload_key, container_key = apex_keys[name]
# We've asserted not having a case with only one of them PRESIGNED.
diff --git a/tools/releasetools/test_ota_from_target_files.py b/tools/releasetools/test_ota_from_target_files.py
index 661712a..51def30 100644
--- a/tools/releasetools/test_ota_from_target_files.py
+++ b/tools/releasetools/test_ota_from_target_files.py
@@ -24,7 +24,7 @@
import test_utils
from ota_utils import (
BuildLegacyOtaMetadata, CalculateRuntimeDevicesAndFingerprints,
- FinalizeMetadata, GetPackageMetadata, PropertyFiles)
+ ConstructOtaApexInfo, FinalizeMetadata, GetPackageMetadata, PropertyFiles)
from ota_from_target_files import (
_LoadOemDicts, AbOtaPropertyFiles,
GetTargetFilesZipForCustomImagesUpdates,
@@ -295,6 +295,35 @@
uncompressed_apex_size = os.path.getsize(original_apex_filepath)
self.assertEqual(apex_infos[0].decompressed_size, uncompressed_apex_size)
+ @staticmethod
+ def construct_tf_with_apex_info(infos):
+ apex_metadata_proto = ota_metadata_pb2.ApexMetadata()
+ apex_metadata_proto.apex_info.extend(infos)
+
+ output = common.MakeTempFile(suffix='.zip')
+ with zipfile.ZipFile(output, 'w') as zfp:
+ common.ZipWriteStr(zfp, "META/apex_info.pb",
+ apex_metadata_proto.SerializeToString())
+ return output
+
+ def test_ConstructOtaApexInfo_incremental_package(self):
+ infos = [ota_metadata_pb2.ApexInfo(package_name='com.android.apex.1',
+ version=1000, is_compressed=False),
+ ota_metadata_pb2.ApexInfo(package_name='com.android.apex.2',
+ version=2000, is_compressed=True)]
+ target_file = self.construct_tf_with_apex_info(infos)
+
+ with zipfile.ZipFile(target_file) as target_zip:
+ info_bytes = ConstructOtaApexInfo(target_zip, source_file=target_file)
+ apex_metadata_proto = ota_metadata_pb2.ApexMetadata()
+ apex_metadata_proto.ParseFromString(info_bytes)
+
+ info_list = apex_metadata_proto.apex_info
+ self.assertEqual(2, len(info_list))
+ self.assertEqual('com.android.apex.1', info_list[0].package_name)
+ self.assertEqual(1000, info_list[0].version)
+ self.assertEqual(1000, info_list[0].source_version)
+
def test_GetPackageMetadata_retrofitDynamicPartitions(self):
target_info = common.BuildInfo(self.TEST_TARGET_INFO_DICT, None)
common.OPTIONS.retrofit_dynamic_partitions = True
diff --git a/tools/signapk/OWNERS b/tools/signapk/OWNERS
index 0b8d398..23cab0b 100644
--- a/tools/signapk/OWNERS
+++ b/tools/signapk/OWNERS
@@ -1,2 +1,2 @@
cbrubaker@google.com
-klyubin@google.com
+mpgroover@google.com
diff --git a/tools/warn/java_warn_patterns.py b/tools/warn/java_warn_patterns.py
index 7dfa866..3f5da9d 100644
--- a/tools/warn/java_warn_patterns.py
+++ b/tools/warn/java_warn_patterns.py
@@ -807,6 +807,8 @@
[r".*: warning: \[path\] bad path element .*\.jar"]),
java_medium('Supported version from annotation processor',
[r".*: warning: Supported source version .+ from annotation processor"]),
+ java_medium('Schema export directory is not provided',
+ [r".*\.(java|kt):.*: warning: Schema export directory is not provided"]),
]
compile_patterns(warn_patterns)
diff --git a/tools/warn/other_warn_patterns.py b/tools/warn/other_warn_patterns.py
index dd078fb..c95528c 100644
--- a/tools/warn/other_warn_patterns.py
+++ b/tools/warn/other_warn_patterns.py
@@ -80,6 +80,8 @@
[r".*: warning: value size does not match register size specified by the constraint and modifier"]),
asm('IT instruction is deprecated',
[r".*: warning: applying IT instruction .* is deprecated"]),
+ asm('section flags ignored',
+ [r".*: warning: section flags ignored on section redeclaration"]),
asm('setjmp/longjmp/vfork changed binding',
[r".*: warning: .*(setjmp|longjmp|vfork) changed binding to .*"]),
# NDK warnings