Merge "Revert "Revert "Remove ro.apex.updatable=false in GSI"""
diff --git a/Changes.md b/Changes.md
index 461de97..5a0fd23 100644
--- a/Changes.md
+++ b/Changes.md
@@ -1,5 +1,48 @@
# Build System Changes for Android.mk Writers
+## LOCAL_C_INCLUDES outside the source/output trees are an error {#BUILD_BROKEN_OUTSIDE_INCLUDE_DIRS}
+
+Include directories are expected to be within the source tree (or in the output
+directory, generated during the build). This has been checked in some form
+since Oreo, but now has better checks.
+
+There's now a `BUILD_BROKEN_OUTSIDE_INCLUDE_DIRS` variable, that when set, will
+turn these errors into warnings temporarily. I don't expect this to last more
+than a release, since they're fairly easy to clean up.
+
+Neither of these cases are supported by Soong, and will produce errors when
+converting your module.
+
+### Absolute paths
+
+This has been checked since Oreo. The common reason to hit this is because a
+makefile is calculating a path, and ran abspath/realpath/etc. This is a problem
+because it makes your build non-reproducible. It's very unlikely that your
+source path is the same on every machine.
+
+### Using `../` to leave the source/output directories
+
+This is the new check that has been added. In every case I've found, this has
+been a mistake in the Android.mk -- assuming that `LOCAL_C_INCLUDES` (which is
+relative to the top of the source tree) acts like `LOCAL_SRC_FILES` (which is
+relative to `LOCAL_PATH`).
+
+Since this usually isn't a valid path, you can almost always just remove the
+offending line.
+
+
+# `BOARD_HAL_STATIC_LIBRARIES` and `LOCAL_HAL_STATIC_LIBRARIES` are obsolete {#BOARD_HAL_STATIC_LIBRARIES}
+
+Define proper HIDL / Stable AIDL HAL instead.
+
+* For libhealthd, use health HAL. See instructions for implementing
+ health HAL:
+
+ * [hardware/interfaces/health/2.1/README.md] for health 2.1 HAL (recommended)
+ * [hardware/interfaces/health/1.0/README.md] for health 1.0 HAL
+
+* For libdumpstate, use at least Dumpstate HAL 1.0.
+
## PRODUCT_STATIC_BOOT_CONTROL_HAL is obsolete {#PRODUCT_STATIC_BOOT_CONTROL_HAL}
`PRODUCT_STATIC_BOOT_CONTROL_HAL` was the workaround to allow sideloading with
@@ -480,3 +523,5 @@
[external/fonttools/Lib/fontTools/Android.bp]: https://android.googlesource.com/platform/external/fonttools/+/master/Lib/fontTools/Android.bp
[frameworks/base/Android.bp]: https://android.googlesource.com/platform/frameworks/base/+/master/Android.bp
[frameworks/base/data/fonts/Android.mk]: https://android.googlesource.com/platform/frameworks/base/+/master/data/fonts/Android.mk
+[hardware/interfaces/health/1.0/README.md]: https://android.googlesource.com/platform/hardware/interfaces/+/master/health/1.0/README.md
+[hardware/interfaces/health/2.1/README.md]: https://android.googlesource.com/platform/hardware/interfaces/+/master/health/2.1/README.md
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 6c5ecd9..42bcb3c 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -699,6 +699,9 @@
# again, as the original change removing them was reverted.
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/framework/*.jar)
+# The core image variant has been renamed to ""
+$(call add-clean-step, find $(SOONG_OUT_DIR)/.intermediates -type d -name "android_*_core*" -print0 | xargs -0 rm -rf)
+
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
diff --git a/core/Makefile b/core/Makefile
index 2879ab0..5fdca13 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -94,6 +94,8 @@
$(error duplicate header copies are no longer allowed. For more information about headers, see: https://android.googlesource.com/platform/build/soong/+/master/docs/best_practices.md#headers)
endif
+$(file >$(PRODUCT_OUT)/.copied_headers_list,$(TARGET_OUT_HEADERS) $(ALL_COPIED_HEADERS))
+
# -----------------------------------------------------------------
# docs/index.html
ifeq (,$(TARGET_BUILD_APPS))
@@ -1483,6 +1485,9 @@
ifneq (true,$(TARGET_USERIMAGES_SPARSE_SQUASHFS_DISABLED))
INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG := -s
endif
+ifneq (true,$(TARGET_USERIMAGES_SPARSE_F2FS_DISABLED))
+ INTERNAL_USERIMAGES_SPARSE_F2FS_FLAG := -S
+endif
INTERNAL_USERIMAGES_DEPS := \
$(BUILD_IMAGE) \
@@ -1619,6 +1624,7 @@
$(if $(INTERNAL_USERIMAGES_EXT_VARIANT),$(hide) echo "fs_type=$(INTERNAL_USERIMAGES_EXT_VARIANT)" >> $(1))
$(if $(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG),$(hide) echo "extfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG)" >> $(1))
$(if $(INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG),$(hide) echo "squashfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG)" >> $(1))
+$(if $(INTERNAL_USERIMAGES_SPARSE_F2FS_FLAG),$(hide) echo "f2fs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_F2FS_FLAG)" >> $(1))
$(if $(BOARD_EXT4_SHARE_DUP_BLOCKS),$(hide) echo "ext4_share_dup_blocks=$(BOARD_EXT4_SHARE_DUP_BLOCKS)" >> $(1))
$(if $(BOARD_FLASH_LOGICAL_BLOCK_SIZE), $(hide) echo "flash_logical_block_size=$(BOARD_FLASH_LOGICAL_BLOCK_SIZE)" >> $(1))
$(if $(BOARD_FLASH_ERASE_BLOCK_SIZE), $(hide) echo "flash_erase_block_size=$(BOARD_FLASH_ERASE_BLOCK_SIZE)" >> $(1))
@@ -3621,6 +3627,8 @@
$(build-vbmetaimage-target)
.PHONY: vbmetaimage-nodeps
+vbmetaimage-nodeps: PRIVATE_AVB_VBMETA_SIGNING_ARGS := \
+ --algorithm $(BOARD_AVB_ALGORITHM) --key $(BOARD_AVB_KEY_PATH)
vbmetaimage-nodeps:
$(build-vbmetaimage-target)
endif # BUILDING_VBMETA_IMAGE
@@ -4109,6 +4117,8 @@
echo "super_$(group)_partition_list=$(call filter-out-missing-vendor, $(BOARD_$(call to-upper,$(group))_PARTITION_LIST))" >> $(1);))
$(if $(filter true,$(TARGET_USERIMAGES_SPARSE_EXT_DISABLED)), \
echo "build_non_sparse_super_partition=true" >> $(1))
+ $(if $(filter true,$(TARGET_USERIMAGES_SPARSE_F2FS_DISABLED)), \
+ echo "build_non_sparse_super_partition=true" >> $(1))
$(if $(filter true,$(BOARD_SUPER_IMAGE_IN_UPDATE_PACKAGE)), \
echo "super_image_in_update_package=true" >> $(1))
$(if $(BOARD_SUPER_PARTITION_SIZE), \
@@ -4348,10 +4358,12 @@
$(hide) cp $(PRODUCT_ODM_BASE_FS_PATH) \
$(zip_root)/META/$(notdir $(PRODUCT_ODM_BASE_FS_PATH))
endif
+ifneq ($(AB_OTA_UPDATER),true)
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
$(hide) PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH MKBOOTIMG=$(MKBOOTIMG) \
$(MAKE_RECOVERY_PATCH) $(zip_root) $(zip_root)
endif
+endif
ifeq ($(AB_OTA_UPDATER),true)
@# When using the A/B updater, include the updater config files in the zip.
$(hide) cp $(TOPDIR)system/update_engine/update_engine.conf $(zip_root)/META/update_engine_config.txt
diff --git a/core/binary.mk b/core/binary.mk
index e4805cd..cf3cfd5 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -84,6 +84,12 @@
my_native_coverage := false
endif
+# Exclude directories from manual binder interface whitelisting.
+# TODO(b/145621474): Move this check into IInterface.h when clang-tidy no longer uses absolute paths.
+ifneq (,$(filter $(addsuffix %,$(ALLOWED_MANUAL_INTERFACE_PATHS)),$(LOCAL_PATH)))
+ my_cflags += -DDO_NOT_CHECK_MANUAL_BINDER_INTERFACES
+endif
+
ifneq ($(strip $(ENABLE_XOM)),false)
ifndef LOCAL_IS_HOST_MODULE
my_xom := true
@@ -103,7 +109,7 @@
ifeq ($(strip $(my_xom)),true)
ifeq (arm64,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH))
ifeq ($(my_use_clang_lld),true)
- my_ldflags += -Wl,-execute-only
+ my_ldflags += -Wl,--execute-only -Wl,-z,separate-code
endif
endif
endif
@@ -435,15 +441,6 @@
include $(BUILD_SYSTEM)/cxx_stl_setup.mk
-# Add static HAL libraries
-ifdef LOCAL_HAL_STATIC_LIBRARIES
-$(foreach lib, $(LOCAL_HAL_STATIC_LIBRARIES), \
- $(eval b_lib := $(filter $(lib).%,$(BOARD_HAL_STATIC_LIBRARIES)))\
- $(if $(b_lib), $(eval my_static_libraries += $(b_lib)),\
- $(eval my_static_libraries += $(lib).default)))
-b_lib :=
-endif
-
ifneq ($(strip $(CUSTOM_$(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)LINKER)),)
my_linker := $(CUSTOM_$(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)LINKER)
else
@@ -1298,9 +1295,13 @@
my_c_includes := $(foreach inc,$(my_c_includes),$(call clean-path,$(inc)))
-my_outside_includes := $(filter-out $(OUT_DIR)/%,$(filter /%,$(my_c_includes)))
+my_outside_includes := $(filter-out $(OUT_DIR)/%,$(filter /%,$(my_c_includes)) $(filter ../%,$(my_c_includes)))
ifneq ($(my_outside_includes),)
-$(error $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): C_INCLUDES must be under the source or output directories: $(my_outside_includes))
+ ifeq ($(BUILD_BROKEN_OUTSIDE_INCLUDE_DIRS),true)
+ $(call pretty-warning,C_INCLUDES must be under the source or output directories: $(my_outside_includes))
+ else
+ $(call pretty-error,C_INCLUDES must be under the source or output directories: $(my_outside_includes))
+ endif
endif
# all_objects includes gen_o_objects which were part of LOCAL_GENERATED_SOURCES;
diff --git a/core/board_config.mk b/core/board_config.mk
index 4c128f1..0e3c52f 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -89,6 +89,7 @@
BUILD_BROKEN_PREBUILT_ELF_FILES \
BUILD_BROKEN_TREBLE_SYSPROP_NEVERALLOW \
BUILD_BROKEN_USES_NETWORK \
+ BUILD_BROKEN_OUTSIDE_INCLUDE_DIRS \
_build_broken_var_list += \
$(foreach m,$(AVAILABLE_BUILD_MODULE_TYPES) \
diff --git a/core/build_id.mk b/core/build_id.mk
index 03a8cd3..ba5ca42 100644
--- a/core/build_id.mk
+++ b/core/build_id.mk
@@ -18,4 +18,4 @@
# (like "CRB01"). It must be a single word, and is
# capitalized by convention.
-BUILD_ID=QD1A.190821.011
+BUILD_ID=AOSP.MASTER
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 9ff978b..6c3b249 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -112,7 +112,6 @@
# Group static libraries with "-Wl,--start-group" and "-Wl,--end-group" when linking.
LOCAL_GROUP_STATIC_LIBRARIES:=
LOCAL_GTEST:=true
-LOCAL_HAL_STATIC_LIBRARIES:=
LOCAL_HEADER_LIBRARIES:=
LOCAL_HOST_PREFIX:=
LOCAL_HOST_REQUIRED_MODULES:=
diff --git a/core/config.mk b/core/config.mk
index 9ab3fff..4cc78b8 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -120,6 +120,8 @@
)
$(KATI_obsolete_var PRODUCT_IOT)
$(KATI_obsolete_var MD5SUM)
+$(KATI_obsolete_var BOARD_HAL_STATIC_LIBRARIES, See $(CHANGES_URL)#BOARD_HAL_STATIC_LIBRARIES)
+$(KATI_obsolete_var LOCAL_HAL_STATIC_LIBRARIES, See $(CHANGES_URL)#BOARD_HAL_STATIC_LIBRARIES)
# Used to force goals to build. Only use for conditionally defined goals.
.PHONY: FORCE
diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk
index 32690fe..55eeec6 100644
--- a/core/dex_preopt.mk
+++ b/core/dex_preopt.mk
@@ -34,13 +34,13 @@
$(boot_zip): PRIVATE_BOOTCLASSPATH_JARS := $(bootclasspath_jars)
$(boot_zip): PRIVATE_SYSTEM_SERVER_JARS := $(system_server_jars)
-$(boot_zip): $(bootclasspath_jars) $(system_server_jars) $(SOONG_ZIP) $(MERGE_ZIPS) $(DEXPREOPT_IMAGE_ZIP_boot)
+$(boot_zip): $(bootclasspath_jars) $(system_server_jars) $(SOONG_ZIP) $(MERGE_ZIPS) $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art)
@echo "Create boot package: $@"
rm -f $@
$(SOONG_ZIP) -o $@.tmp \
-C $(dir $(firstword $(PRIVATE_BOOTCLASSPATH_JARS)))/.. $(addprefix -f ,$(PRIVATE_BOOTCLASSPATH_JARS)) \
-C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_SYSTEM_SERVER_JARS))
- $(MERGE_ZIPS) $@ $@.tmp $(DEXPREOPT_IMAGE_ZIP_boot)
+ $(MERGE_ZIPS) $@ $@.tmp $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art)
rm -f $@.tmp
$(call dist-for-goals, droidcore, $(boot_zip))
diff --git a/core/dex_preopt_config.mk b/core/dex_preopt_config.mk
index c6c6a61..0f994c4 100644
--- a/core/dex_preopt_config.mk
+++ b/core/dex_preopt_config.mk
@@ -92,9 +92,8 @@
$(call add_json_bool, DisableGenerateProfile, $(filter false,$(WITH_DEX_PREOPT_GENERATE_PROFILE)))
$(call add_json_str, ProfileDir, $(PRODUCT_DEX_PREOPT_PROFILE_DIR))
$(call add_json_list, BootJars, $(PRODUCT_BOOT_JARS))
+ $(call add_json_list, UpdatableBootJars, $(PRODUCT_UPDATABLE_BOOT_JARS))
$(call add_json_list, ArtApexJars, $(ART_APEX_JARS))
- $(call add_json_list, ProductUpdatableBootModules, $(PRODUCT_UPDATABLE_BOOT_MODULES))
- $(call add_json_list, ProductUpdatableBootLocations, $(PRODUCT_UPDATABLE_BOOT_LOCATIONS))
$(call add_json_list, SystemServerJars, $(PRODUCT_SYSTEM_SERVER_JARS))
$(call add_json_list, SystemServerApps, $(PRODUCT_SYSTEM_SERVER_APPS))
$(call add_json_list, UpdatableSystemServerJars, $(PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS))
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 64c9a37..aa3fd80 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -234,6 +234,7 @@
$(call end_json_map)
$(call add_json_list, Archs, $(my_dexpreopt_archs))
$(call add_json_list, DexPreoptImages, $(my_dexpreopt_images))
+ $(call add_json_list, DexPreoptImageLocations, $(DEXPREOPT_IMAGE_LOCATIONS))
$(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/java.mk b/core/java.mk
index cbcd1b5..a041321 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -413,8 +413,7 @@
legacy_proguard_flags += -printmapping $(proguard_dictionary)
legacy_proguard_flags += -printconfiguration $(proguard_configuration)
-common_proguard_flags := -forceprocessing
-
+common_proguard_flags :=
common_proguard_flag_files := $(BUILD_SYSTEM)/proguard.flags
ifneq ($(LOCAL_INSTRUMENTATION_FOR)$(filter tests,$(LOCAL_MODULE_TAGS)),)
common_proguard_flags += -dontshrink # don't shrink tests by default
diff --git a/core/main.mk b/core/main.mk
index fd02a83..6935efa 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -1186,9 +1186,10 @@
# still may create these libraries in /system (b/129006418).
DISABLE_APEX_LIBS_ABSENCE_CHECK ?=
-# Allow APEX libraries under /system/apex, which happens when APEX flattening
-# is enabled.
-APEX_LIBS_ABSENCE_CHECK_EXCLUDE := apex
+# Allow APEX libraries under:
+# /system/apex, which happens when APEX flattening is enabled.
+# /system/system_ext, which happens with GSI
+APEX_LIBS_ABSENCE_CHECK_EXCLUDE := apex system_ext
# Bionic should not be in /system, except for the bootstrap instance.
APEX_LIBS_ABSENCE_CHECK_EXCLUDE += lib/bootstrap lib64/bootstrap
@@ -1745,9 +1746,9 @@
endif
# Put XML formatted API files in the dist dir.
- $(TARGET_OUT_COMMON_INTERMEDIATES)/api.xml: $(call java-lib-header-files,android_stubs_current) $(APICHECK)
- $(TARGET_OUT_COMMON_INTERMEDIATES)/system-api.xml: $(call java-lib-header-files,android_system_stubs_current) $(APICHECK)
- $(TARGET_OUT_COMMON_INTERMEDIATES)/test-api.xml: $(call java-lib-header-files,android_test_stubs_current) $(APICHECK)
+ $(TARGET_OUT_COMMON_INTERMEDIATES)/api.xml: $(call java-lib-files,android_stubs_current) $(APICHECK)
+ $(TARGET_OUT_COMMON_INTERMEDIATES)/system-api.xml: $(call java-lib-files,android_system_stubs_current) $(APICHECK)
+ $(TARGET_OUT_COMMON_INTERMEDIATES)/test-api.xml: $(call java-lib-files,android_test_stubs_current) $(APICHECK)
api_xmls := $(addprefix $(TARGET_OUT_COMMON_INTERMEDIATES)/,api.xml system-api.xml test-api.xml)
$(api_xmls):
diff --git a/core/product.mk b/core/product.mk
index f451706..c7aac00 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -366,8 +366,8 @@
_product_single_value_vars += PRODUCT_BUILD_BOOT_IMAGE
_product_single_value_vars += PRODUCT_BUILD_VBMETA_IMAGE
-_product_list_vars += PRODUCT_UPDATABLE_BOOT_MODULES
-_product_list_vars += PRODUCT_UPDATABLE_BOOT_LOCATIONS
+# List of boot jars delivered via apex
+_product_list_vars += PRODUCT_UPDATABLE_BOOT_JARS
# Whether the product would like to check prebuilt ELF files.
_product_single_value_vars += PRODUCT_CHECK_ELF_FILES
@@ -381,6 +381,8 @@
# If set, Java module in product partition cannot use hidden APIs.
_product_single_value_vars += PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE
+_product_single_value_vars += PRODUCT_INSTALL_EXTRA_FLATTENED_APEXES
+
.KATI_READONLY := _product_single_value_vars _product_list_vars
_product_var_list :=$= $(_product_single_value_vars) $(_product_list_vars)
diff --git a/core/product_config.mk b/core/product_config.mk
index 4fc7bf6..afe91d4 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -264,6 +264,13 @@
endif
endif
+$(foreach pair,$(PRODUCT_UPDATABLE_BOOT_JARS), \
+ $(if $(findstring $(call word-colon,2,$(pair)),$(PRODUCT_BOOT_JARS)),, \
+ $(error Every jar in PRODUCT_UPDATABLE_BOOT_JARS must also be in PRODUCT_BOOT_JARS, \
+ $(call word-colon,2,$(pair)) is not) \
+ ) \
+)
+
ENFORCE_SYSTEM_CERTIFICATE := $(PRODUCT_ENFORCE_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT)
ENFORCE_SYSTEM_CERTIFICATE_WHITELIST := $(PRODUCT_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT_WHITELIST)
diff --git a/core/rust_device_test_config_template.xml b/core/rust_device_test_config_template.xml
new file mode 100644
index 0000000..9429d38
--- /dev/null
+++ b/core/rust_device_test_config_template.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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 test config file is auto-generated. -->
+<configuration description="Config to run {MODULE} device tests.">
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" />
+ </target_preparer>
+
+ <test class="com.android.tradefed.testtype.rust.RustBinaryTest" >
+ <option name="test-device-path" value="/data/local/tmp" />
+ <option name="module-name" value="{MODULE}" />
+ </test>
+</configuration>
diff --git a/core/soong_config.mk b/core/soong_config.mk
index 7ce59f1..85e7bbc 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -199,6 +199,8 @@
$(call add_json_bool, EnforceProductPartitionInterface, $(PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE))
+$(call add_json_bool, InstallExtraFlattenedApexes, $(PRODUCT_INSTALL_EXTRA_FLATTENED_APEXES))
+
$(call json_end)
$(file >$(SOONG_VARIABLES).tmp,$(json_contents))
diff --git a/core/tasks/general-tests.mk b/core/tasks/general-tests.mk
index 9ea4e62..7bcc915 100644
--- a/core/tasks/general-tests.mk
+++ b/core/tasks/general-tests.mk
@@ -17,6 +17,7 @@
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 \
intermediates_dir := $(call intermediates-dir-for,PACKAGING,general-tests)
general_tests_zip := $(PRODUCT_OUT)/general-tests.zip
diff --git a/core/tasks/with-license.mk b/core/tasks/with-license.mk
index daa6897..469ad76 100644
--- a/core/tasks/with-license.mk
+++ b/core/tasks/with-license.mk
@@ -20,7 +20,7 @@
name := $(name)_debug
endif
-name := $(name)-img-$(FILE_NAME_TAG)-with-license
+name := $(name)-flashable-$(FILE_NAME_TAG)-with-license
with_license_intermediates := \
$(call intermediates-dir-for,PACKAGING,with_license)
@@ -35,8 +35,7 @@
else
$(ZIP2ZIP) -i $(BUILT_TARGET_FILES_PACKAGE) -o $@ \
RADIO/bootloader.img:bootloader.img RADIO/radio.img:radio.img \
- IMAGES/system.img:system.img IMAGES/vendor.img:vendor.img \
- IMAGES/boot.img:boot.img OTA/android-info.txt:android-info.txt
+ IMAGES/*.img:. OTA/android-info.txt:android-info.txt
endif
with_license_zip := $(PRODUCT_OUT)/$(name).sh
$(with_license_zip): PRIVATE_NAME := $(name)
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index ff5fb42..8095212 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 := 2019-10-05
+ PLATFORM_SECURITY_PATCH := 2019-12-05
endif
.KATI_READONLY := PLATFORM_SECURITY_PATCH
diff --git a/target/board/mainline_x86_64/BoardConfig.mk b/target/board/mainline_x86_64/BoardConfig.mk
new file mode 100644
index 0000000..118fda6
--- /dev/null
+++ b/target/board/mainline_x86_64/BoardConfig.mk
@@ -0,0 +1,35 @@
+#
+# 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.
+#
+
+TARGET_ARCH := x86_64
+TARGET_ARCH_VARIANT := x86_64
+TARGET_CPU_ABI := x86_64
+
+TARGET_2ND_ARCH := x86
+TARGET_2ND_ARCH_VARIANT := x86_64
+TARGET_2ND_CPU_ABI := x86
+
+include build/make/target/board/BoardConfigMainlineCommon.mk
+
+TARGET_NO_KERNEL := true
+
+# Build generic A/B format system-only OTA.
+AB_OTA_UPDATER := true
+AB_OTA_PARTITIONS := system
+
+BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk
index ca4ed2c..5ecaf26 100644
--- a/target/product/AndroidProducts.mk
+++ b/target/product/AndroidProducts.mk
@@ -57,6 +57,7 @@
$(LOCAL_DIR)/mainline_system_arm64.mk \
$(LOCAL_DIR)/mainline_system_x86.mk \
$(LOCAL_DIR)/mainline_system_x86_arm.mk \
+ $(LOCAL_DIR)/mainline_system_x86_64.mk \
$(LOCAL_DIR)/sdk_arm64.mk \
$(LOCAL_DIR)/sdk.mk \
$(LOCAL_DIR)/sdk_phone_arm64.mk \
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index 8f99446..95e6fb0 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -50,6 +50,7 @@
com.android.adbd \
com.android.apex.cts.shim.v1_prebuilt \
com.android.conscrypt \
+ com.android.cronet \
com.android.i18n \
com.android.ipsec \
com.android.location.provider \
@@ -57,6 +58,8 @@
com.android.media.swcodec \
com.android.resolv \
com.android.neuralnetworks \
+ com.android.sdkext \
+ com.android.telephony \
com.android.tzdata \
ContactsProvider \
content \
@@ -95,12 +98,12 @@
idmap2 \
idmap2d \
ime \
- ims-common \
incident \
incidentd \
incident_helper \
init.environ.rc \
init_system \
+ InProcessTethering \
input \
installd \
iorapd \
@@ -250,7 +253,6 @@
task_profiles.json \
tc \
telecom \
- telephony-common \
tombstoned \
traced \
traced_probes \
@@ -322,14 +324,17 @@
telephony-common \
voip-common \
ims-common \
+ framework-sdkext \
ike \
updatable-media
-PRODUCT_UPDATABLE_BOOT_MODULES := conscrypt ike updatable-media
-PRODUCT_UPDATABLE_BOOT_LOCATIONS := \
- /apex/com.android.conscrypt/javalib/conscrypt.jar \
- /apex/com.android.ipsec/javalib/ike.jar \
- /apex/com.android.media/javalib/updatable-media.jar
+PRODUCT_UPDATABLE_BOOT_JARS := \
+ com.android.conscrypt:conscrypt \
+ com.android.ipsec:ike \
+ com.android.media:updatable-media \
+ com.android.sdkext:framework-sdkext \
+ com.android.telephony:telephony-common \
+ com.android.telephony:ims-common
PRODUCT_COPY_FILES += \
system/core/rootdir/init.usb.rc:system/etc/init/hw/init.usb.rc \
diff --git a/target/product/base_vendor.mk b/target/product/base_vendor.mk
index 1657e71..134ff31 100644
--- a/target/product/base_vendor.mk
+++ b/target/product/base_vendor.mk
@@ -23,6 +23,7 @@
init_second_stage.recovery \
ld.config.recovery.txt \
linker.recovery \
+ linkerconfig.recovery \
otacerts.recovery \
recovery \
shell_and_utilities_recovery \
diff --git a/target/product/cfi-common.mk b/target/product/cfi-common.mk
index 7a53bc1..42edd92 100644
--- a/target/product/cfi-common.mk
+++ b/target/product/cfi-common.mk
@@ -17,7 +17,7 @@
# This is a set of common components to enable CFI for (across
# compatible product configs)
PRODUCT_CFI_INCLUDE_PATHS := \
- device/google/cuttlefish_common/guest/libs/wpa_supplicant_8_lib \
+ device/google/cuttlefish/guest/libs/wpa_supplicant_8_lib \
device/google/wahoo/wifi_offload \
external/tinyxml2 \
external/wpa_supplicant_8 \
diff --git a/target/product/developer_gsi_keys.mk b/target/product/developer_gsi_keys.mk
new file mode 100644
index 0000000..79451ad
--- /dev/null
+++ b/target/product/developer_gsi_keys.mk
@@ -0,0 +1,29 @@
+#
+# 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.
+#
+
+# Device makers who are willing to support booting the public Developer-GSI
+# in locked state can add the following line into a device.mk to inherit this
+# makefile. This file will then install the up-to-date GSI public keys into
+# the first-stage ramdisk to pass verified boot.
+#
+# In device/<company>/<board>/device.mk:
+# $(call inherit-product, $(SRC_TARGET_DIR)/product/developer_gsi_keys.mk)
+#
+# Currently, the developer GSI images can be downloaded from the following URL:
+# https://developer.android.com/topic/generic-system-image/releases
+#
+PRODUCT_PACKAGES += \
+ q-developer-gsi.avbpubkey \
diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk
index 536fe0c..424cf05 100644
--- a/target/product/gsi/Android.mk
+++ b/target/product/gsi/Android.mk
@@ -162,10 +162,14 @@
# TODO(b/141450808): remove following VNDK phony targets when **.libraries.txt files are provided by apexes.
LOCAL_REQUIRED_MODULES := \
$(foreach vndk_ver,$(PRODUCT_EXTRA_VNDK_VERSIONS),vndk_v$(vndk_ver)_$(TARGET_ARCH)$(_binder32))
-LOCAL_REQUIRED_MODULES += $(foreach vndk_ver,$(PRODUCT_EXTRA_VNDK_VERSIONS),com.android.vndk.v$(vndk_ver))
_binder32 :=
include $(BUILD_PHONY_PACKAGE)
+include $(CLEAR_VARS)
+LOCAL_MODULE := vndk_apex_snapshot_package
+LOCAL_REQUIRED_MODULES := $(foreach vndk_ver,$(PRODUCT_EXTRA_VNDK_VERSIONS),com.android.vndk.v$(vndk_ver))
+include $(BUILD_PHONY_PACKAGE)
+
endif # BOARD_VNDK_VERSION is set
#####################################################################
diff --git a/target/product/gsi_release.mk b/target/product/gsi_release.mk
index aee7959..a6dd418 100644
--- a/target/product/gsi_release.mk
+++ b/target/product/gsi_release.mk
@@ -38,6 +38,12 @@
# Needed by Pi newly launched device to pass VtsTrebleSysProp on GSI
PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true
+# GSI targets should install "unflattened" APEXes in /system
+TARGET_FLATTEN_APEX := false
+
+# GSI targets should install "flattened" APEXes in /system_ext as well
+PRODUCT_INSTALL_EXTRA_FLATTENED_APEXES := true
+
# GSI specific tasks on boot
PRODUCT_PACKAGES += \
gsi_skip_mount.cfg \
diff --git a/target/product/mainline_system.mk b/target/product/mainline_system.mk
index 5a5c17d..ccbc907 100644
--- a/target/product/mainline_system.mk
+++ b/target/product/mainline_system.mk
@@ -21,6 +21,9 @@
# Add adb keys to debuggable AOSP builds (if they exist)
$(call inherit-product-if-exists, vendor/google/security/adb/vendor_key.mk)
+# Enable updating of APEXes
+$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
+
# Shared java libs
PRODUCT_PACKAGES += \
com.android.nfc_extras \
@@ -125,6 +128,14 @@
PRODUCT_NAME := mainline_system
PRODUCT_BRAND := generic
+# Define /system partition-specific product properties to identify that /system
+# partition is mainline_system.
+PRODUCT_SYSTEM_NAME := mainline
+PRODUCT_SYSTEM_BRAND := Android
+PRODUCT_SYSTEM_MANUFACTURER := Android
+PRODUCT_SYSTEM_MODEL := mainline
+PRODUCT_SYSTEM_DEVICE := generic
+
_base_mk_whitelist :=
_my_whitelist := $(_base_mk_whitelist)
diff --git a/target/product/mainline_system_x86_64.mk b/target/product/mainline_system_x86_64.mk
new file mode 100644
index 0000000..1b1a42f
--- /dev/null
+++ b/target/product/mainline_system_x86_64.mk
@@ -0,0 +1,46 @@
+#
+# 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.
+#
+
+#
+# All components inherited here go to system image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk)
+$(call enforce-product-packages-exist,)
+
+# Enable mainline checking
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true
+
+# Enable nonflat APEX
+$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
+
+PRODUCT_BUILD_CACHE_IMAGE := false
+PRODUCT_BUILD_ODM_IMAGE := false
+PRODUCT_BUILD_PRODUCT_IMAGE := false
+PRODUCT_BUILD_RAMDISK_IMAGE := false
+PRODUCT_BUILD_SYSTEM_IMAGE := true
+PRODUCT_BUILD_SYSTEM_EXT_IMAGE := false
+PRODUCT_BUILD_SYSTEM_OTHER_IMAGE := false
+PRODUCT_BUILD_USERDATA_IMAGE := false
+PRODUCT_BUILD_VENDOR_IMAGE := false
+
+PRODUCT_SHIPPING_API_LEVEL := 29
+
+PRODUCT_RESTRICT_VENDOR_FILES := all
+
+PRODUCT_NAME := mainline_system_x86_64
+PRODUCT_DEVICE := mainline_x86_64
+PRODUCT_BRAND := generic
diff --git a/target/product/media_system_ext.mk b/target/product/media_system_ext.mk
index 78cc6aa..2e20af3 100644
--- a/target/product/media_system_ext.mk
+++ b/target/product/media_system_ext.mk
@@ -22,3 +22,4 @@
# /system_ext packages
PRODUCT_PACKAGES += \
+ vndk_apex_snapshot_package \
diff --git a/tools/event_log_tags.py b/tools/event_log_tags.py
index 645839e..35b2de0 100644
--- a/tools/event_log_tags.py
+++ b/tools/event_log_tags.py
@@ -62,9 +62,9 @@
try:
for self.linenum, line in enumerate(file_object):
self.linenum += 1
-
+ line = re.sub('#.*$', '', line) # strip trailing comments
line = line.strip()
- if not line or line[0] == '#': continue
+ if not line: continue
parts = re.split(r"\s+", line, 2)
if len(parts) < 2:
diff --git a/tools/generate-self-extracting-archive.py b/tools/generate-self-extracting-archive.py
index 5a193ab..5b0628d 100755
--- a/tools/generate-self-extracting-archive.py
+++ b/tools/generate-self-extracting-archive.py
@@ -38,7 +38,7 @@
import os
import zipfile
-_HEADER_TEMPLATE = """#!/bin/sh
+_HEADER_TEMPLATE = """#!/bin/bash
#
{comment_line}
#
@@ -92,7 +92,7 @@
dst.write(b)
_MAX_OFFSET_WIDTH = 20
-def _generate_extract_command(start, end, extract_name):
+def _generate_extract_command(start, size, extract_name):
"""Generate the extract command.
The length of this string must be constant no matter what the start and end
@@ -101,7 +101,7 @@
Args:
start: offset in bytes of the start of the wrapped file
- end: offset in bytes of the end of the wrapped file
+ size: size in bytes of the wrapped file
extract_name: of the file to create when extracted
"""
@@ -111,11 +111,11 @@
if len(start_str) != _MAX_OFFSET_WIDTH + 1:
raise Exception('Start offset too large (%d)' % start)
- end_str = ('%d' % end).rjust(_MAX_OFFSET_WIDTH)
- if len(end_str) != _MAX_OFFSET_WIDTH:
- raise Exception('End offset too large (%d)' % end)
+ size_str = ('%d' % size).rjust(_MAX_OFFSET_WIDTH)
+ if len(size_str) != _MAX_OFFSET_WIDTH:
+ raise Exception('Size too large (%d)' % size)
- return "tail -c %s $0 | head -c %s > %s\n" % (start_str, end_str, extract_name)
+ return "tail -c %s $0 | head -c %s > %s\n" % (start_str, size_str, extract_name)
def main(argv):
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
index af508fe..1e7d387 100755
--- a/tools/releasetools/build_image.py
+++ b/tools/releasetools/build_image.py
@@ -315,6 +315,8 @@
elif fs_type.startswith("f2fs"):
build_command = ["mkf2fsuserimg.sh"]
build_command.extend([out_file, prop_dict["image_size"]])
+ if "f2fs_sparse_flag" in prop_dict:
+ build_command.extend([prop_dict["f2fs_sparse_flag"]])
if fs_config:
build_command.extend(["-C", fs_config])
build_command.extend(["-f", in_dir])
@@ -519,6 +521,7 @@
common_props = (
"extfs_sparse_flag",
"squashfs_sparse_flag",
+ "f2fs_sparse_flag",
"skip_fsck",
"ext_mkuserimg",
"verity",
@@ -582,7 +585,6 @@
copy_prop("system_squashfs_compressor", "squashfs_compressor")
copy_prop("system_squashfs_compressor_opt", "squashfs_compressor_opt")
copy_prop("system_squashfs_block_size", "squashfs_block_size")
- copy_prop("system_base_fs_file", "base_fs_file")
copy_prop("system_extfs_inode_count", "extfs_inode_count")
if not copy_prop("system_extfs_rsv_pct", "extfs_rsv_pct"):
d["extfs_rsv_pct"] = "0"
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 3c8d355..556d25a 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -76,6 +76,10 @@
self.boot_signer_args = []
self.verity_signer_path = None
self.verity_signer_args = []
+ self.aftl_server = None
+ self.aftl_key_path = None
+ self.aftl_manufacturer_key_path = None
+ self.aftl_signer_helper = None
self.verbose = False
self.tempfiles = []
self.device_specific = None
@@ -591,26 +595,19 @@
d["root_fs_config"] = os.path.join(
input_file, "META", "root_filesystem_config.txt")
- # Redirect {system,vendor}_base_fs_file.
- if "system_base_fs_file" in d:
- basename = os.path.basename(d["system_base_fs_file"])
- system_base_fs_file = os.path.join(input_file, "META", basename)
- if os.path.exists(system_base_fs_file):
- d["system_base_fs_file"] = system_base_fs_file
+ # Redirect {partition}_base_fs_file for each of the named partitions.
+ for part_name in ["system", "vendor", "system_ext", "product", "odm"]:
+ key_name = part_name + "_base_fs_file"
+ if key_name not in d:
+ continue
+ basename = os.path.basename(d[key_name])
+ base_fs_file = os.path.join(input_file, "META", basename)
+ if os.path.exists(base_fs_file):
+ d[key_name] = base_fs_file
else:
logger.warning(
- "Failed to find system base fs file: %s", system_base_fs_file)
- del d["system_base_fs_file"]
-
- if "vendor_base_fs_file" in d:
- basename = os.path.basename(d["vendor_base_fs_file"])
- vendor_base_fs_file = os.path.join(input_file, "META", basename)
- if os.path.exists(vendor_base_fs_file):
- d["vendor_base_fs_file"] = vendor_base_fs_file
- else:
- logger.warning(
- "Failed to find vendor base fs file: %s", vendor_base_fs_file)
- del d["vendor_base_fs_file"]
+ "Failed to find %s base fs file: %s", part_name, base_fs_file)
+ del d[key_name]
def makeint(key):
if key in d:
@@ -966,6 +963,12 @@
RunAndCheckOutput(cmd)
+ 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.
def _MakeRamdisk(sourcedir, fs_config_file=None):
ramdisk_img = tempfile.NamedTemporaryFile()
@@ -1817,7 +1820,8 @@
"java_path=", "java_args=", "public_key_suffix=",
"private_key_suffix=", "boot_signer_path=", "boot_signer_args=",
"verity_signer_path=", "verity_signer_args=", "device_specific=",
- "extra=", "logfile="] +
+ "extra=", "logfile=", "aftl_server=", "aftl_key_path=",
+ "aftl_manufacturer_key_path=", "aftl_signer_helper="] +
list(extra_long_opts))
except getopt.GetoptError as err:
Usage(docstring)
@@ -1854,6 +1858,14 @@
OPTIONS.verity_signer_path = a
elif o in ("--verity_signer_args",):
OPTIONS.verity_signer_args = shlex.split(a)
+ elif o in ("--aftl_server",):
+ OPTIONS.aftl_server = a
+ elif o in ("--aftl_key_path",):
+ OPTIONS.aftl_key_path = a
+ elif o in ("--aftl_manufacturer_key_path",):
+ OPTIONS.aftl_manufacturer_key_path = a
+ elif o in ("--aftl_signer_helper",):
+ OPTIONS.aftl_signer_helper = a
elif o in ("-s", "--device_specific"):
OPTIONS.device_specific = a
elif o in ("-x", "--extra"):
diff --git a/tools/releasetools/sign_apex.py b/tools/releasetools/sign_apex.py
index f2daa46..4c0850c 100755
--- a/tools/releasetools/sign_apex.py
+++ b/tools/releasetools/sign_apex.py
@@ -44,7 +44,7 @@
def SignApexFile(avbtool, apex_file, payload_key, container_key,
- signing_args=None):
+ no_hashtree, signing_args=None):
"""Signs the given apex file."""
with open(apex_file, 'rb') as input_fp:
apex_data = input_fp.read()
@@ -56,7 +56,7 @@
container_key=container_key,
container_pw=None,
codename_to_api_level_map=None,
- no_hashtree=False,
+ no_hashtree=no_hashtree,
signing_args=signing_args)
diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py
index 0f4f1da..35b11c1 100755
--- a/tools/releasetools/sign_target_files_apks.py
+++ b/tools/releasetools/sign_target_files_apks.py
@@ -972,6 +972,7 @@
devkeydir + "/media": d + "/media",
devkeydir + "/shared": d + "/shared",
devkeydir + "/platform": d + "/platform",
+ devkeydir + "/networkstack": d + "/networkstack",
})
else:
OPTIONS.key_map[s] = d
diff --git a/tools/releasetools/test_sign_apex.py b/tools/releasetools/test_sign_apex.py
index b4ef127..79d1de4 100644
--- a/tools/releasetools/test_sign_apex.py
+++ b/tools/releasetools/test_sign_apex.py
@@ -38,5 +38,6 @@
'avbtool',
foo_apex,
payload_key,
- container_key)
+ container_key,
+ False)
self.assertTrue(os.path.exists(signed_foo_apex))