From fbba7fe06312241c7eb8c592ec2ac630e4316d55 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Tue, 25 Apr 2017 15:44:25 +0100 Subject: [PATCH 001/123] main.mk: Set dalvik.vm.stack-trace-dir ... instead of dalvik.vm.stack-trace-file. Turns on the new stack dumping scheme. Each dump is now output to a separate file. Bug: 32064548 Test: Manual, unit tests included in other components. Change-Id: I762b09148786e8533fd285d5bae0121ed46dfbe0 --- core/main.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/main.mk b/core/main.mk index b50e0e7c4c..5b0e55c217 100644 --- a/core/main.mk +++ b/core/main.mk @@ -313,7 +313,7 @@ ADDITIONAL_BUILD_PROPERTIES += net.bt.name=Android # Sets the location that the runtime dumps stack traces to when signalled # with SIGQUIT. Stack trace dumping is turned on for all android builds. -ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.stack-trace-file=/data/anr/traces.txt +ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.stack-trace-dir=/data/anr # ------------------------------------------------------------ # Define a function that, given a list of module tags, returns From bae7ee5d9e522cecd996dbf15fa39255f6e9bab6 Mon Sep 17 00:00:00 2001 From: Todd Lee Date: Thu, 1 Jun 2017 08:00:32 -0700 Subject: [PATCH 002/123] add support for test suites with 'prebuilt tools' - prebuilt tools copied directly to /tools subdir of zip - currently only used by wts, noop for other suites Bug: b/62102556 Change-Id: I796d7490f39f817af8f2ec5bea86593182bfcbe2 --- core/tasks/tools/compatibility.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/tasks/tools/compatibility.mk b/core/tasks/tools/compatibility.mk index 20b831409b..0fc20452a9 100644 --- a/core/tasks/tools/compatibility.mk +++ b/core/tasks/tools/compatibility.mk @@ -19,6 +19,8 @@ # test_suite_tradefed: the name of this test suite's tradefed wrapper # test_suite_dynamic_config: the path to this test suite's dynamic configuration file # test_suite_readme: the path to a README file for this test suite +# test_suite_prebuilt_tools: the set of prebuilt tools to be included directly +# in the 'tools' subdirectory of the test suite. # Output variables: # compatibility_zip: the path to the output zip file. @@ -39,10 +41,10 @@ test_tools := $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar \ compatibility_zip := $(out_dir).zip $(compatibility_zip): PRIVATE_NAME := android-$(test_suite_name) $(compatibility_zip): PRIVATE_OUT_DIR := $(out_dir) -$(compatibility_zip): PRIVATE_TOOLS := $(test_tools) +$(compatibility_zip): PRIVATE_TOOLS := $(test_tools) $(test_suite_prebuilt_tools) $(compatibility_zip): PRIVATE_SUITE_NAME := $(test_suite_name) $(compatibility_zip): PRIVATE_DYNAMIC_CONFIG := $(test_suite_dynamic_config) -$(compatibility_zip): $(test_artifacts) $(test_tools) $(test_suite_dynamic_config) $(SOONG_ZIP) | $(ADB) $(ACP) +$(compatibility_zip): $(test_artifacts) $(test_tools) $(test_suite_prebuilt_tools) $(test_suite_dynamic_config) $(SOONG_ZIP) | $(ADB) $(ACP) # Make dir structure $(hide) mkdir -p $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/testcases # Copy tools @@ -56,3 +58,4 @@ test_suite_name := test_suite_tradefed := test_suite_dynamic_config := test_suite_readme := +test_suite_prebuilt_tools := From 74d69626a9359cf7d6d8c1b7d973badad80cbb2e Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 7 Jun 2017 13:20:07 -0700 Subject: [PATCH 003/123] Master is now OPM1 Remove OPD1 from master. Also remove the temporary workaround for b/37208937. Bug: 37208937 Bug: 38436796 Bug: 62596317 Test: builds Change-Id: Id4ea864e1d78bb793b2d4a0705673a66a957acdb --- core/version_defaults.mk | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index af457f8945..15a0eb92f3 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -38,8 +38,8 @@ ifdef INTERNAL_BUILD_ID_MAKEFILE include $(INTERNAL_BUILD_ID_MAKEFILE) endif -DEFAULT_PLATFORM_VERSION := OPD1 -MIN_PLATFORM_VERSION := OPD1 +DEFAULT_PLATFORM_VERSION := OPM1 +MIN_PLATFORM_VERSION := OPM1 MAX_PLATFORM_VERSION := PPR1 ALLOWED_VERSIONS := $(call allowed-platform-versions,\ @@ -49,12 +49,6 @@ ALLOWED_VERSIONS := $(call allowed-platform-versions,\ ifndef TARGET_PLATFORM_VERSION TARGET_PLATFORM_VERSION := $(DEFAULT_PLATFORM_VERSION) -else ifeq ($(TARGET_PLATFORM_VERSION),OPR1) - # HACK: lunch currently sets TARGET_PLATFORM_VERSION to - # DEFAULT_PLATFORM_VERSION, which causes unnecessary pain - # when the old DEFAULT_PLATFORM_VERSION becomes invalid. - # For now, silently upgrade OPR1 to the current default. - TARGET_PLATFORM_VERSION := $(DEFAULT_PLATFORM_VERSION) endif ifeq (,$(filter $(ALLOWED_VERSIONS), $(TARGET_PLATFORM_VERSION))) @@ -79,13 +73,11 @@ endif # When you change PLATFORM_VERSION for a given PLATFORM_SDK_VERSION # please add that PLATFORM_VERSION to the following text file: # cts/tests/tests/os/assets/platform_versions.txt -PLATFORM_VERSION.OPD1 := 8.0.1 PLATFORM_VERSION.OPM1 := OMR1 PLATFORM_VERSION.PPR1 := P # 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.OPD1 := REL PLATFORM_VERSION_CODENAME.OPM1 := OMR1 PLATFORM_VERSION_CODENAME.PPR1 := P From f33a96c07f81fd76a7aeeed5fbc591c779a5aa8e Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Thu, 15 Jun 2017 09:46:58 -0700 Subject: [PATCH 004/123] core: Move core.oat bootjar definitions into envsetup.mk TARGET_CORE_JARS and HOST_CORE_JARS define the minimal bootclasspath jars necessary to run with dalvikvm/art. Also refactor PRODUCT_BOOT_JARS in core-tiny.mk and core-minimal.mk to reuse TARGET_CORE_JARS. The above variables can be used from scripts with get_build_var from envsetup.sh $> get_build_var TARGET_CORE_JARS (These changes are required to figure out what --bootclasspath_entry to pass to desugar). Bug: 36902714 Test: make -j32 build-art-host build-art-target Test: lunch aosp_angler-userdebug && make -j32 Test: make -j32 PRODUCT-sdk_google_aw_x86-sdk Change-Id: If12569719343bfbba20c1cda9a5302ab541dbfc6 --- core/envsetup.mk | 7 +++++++ target/product/core_minimal.mk | 11 +++++------ target/product/core_tiny.mk | 11 +++++------ target/product/runtime_libart.mk | 11 +++++------ 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/core/envsetup.mk b/core/envsetup.mk index 43593e63c3..27cfd7f9f7 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -190,6 +190,13 @@ _vendor_path_placeholder := ||VENDOR-PATH-PH|| TARGET_COPY_OUT_VENDOR := $(_vendor_path_placeholder) ########################################### +################################################################# +# Set up minimal BOOTCLASSPATH list of jars to build/execute +# java code with dalvikvm/art. +TARGET_CORE_JARS := core-oj core-libart conscrypt okhttp bouncycastle apache-xml +HOST_CORE_JARS := $(addsuffix -hostdex,$(TARGET_CORE_JARS)) +################################################################# + # Read the product specs so we can get TARGET_DEVICE and other # variables that we need in order to locate the output files. include $(BUILD_SYSTEM)/product_config.mk diff --git a/target/product/core_minimal.mk b/target/product/core_minimal.mk index 5a18c7093f..e521cc30be 100644 --- a/target/product/core_minimal.mk +++ b/target/product/core_minimal.mk @@ -98,20 +98,19 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.software.preview_sdk.xml:system/etc/permissions/android.software.preview_sdk.xml endif +ifeq ($(TARGET_CORE_JARS),) +$(error TARGET_CORE_JARS is empty; cannot initialize PRODUCT_BOOT_JARS variable) +endif + # The order of PRODUCT_BOOT_JARS matters. PRODUCT_BOOT_JARS := \ - core-oj \ - core-libart \ - conscrypt \ - okhttp \ + $(TARGET_CORE_JARS) \ legacy-test \ - bouncycastle \ ext \ framework \ telephony-common \ voip-common \ ims-common \ - apache-xml \ org.apache.http.legacy.boot \ android.hidl.base-V1.0-java \ android.hidl.manager-V1.0-java diff --git a/target/product/core_tiny.mk b/target/product/core_tiny.mk index e9920f2a75..5ced1a6ab1 100644 --- a/target/product/core_tiny.mk +++ b/target/product/core_tiny.mk @@ -85,20 +85,19 @@ PRODUCT_PACKAGES += \ logd \ wifi-service +ifeq ($(TARGET_CORE_JARS),) +$(error TARGET_CORE_JARS is empty; cannot initialize PRODUCT_BOOT_JARS variable) +endif + # The order matters PRODUCT_BOOT_JARS := \ - core-oj \ - core-libart \ - conscrypt \ - okhttp \ + $(TARGET_CORE_JARS) \ legacy-test \ - bouncycastle \ ext \ framework \ telephony-common \ voip-common \ ims-common \ - apache-xml \ nullwebview \ org.apache.http.legacy.boot \ android.hidl.base-V1.0-java \ diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk index 0755bf3cfb..c1b5c64122 100644 --- a/target/product/runtime_libart.mk +++ b/target/product/runtime_libart.mk @@ -16,15 +16,14 @@ # Provides a functioning ART environment without Android frameworks +ifeq ($(TARGET_CORE_JARS),) +$(error TARGET_CORE_JARS is empty; cannot update PRODUCT_PACKAGES variable) +endif + # Minimal boot classpath. This should be a subset of PRODUCT_BOOT_JARS, and equivalent to # TARGET_CORE_JARS. PRODUCT_PACKAGES += \ - apache-xml \ - bouncycastle \ - core-oj \ - core-libart \ - conscrypt \ - okhttp \ + $(TARGET_CORE_JARS) # Additional mixins to the boot classpath. PRODUCT_PACKAGES += \ From f3251ac73b0320bf9ae6c2e1d623dba9026e1d7c Mon Sep 17 00:00:00 2001 From: Suren Baghdasaryan Date: Thu, 15 Jun 2017 19:04:22 -0700 Subject: [PATCH 005/123] Add makefile to define PRODUCT_SHIPPING_API_LEVEL for O release For Android O release PRODUCT_SHIPPING_API_LEVEL is set to 26. Change-Id: Ie1d5af375f2db95850fc5395d6a0c775dbfa046d --- target/product/product_launched_with_o.mk | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 target/product/product_launched_with_o.mk diff --git a/target/product/product_launched_with_o.mk b/target/product/product_launched_with_o.mk new file mode 100644 index 0000000000..94d30c65a7 --- /dev/null +++ b/target/product/product_launched_with_o.mk @@ -0,0 +1,2 @@ +#PRODUCT_SHIPPING_API_LEVEL indicates the first api level, device has been commercially launced on. +PRODUCT_SHIPPING_API_LEVEL := 26 From b8d3cc02cdbb2708deb699ec00b6d1e3fd291196 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 16 Jun 2017 11:17:53 -0700 Subject: [PATCH 006/123] Allow custom compiler filters for system server jars Passing down a compiler filter in LOCAL_DEX_PREOPT_FLAGS or PRODUCT_DEX_PREOPT_DEFAULT_FLAGS will no longer always get overridden to speed. Bug: 62356545 Test: make and flash Change-Id: I8b777c8881cba6b11cda56d27f0a714c92d70d94 --- core/dex_preopt_odex_install.mk | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index 2b401f00b5..9c543dde14 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -175,17 +175,17 @@ LOCAL_DEX_PREOPT_FLAGS := $(PRODUCT_DEX_PREOPT_DEFAULT_FLAGS) endif endif -ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS) $(PRODUCT_DEXPREOPT_SPEED_APPS) $(PRODUCT_SYSTEM_SERVER_APPS),$(LOCAL_MODULE))) - # Jars of system server, apps loaded into system server, and apps the product wants to be - # compiled with the 'speed' compiler filter. - LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed -else - # If no compiler filter is specified, default to 'quicken' to save on storage. - ifeq (,$(filter --compiler-filter=%, $(LOCAL_DEX_PREOPT_FLAGS))) +ifeq (,$(filter --compiler-filter=%, $(LOCAL_DEX_PREOPT_FLAGS))) + ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS) $(PRODUCT_DEXPREOPT_SPEED_APPS) $(PRODUCT_SYSTEM_SERVER_APPS),$(LOCAL_MODULE))) + # Jars of system server, apps loaded into system server, and apps the product default to being + # compiled with the 'speed' compiler filter. + LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed + else ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE)) # For non system server jars, use speed-profile when we have a profile. LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed-profile else + # If no compiler filter is specified, default to 'quicken' to save on storage. LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=quicken endif endif From ea7956e2dad49887ada5aecb182f6b5218eff7ed Mon Sep 17 00:00:00 2001 From: Robert Quattlebaum Date: Wed, 8 Feb 2017 17:53:22 -0800 Subject: [PATCH 007/123] Support for android.net.lowpan in frameworks/base Bug: b/33073713 (cherry picked from commit b2cbafe06eac70c18e1066b454837ed3a5914bff) Change-Id: I9ddb52a14d2a2fffb2b8dc924ceb277f9076b19a --- core/pathmap.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/core/pathmap.mk b/core/pathmap.mk index 45213bbe30..728a309be6 100644 --- a/core/pathmap.mk +++ b/core/pathmap.mk @@ -86,6 +86,7 @@ FRAMEWORKS_BASE_SUBDIRS := \ telecomm \ telephony \ wifi \ + lowpan \ keystore \ rs \ ) From 3abc30baa54fdacd137ca1855d27d8b452755b48 Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Tue, 16 May 2017 18:31:19 -0700 Subject: [PATCH 008/123] cas: add CAS hal to build bug: 22804304 Change-Id: I05604644854a561bc9356bb66bcd7d315e3f2d5a --- target/product/base.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/base.mk b/target/product/base.mk index 392f432ff6..c209b3956c 100644 --- a/target/product/base.mk +++ b/target/product/base.mk @@ -140,6 +140,7 @@ PRODUCT_PACKAGES += \ # Essential HAL modules PRODUCT_PACKAGES += \ + android.hardware.cas@1.0-service \ android.hardware.media.omx@1.0-service # XML schema files From 4261cdc47c5043893b927aa7c14d20517e9a6bf0 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Fri, 23 Jun 2017 10:46:14 -0700 Subject: [PATCH 009/123] Remove previous implementation of RadioService. Bug: b/36863239 Test: instrumentalization Change-Id: Ic47b3aad2e7b9662059451bebf87ec55807a6c7c --- target/product/base.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/product/base.mk b/target/product/base.mk index 392f432ff6..f1c81e9940 100644 --- a/target/product/base.mk +++ b/target/product/base.mk @@ -76,8 +76,6 @@ PRODUCT_PACKAGES += \ libnetlink \ libnetutils \ libpdfium \ - libradio \ - libradioservice \ libradio_metadata \ libreference-ril \ libreverbwrapper \ From 6a90210c62a76925827fd65f5e7e96318eb9ac5a Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 23 Jun 2017 10:44:45 -0700 Subject: [PATCH 010/123] Add product system server compiler filter property The product only needs to specify PRODUCT_SYSTEM_SERVER_COMPILER_FILTER. This determines what compiler filter system server jars are compiled with. Test: update marlin device Test: make and look at services.odex Bug: 62356545 Change-Id: Id51726ae03576d7b4eb784b861158bb451c39deb --- core/dex_preopt_odex_install.mk | 28 +++++++++++++++++++--------- core/main.mk | 5 +++++ core/product.mk | 1 + core/product_config.mk | 3 +++ 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index 9c543dde14..76d56c05b2 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -175,18 +175,28 @@ LOCAL_DEX_PREOPT_FLAGS := $(PRODUCT_DEX_PREOPT_DEFAULT_FLAGS) endif endif +my_system_server_compiler_filter := $(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER) +ifeq (,$(my_system_server_compiler_filter)) +my_system_server_compiler_filter := speed +endif + ifeq (,$(filter --compiler-filter=%, $(LOCAL_DEX_PREOPT_FLAGS))) - ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS) $(PRODUCT_DEXPREOPT_SPEED_APPS) $(PRODUCT_SYSTEM_SERVER_APPS),$(LOCAL_MODULE))) - # Jars of system server, apps loaded into system server, and apps the product default to being - # compiled with the 'speed' compiler filter. - LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed + ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS),$(LOCAL_MODULE))) + # Jars of system server, use the product option if it is set, speed otherwise. + LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=$(my_system_server_compiler_filter) else - ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE)) - # For non system server jars, use speed-profile when we have a profile. - LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed-profile + ifneq (,$(filter $(PRODUCT_DEXPREOPT_SPEED_APPS) $(PRODUCT_SYSTEM_SERVER_APPS),$(LOCAL_MODULE))) + # Apps loaded into system server, and apps the product default to being compiled with the + # 'speed' compiler filter. + LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed else - # If no compiler filter is specified, default to 'quicken' to save on storage. - LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=quicken + ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE)) + # For non system server jars, use speed-profile when we have a profile. + LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed-profile + else + # If no compiler filter is specified, default to 'quicken' to save on storage. + LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=quicken + endif endif endif endif diff --git a/core/main.mk b/core/main.mk index a70274c055..b30a70b239 100644 --- a/core/main.mk +++ b/core/main.mk @@ -227,6 +227,11 @@ ifdef TARGET_2ND_ARCH endif endif +# Add the system server compiler filter if they are specified for the product. +ifneq (,$(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER)) +ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.systemservercompilerfilter=$(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER) +endif + ## user/userdebug ## user_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT)) diff --git a/core/product.mk b/core/product.mk index fd22532ae6..9314a36a53 100644 --- a/core/product.mk +++ b/core/product.mk @@ -124,6 +124,7 @@ _product_var_list := \ PRODUCT_DEX_PREOPT_DEFAULT_FLAGS \ PRODUCT_DEX_PREOPT_BOOT_FLAGS \ PRODUCT_DEX_PREOPT_PROFILE_DIR \ + PRODUCT_SYSTEM_SERVER_COMPILER_FILTER \ PRODUCT_SANITIZER_MODULE_CONFIGS \ PRODUCT_SYSTEM_BASE_FS_PATH \ PRODUCT_VENDOR_BASE_FS_PATH \ diff --git a/core/product_config.mk b/core/product_config.mk index 8b908daf32..c39b822505 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -383,6 +383,9 @@ PRODUCT_DEX_PREOPT_BOOT_FLAGS := \ PRODUCT_DEX_PREOPT_PROFILE_DIR := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_PROFILE_DIR)) +PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := \ + $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_COMPILER_FILTER)) + # Resolve and setup per-module dex-preopt configs. PRODUCT_DEX_PREOPT_MODULE_CONFIGS := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_MODULE_CONFIGS)) From de05f89bd3ff5d59297eb40ac594cbb2676d3eb6 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 18 Apr 2017 14:23:21 -0700 Subject: [PATCH 011/123] Enable missing dependency checks With this enabled, we'll check the entire build graph for missing dependencies -- even if you don't need to build the module. So it'll present more errors, but surface them earlier. These can be turned off manually with an environment variable if the branch is expected to have missing dependencies: ALLOW_MISSING_DEPENDENCIES=true SOONG_ALLOW_MISSING_DEPENDENCIES=true (previous method) That will be set automatically when using 'mm', which doesn't load the entire build graph. It will also be set when using 'tapas' to build unbundled apps, since those are usually on reduced branches. This provides better error messages when a library is missing: system/core/init/Android.mk: error: init_tests (NATIVE_TESTS android-arm64) missing libinit (SHARED_LIBRARIES android-arm64) Available variants: libinit (STATIC_LIBRARIES android-arm64) libinit (STATIC_LIBRARIES android-arm) You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build. system/core/init/Android.mk: error: init_tests (NATIVE_TESTS android-arm) missing libinit (SHARED_LIBRARIES android-arm) Available variants: libinit (STATIC_LIBRARIES android-arm64) libinit (STATIC_LIBRARIES android-arm) You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build. build/core/main.mk:852: error: exiting from previous errors. instead of: ninja: error: 'out/target/product/generic_arm64/obj/SHARED_LIBRARIES/libinit_intermediates/export_includes', needed by 'out/target/product/generic_arm64/obj/NATIVE_TESTS/init_tests_intermediates/import_includes', missing and no known rule to make it Bug: 37572490 Test: Manually introduce errors, check for expected output Test: multiproduct_kati, no new breakages Change-Id: I5847f813045929813214137403c499b44ef67907 --- core/main.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/main.mk b/core/main.mk index b30a70b239..08260dac7e 100644 --- a/core/main.mk +++ b/core/main.mk @@ -709,8 +709,7 @@ $(foreach t,$($(2).TYPE),\ endef # TODO: Verify all branches/configs have reasonable warnings/errors, and remove -# these overrides -link-type-missing = $(eval $$(1).MISSING := true) +# this override verify-link-type = $(eval $$(1).MISSING := true) $(foreach lt,$(ALL_LINK_TYPES),\ From af4bde42396b9a770370002d74a2b0658f20d0f1 Mon Sep 17 00:00:00 2001 From: Bryan Eyler Date: Mon, 26 Jun 2017 11:44:36 -0700 Subject: [PATCH 012/123] Re-compute DX command if it changes for PDK. Bug 62360631 Tested build of PDK. Change-Id: I7cbd649a8a3ce4326e513d5a808b76fbb011d99e --- core/config.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/core/config.mk b/core/config.mk index cc9ef25c96..d88cc4c9eb 100644 --- a/core/config.mk +++ b/core/config.mk @@ -554,6 +554,7 @@ SIGNAPK_JAR := $(prebuilt_sdk_tools)/lib/signapk$(COMMON_JAVA_PACKAGE_SUFFIX) SIGNAPK_JNI_LIBRARY_PATH := $(prebuilt_sdk_tools)/$(HOST_OS)/lib64 DX := $(prebuilt_sdk_tools)/dx +DX_COMMAND := $(DX) -JXms16M -JXmx2048M MAINDEXCLASSES := $(prebuilt_sdk_tools)/mainDexClasses # Don't use prebuilts in PDK From 94f5f93236bf6743be674b34ae9cf04a4282bf5c Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 23 Jun 2017 14:47:56 -0700 Subject: [PATCH 013/123] Add PRODUCT_SYSTEM_SERVER_DEBUG_INFO property Used for specifying if a product should get system server mini debug info. Defaults to true. Can be disabled by doing PRODUCT_SYSTEM_SERVER_DEBUG_INFO := false The property overrides WITH_DEXPREOPT_DEBUG_INFO, so if PRODUCT_SYSTEM_SERVER_DEBUG_INFO is true but WITH_DEXPREOPT_DEBUG_INFO is false, system server will have mini debug info. Bug: 62862291 Test: make Change-Id: I189cd144ce3ade5f02855db022874c8dd45cbdf3 --- core/dex_preopt_odex_install.mk | 15 +++++++++++++++ core/product.mk | 1 + core/product_config.mk | 2 ++ 3 files changed, 18 insertions(+) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index 76d56c05b2..136def470a 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -201,6 +201,21 @@ ifeq (,$(filter --compiler-filter=%, $(LOCAL_DEX_PREOPT_FLAGS))) endif endif +# PRODUCT_SYSTEM_SERVER_DEBUG_INFO overrides WITH_DEXPREOPT_DEBUG_INFO. +my_system_server_debug_info := $(PRODUCT_SYSTEM_SERVER_DEBUG_INFO) +ifeq (,$(filter eng, $(TARGET_BUILD_VARIANT))) +# Only enable for non-eng builds. +ifeq (,$(my_system_server_debug_info)) +my_system_server_debug_info := true +endif +endif + +ifeq (true, $(my_system_server_debug_info)) + ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS),$(LOCAL_MODULE))) + LOCAL_DEX_PREOPT_FLAGS += --generate-mini-debug-info + endif +endif + $(built_odex): PRIVATE_DEX_PREOPT_FLAGS := $(LOCAL_DEX_PREOPT_FLAGS) $(built_vdex): $(built_odex) $(built_art): $(built_odex) diff --git a/core/product.mk b/core/product.mk index 9314a36a53..8551737e5d 100644 --- a/core/product.mk +++ b/core/product.mk @@ -120,6 +120,7 @@ _product_var_list := \ PRODUCT_VERITY_SIGNING_KEY \ PRODUCT_SYSTEM_VERITY_PARTITION \ PRODUCT_VENDOR_VERITY_PARTITION \ + PRODUCT_SYSTEM_SERVER_DEBUG_INFO \ PRODUCT_DEX_PREOPT_MODULE_CONFIGS \ PRODUCT_DEX_PREOPT_DEFAULT_FLAGS \ PRODUCT_DEX_PREOPT_BOOT_FLAGS \ diff --git a/core/product_config.mk b/core/product_config.mk index c39b822505..0676af1fa5 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -385,6 +385,8 @@ PRODUCT_DEX_PREOPT_PROFILE_DIR := \ PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_COMPILER_FILTER)) +PRODUCT_SYSTEM_SERVER_DEBUG_INFO := \ + $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_DEBUG_INFO)) # Resolve and setup per-module dex-preopt configs. PRODUCT_DEX_PREOPT_MODULE_CONFIGS := \ From 572a3df7fcf1b45c484a569197e687faa80f29f8 Mon Sep 17 00:00:00 2001 From: Shubham Ajmera Date: Thu, 15 Jun 2017 13:49:10 -0700 Subject: [PATCH 014/123] Add compiler filter for inactive app downgrade Bug: 36598475 Test: Verified the property value on the device Change-Id: I8afcffcb7064ff6a3b97c26ee18aa22f969ffef3 --- target/product/runtime_libart.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk index 24eeff9111..ed68c7838f 100644 --- a/target/product/runtime_libart.mk +++ b/target/product/runtime_libart.mk @@ -82,4 +82,5 @@ endif PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ pm.dexopt.install=quicken \ pm.dexopt.bg-dexopt=speed-profile \ - pm.dexopt.ab-ota=speed-profile + pm.dexopt.ab-ota=speed-profile \ + pm.dexopt.inactive=verify From 7b6320773a313b168f07693f2555700b6a5e27f7 Mon Sep 17 00:00:00 2001 From: bohu Date: Sun, 2 Jul 2017 22:04:58 -0700 Subject: [PATCH 015/123] emulator: fix emulator booting 1. update rild libpath to vendor instead of system Test: build sdk_phone_x86-eng and launch emulator it should boot to home screen. Change-Id: I7b9946e61de952e4b7ae89b740050b768be1cf99 --- target/board/generic/system.prop | 2 +- target/board/generic_arm64/system.prop | 2 +- target/board/generic_mips/system.prop | 2 +- target/board/generic_mips64/system.prop | 2 +- target/board/generic_x86/system.prop | 2 +- target/board/generic_x86_64/system.prop | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/board/generic/system.prop b/target/board/generic/system.prop index f2424c9704..5b2e7bf43e 100644 --- a/target/board/generic/system.prop +++ b/target/board/generic/system.prop @@ -2,5 +2,5 @@ # system.prop for generic sdk # -rild.libpath=/system/lib/libreference-ril.so +rild.libpath=/vendor/lib/libreference-ril.so rild.libargs=-d /dev/ttyS0 diff --git a/target/board/generic_arm64/system.prop b/target/board/generic_arm64/system.prop index 24578a9e33..32c512953b 100644 --- a/target/board/generic_arm64/system.prop +++ b/target/board/generic_arm64/system.prop @@ -2,5 +2,5 @@ # system.prop for generic arm64 sdk # -rild.libpath=/system/lib64/libreference-ril.so +rild.libpath=/vendor/lib64/libreference-ril.so rild.libargs=-d /dev/ttyS0 diff --git a/target/board/generic_mips/system.prop b/target/board/generic_mips/system.prop index 137a0f9b1f..973db2c801 100644 --- a/target/board/generic_mips/system.prop +++ b/target/board/generic_mips/system.prop @@ -2,5 +2,5 @@ # system.prop for generic sdk # -rild.libpath=/system/lib/libreference-ril.so +rild.libpath=/vendor/lib/libreference-ril.so rild.libargs=-d /dev/ttyS0 diff --git a/target/board/generic_mips64/system.prop b/target/board/generic_mips64/system.prop index aa03eae52a..4da69c092f 100644 --- a/target/board/generic_mips64/system.prop +++ b/target/board/generic_mips64/system.prop @@ -2,5 +2,5 @@ # system.prop for generic mips64 sdk # -rild.libpath=/system/lib64/libreference-ril.so +rild.libpath=/vendor/lib64/libreference-ril.so rild.libargs=-d /dev/ttyS0 diff --git a/target/board/generic_x86/system.prop b/target/board/generic_x86/system.prop index 137a0f9b1f..973db2c801 100644 --- a/target/board/generic_x86/system.prop +++ b/target/board/generic_x86/system.prop @@ -2,5 +2,5 @@ # system.prop for generic sdk # -rild.libpath=/system/lib/libreference-ril.so +rild.libpath=/vendor/lib/libreference-ril.so rild.libargs=-d /dev/ttyS0 diff --git a/target/board/generic_x86_64/system.prop b/target/board/generic_x86_64/system.prop index 43d4a88fa0..5e546c4965 100644 --- a/target/board/generic_x86_64/system.prop +++ b/target/board/generic_x86_64/system.prop @@ -2,5 +2,5 @@ # system.prop for generic sdk # -rild.libpath=/system/lib64/libreference-ril.so +rild.libpath=/vendor/lib64/libreference-ril.so rild.libargs=-d /dev/ttyS0 From 77226f63339895b886643b687bcb5b62b9be6f58 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 28 Jun 2017 18:23:37 -0700 Subject: [PATCH 016/123] Add support for using profiles for boot images Added two product flags: PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION If PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE is enabled (default false), a art profile is used to create the preopted boot image. This profile is also passed to the runtime in AndroidRuntime.cpp. The profile is created from the PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION variable that defaults to "frameworks/base/boot-image-profile.txt". Bug: 37966211 Test: make and flash Change-Id: Ic89cc4c0c4d39aa9726843f5d9c2fb1dedeb7885 --- core/dex_preopt_libart.mk | 36 ++++++++++++++++++++++++++++++++++ core/dex_preopt_libart_boot.mk | 17 ++++++++++++---- core/product.mk | 2 ++ core/product_config.mk | 6 ++++++ 4 files changed, 57 insertions(+), 4 deletions(-) diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk index 9db5dbfb47..47fdba610d 100644 --- a/core/dex_preopt_libart.mk +++ b/core/dex_preopt_libart.mk @@ -88,6 +88,42 @@ LIBART_TARGET_BOOT_DEX_FILES := $(foreach jar,$(LIBART_TARGET_BOOT_JARS),$(call LIBART_TARGET_BOOT_ART_EXTRA_FILES := $(foreach jar,$(wordlist 2,999,$(LIBART_TARGET_BOOT_JARS)),boot-$(jar).art boot-$(jar).oat boot-$(jar).vdex) LIBART_TARGET_BOOT_ART_EXTRA_FILES += boot.oat boot.vdex +# If we use a boot image profile. +my_use_profile_for_boot_image := $(PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE) +ifeq (,$(my_use_profile_for_boot_image)) +# If not set, use the default. +my_use_profile_for_boot_image := false +endif + +ifeq (true,$(my_use_profile_for_boot_image)) + +# Location of text based profile for the boot image. +my_boot_image_profile_location := $(PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION) +ifeq (,$(my_boot_image_profile_location)) +# If not set, use the default. +my_boot_image_profile_location := frameworks/base/boot-image-profile.txt +endif + +# Code to create the boot image profile, not in dex_preopt_libart_boot.mk since the profile is the same for all archs. +my_out_boot_image_profile_location := $(DEXPREOPT_BOOT_JAR_DIR_FULL_PATH)/boot.prof +$(my_out_boot_image_profile_location): PRIVATE_PROFILE_INPUT_LOCATION := $(my_boot_image_profile_location) +$(my_out_boot_image_profile_location): $(PROFMAN) $(LIBART_TARGET_BOOT_DEX_FILES) $(my_boot_image_profile_location) + @echo "target profman: $@" + @mkdir -p $(dir $@) + ANDROID_LOG_TAGS="*:e" $(PROFMAN) \ + --create-profile-from=$(PRIVATE_PROFILE_INPUT_LOCATION) \ + $(addprefix --apk=,$(LIBART_TARGET_BOOT_DEX_FILES)) \ + $(addprefix --dex-location=,$(LIBART_TARGET_BOOT_DEX_LOCATIONS)) \ + --reference-profile-file=$@ + +# We want to install the profile even if we are not using preopt since it is required to generate +# the image on the device. +my_installed_profile := $(TARGET_OUT)/etc/boot-image.prof +$(eval $(call copy-one-file,$(my_out_boot_image_profile_location),$(my_installed_profile))) +ALL_DEFAULT_INSTALLED_MODULES += $(my_installed_profile) + +endif + my_2nd_arch_prefix := include $(BUILD_SYSTEM)/dex_preopt_libart_boot.mk diff --git a/core/dex_preopt_libart_boot.mk b/core/dex_preopt_libart_boot.mk index 860a66adb9..6e49f64acf 100644 --- a/core/dex_preopt_libart_boot.mk +++ b/core/dex_preopt_libart_boot.mk @@ -50,18 +50,27 @@ $($(my_2nd_arch_prefix)LIBART_TARGET_BOOT_ART_EXTRA_INSTALLED_FILES) : $($(my_2n @mkdir -p $(dir $@) $(hide) $(ACP) -fp $(dir $<)$(notdir $@) $@ +ifeq (,$(my_out_boot_image_profile_location)) +my_boot_image_flags := $(COMPILED_CLASSES_FLAGS) +my_boot_image_flags += --image-classes=$(PRELOADED_CLASSES) +else +my_boot_image_flags := --compiler-filter=speed-profile +my_boot_image_flags += --profile-file=$(my_out_boot_image_profile_location) +endif + +$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME): PRIVATE_BOOT_IMAGE_FLAGS := $(my_boot_image_flags) $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME): PRIVATE_2ND_ARCH_VAR_PREFIX := $(my_2nd_arch_prefix) # Use dex2oat debug version for better error reporting -$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGET_BOOT_DEX_FILES) $(PRELOADED_CLASSES) $(COMPILED_CLASSES) $(DEX2OAT_DEPENDENCY) +$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGET_BOOT_DEX_FILES) $(PRELOADED_CLASSES) $(COMPILED_CLASSES) $(DEX2OAT_DEPENDENCY) $(my_out_profile_location) @echo "target dex2oat: $@" @mkdir -p $(dir $@) @mkdir -p $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED)) @rm -f $(dir $@)/*.art $(dir $@)/*.oat @rm -f $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))/*.art @rm -f $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))/*.oat - $(hide) ANDROID_LOG_TAGS="*:e" $(DEX2OAT) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \ + $(DEX2OAT) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \ --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \ - --image-classes=$(PRELOADED_CLASSES) \ + $(PRIVATE_BOOT_IMAGE_FLAGS) \ $(addprefix --dex-file=,$(LIBART_TARGET_BOOT_DEX_FILES)) \ $(addprefix --dex-location=,$(LIBART_TARGET_BOOT_DEX_LOCATIONS)) \ --oat-symbols=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED) \ @@ -75,4 +84,4 @@ $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGE --runtime-arg -Xnorelocate --compile-pic \ --no-generate-debug-info --generate-build-id \ --multi-image --no-inline-from=core-oj.jar \ - $(PRODUCT_DEX_PREOPT_BOOT_FLAGS) $(GLOBAL_DEXPREOPT_FLAGS) $(COMPILED_CLASSES_FLAGS) $(ART_BOOT_IMAGE_EXTRA_ARGS) + $(PRODUCT_DEX_PREOPT_BOOT_FLAGS) $(GLOBAL_DEXPREOPT_FLAGS) $(ART_BOOT_IMAGE_EXTRA_ARGS) diff --git a/core/product.mk b/core/product.mk index c80acf105a..ed387e4cba 100644 --- a/core/product.mk +++ b/core/product.mk @@ -125,6 +125,8 @@ _product_var_list := \ PRODUCT_DEX_PREOPT_DEFAULT_FLAGS \ PRODUCT_DEX_PREOPT_BOOT_FLAGS \ PRODUCT_DEX_PREOPT_PROFILE_DIR \ + PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION \ + PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE \ PRODUCT_SYSTEM_SERVER_COMPILER_FILTER \ PRODUCT_SANITIZER_MODULE_CONFIGS \ PRODUCT_SYSTEM_BASE_FS_PATH \ diff --git a/core/product_config.mk b/core/product_config.mk index 329ef3b718..b46a8ae3cd 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -383,6 +383,12 @@ PRODUCT_DEX_PREOPT_BOOT_FLAGS := \ PRODUCT_DEX_PREOPT_PROFILE_DIR := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_PROFILE_DIR)) +# Boot image options. +PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE := \ + $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE)) +PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION := \ + $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION)) + PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_COMPILER_FILTER)) PRODUCT_SYSTEM_SERVER_DEBUG_INFO := \ From da8694d186a5a82d3fde6af9f182d6cc309ed9db Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Tue, 16 May 2017 19:42:18 -0700 Subject: [PATCH 017/123] Add entry to fwk compat mat. Test: builds and verify that system/compatibility_matrix.xml has configs filled. Test: `vintf | tail` on marlin shows that fwk compat mat is compatible with runtime info. Bug: 38324908 Change-Id: I8a35ea582fea1faa083c409ec58813c3ac82dc9c --- target/board/Android.mk | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/target/board/Android.mk b/target/board/Android.mk index e23ab214d2..331367f598 100644 --- a/target/board/Android.mk +++ b/target/board/Android.mk @@ -83,7 +83,7 @@ $(GEN): PRIVATE_FLAGS := ifeq ($(PRODUCT_FULL_TREBLE),true) ifdef BUILT_VENDOR_MATRIX $(GEN): $(BUILT_VENDOR_MATRIX) -$(GEN): PRIVATE_FLAGS := -c "$(BUILT_VENDOR_MATRIX)" +$(GEN): PRIVATE_FLAGS += -c "$(BUILT_VENDOR_MATRIX)" endif endif @@ -110,7 +110,7 @@ $(GEN): PRIVATE_FLAGS := ifeq ($(PRODUCT_FULL_TREBLE),true) ifdef BUILT_VENDOR_MANIFEST $(GEN): $(BUILT_VENDOR_MANIFEST) -$(GEN): PRIVATE_FLAGS := -c "$(BUILT_VENDOR_MANIFEST)" +$(GEN): PRIVATE_FLAGS += -c "$(BUILT_VENDOR_MANIFEST)" endif endif @@ -130,6 +130,14 @@ else FRAMEWORK_VBMETA_VERSION := 0.0 endif +# All kernel versions that the system image works with. +$(GEN): test/vts-testcase/kernel/config/data/android-3.18/android-base.cfg +$(GEN): test/vts-testcase/kernel/config/data/android-4.4/android-base.cfg +$(GEN): test/vts-testcase/kernel/config/data/android-4.9/android-base.cfg +$(GEN): PRIVATE_FLAGS += --kernel=3.18:test/vts-testcase/kernel/config/data/android-3.18/android-base.cfg +$(GEN): PRIVATE_FLAGS += --kernel=4.4:test/vts-testcase/kernel/config/data/android-4.4/android-base.cfg +$(GEN): PRIVATE_FLAGS += --kernel=4.9:test/vts-testcase/kernel/config/data/android-4.9/android-base.cfg + $(GEN): $(FRAMEWORK_COMPATIBILITY_MATRIX_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf # TODO(b/37405869) (b/37715375) inject avb versions as well for devices that have avb enabled. POLICYVERS=$(POLICYVERS) \ From 599fefae6b69a75bb06985ceaa289ed6882ede89 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Wed, 12 Jul 2017 16:56:43 +0800 Subject: [PATCH 018/123] Add netutils-wrapper to generic system image Bug: 63370530 Test: Build and check the files in system Change-Id: I2b0f1e10dc5f09ac0fa39ee62df999a1de5e537f --- target/product/treble_common.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk index a4bcad6bf3..e7aeb32545 100644 --- a/target/product/treble_common.mk +++ b/target/product/treble_common.mk @@ -205,3 +205,11 @@ PRODUCT_COPY_FILES += \ # audio.a2dp.default to support A2DP if board has the capability. PRODUCT_PACKAGES += \ audio.a2dp.default + +# Net: +# Vendors can use the platform-provided network configuration utilities (ip, +# iptable, etc.) to configure the Linux networking stack, but these utilities +# do not yet include a HIDL interface wrapper. This is a solution on +# Android O. +PRODUCT_PACKAGES += \ + netutils-wrapper-1.0 From 2bc960fd9f67fcc5257943648c5535e39d81b679 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Thu, 13 Jul 2017 16:47:37 +0800 Subject: [PATCH 019/123] Remove unnecessary configs BOARD_USES_VENDORIMAGE is always true if TARGET_COPY_OUT_VENDOR is 'vendor'. Bug: 63609670 Test: build, flash and boot to home screen Change-Id: I719a17f27e046448180e846a6597fa2fbf3c0726 --- target/board/generic_arm64_a/BoardConfig.mk | 2 -- target/board/generic_arm64_ab/BoardConfig.mk | 1 - target/board/generic_arm_a/BoardConfig.mk | 2 -- 3 files changed, 5 deletions(-) diff --git a/target/board/generic_arm64_a/BoardConfig.mk b/target/board/generic_arm64_a/BoardConfig.mk index fbac4171ac..4ecfee614c 100644 --- a/target/board/generic_arm64_a/BoardConfig.mk +++ b/target/board/generic_arm64_a/BoardConfig.mk @@ -41,7 +41,6 @@ ifeq ($(HOST_OS),linux) endif # Generic AOSP image always requires separate vendor.img -BOARD_USES_VENDORIMAGE := true TARGET_COPY_OUT_VENDOR := vendor # Generic AOSP image does NOT support HWC1 @@ -68,4 +67,3 @@ BOARD_NAND_SPARE_SIZE := 0 BOARD_FLASH_BLOCK_SIZE := 512 BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true - diff --git a/target/board/generic_arm64_ab/BoardConfig.mk b/target/board/generic_arm64_ab/BoardConfig.mk index e05f345e4b..d1bba3945c 100644 --- a/target/board/generic_arm64_ab/BoardConfig.mk +++ b/target/board/generic_arm64_ab/BoardConfig.mk @@ -41,7 +41,6 @@ ifeq ($(HOST_OS),linux) endif # Generic AOSP image always requires separate vendor.img -BOARD_USES_VENDORIMAGE := true TARGET_COPY_OUT_VENDOR := vendor # Generic AOSP image does NOT support HWC1 diff --git a/target/board/generic_arm_a/BoardConfig.mk b/target/board/generic_arm_a/BoardConfig.mk index 6c1b36f60f..db3e394f6f 100644 --- a/target/board/generic_arm_a/BoardConfig.mk +++ b/target/board/generic_arm_a/BoardConfig.mk @@ -41,7 +41,6 @@ ifeq ($(HOST_OS),linux) endif # Generic AOSP image always requires separate vendor.img -BOARD_USES_VENDORIMAGE := true TARGET_COPY_OUT_VENDOR := vendor # Generic AOSP image does NOT support HWC1 @@ -60,4 +59,3 @@ BOARD_NAND_SPARE_SIZE := 0 BOARD_FLASH_BLOCK_SIZE := 512 BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true - From 4f612c6f36655437eff450f46e71e6b9d15b3798 Mon Sep 17 00:00:00 2001 From: Jean-Luc Brouillet Date: Fri, 21 Jul 2017 20:11:18 -0700 Subject: [PATCH 020/123] Adds the Neural Networks lib to the base configuration. This will ensure that the library is on all devices even if no builtin apps uses the lib. Bug: 63905942 Test: Ran an application that uses the NN API. Change-Id: I52ce6142f94d21ca55fa26875fab3f4926e2c6bb --- target/product/core_minimal.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/core_minimal.mk b/target/product/core_minimal.mk index e9fbbb1c62..a40f21605b 100644 --- a/target/product/core_minimal.mk +++ b/target/product/core_minimal.mk @@ -72,6 +72,7 @@ PRODUCT_PACKAGES += \ libfilterfw \ libkeystore \ libgatekeeper \ + libneuralnetworks \ libwebviewchromium_loader \ libwebviewchromium_plat_support \ libwilhelm \ From 0f61372f57cae1e759b49d5d340c81ef279e0836 Mon Sep 17 00:00:00 2001 From: Ian Pedowitz Date: Mon, 24 Jul 2017 19:20:32 -0700 Subject: [PATCH 021/123] DO NOT MERGE Setting build_id to OC-MR1 for oc-mr1-dev Bug: 63544673 Test: lunching a target shows 'BUILD_ID=OC-MR1' Change-Id: I0cb3cf6fa27a92a173e40945ad701ccf29bd4d0e --- core/build_id.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/build_id.mk b/core/build_id.mk index 0e8e2cf4bf..ff4d013fb9 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. -export BUILD_ID=MASTER +export BUILD_ID=OC-MR1 From eb2e568df2f56a147170b2de16e169441747fcb0 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 19 Jul 2017 10:33:02 +0900 Subject: [PATCH 022/123] Apks are again allowed to use vendor libs as before When BOARD_VNDK_VERSION is set, native libs that were labeled as native:platform are now divided into native:platform and native:vendor sets depending on their install locations. In order to keep the existing apks to use all the libraries that they have been using, native:vendor is also added to the allowed types for apks. However, in the future when we have vendor SDK and enforce all vendor apks to use the vendor SDK, we will disallow native:vendor to app:platform and native:vendor will be allowed only to those vendor apks (probably labeled as app:vendor). Bug: 33241851 Test: BOARD_VNDK_VERSION=current m (e.g. ModemDiagnosticSystem in internal master) Change-Id: I6ad0967ab17f07be9657b58c20fa9b96bd1a342b Merged-In: I6ad0967ab17f07be9657b58c20fa9b96bd1a342b --- core/install_jni_libs_internal.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/install_jni_libs_internal.mk b/core/install_jni_libs_internal.mk index 0e92153663..b5f10cfabf 100644 --- a/core/install_jni_libs_internal.mk +++ b/core/install_jni_libs_internal.mk @@ -116,7 +116,7 @@ my_allowed_types := native:ndk else my_link_type := app:platform my_warn_types := -my_allowed_types := native:ndk native:platform +my_allowed_types := native:ndk native:platform native:vendor endif my_link_deps := $(addprefix SHARED_LIBRARIES:,$(LOCAL_JNI_SHARED_LIBRARIES)) From 1a5c2dcdc8edee8bb14f3a6dfc8c4454e666f942 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 18 Jul 2017 13:35:27 +0900 Subject: [PATCH 023/123] Don't add .vendor suffix for vendor-only modules Soong now adds .vendor suffix only for modules having both core and vendor variants. Furthermore, names listed in LOCAL_SHARED_LIBRARIES are correct (= have .vendor suffix when the dependent lib has variants). Therefore, make does not need to force add .vendor suffix when parsing modules from soong. Bug: 37480243 Test: BOARD_VNDK_VERSION=current m -j is successful, where is one of the vendor-only libraries in Soong. (i.e. android.hardware.renderscript@1.0-impl) Test: m -j does not break anything Merged-In: Id8d0d01313c63496a10de4cd3ddb9f75180efef6 Change-Id: Id8d0d01313c63496a10de4cd3ddb9f75180efef6 (cherry picked from commit a9c4c71756c8f8d8fa30d5e21408585a66499799) --- core/binary.mk | 16 +++++++--------- core/prebuilt_internal.mk | 10 ++++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/binary.mk b/core/binary.mk index bbc3550947..2679f7f845 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -464,6 +464,8 @@ else my_linker := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)LINKER) endif +# Modules from soong do not need this since the dependencies are already handled there. +ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) include $(BUILD_SYSTEM)/config_sanitizers.mk ifneq ($(LOCAL_NO_LIBCOMPILER_RT),true) @@ -477,6 +479,7 @@ endif ifeq ($($(my_prefix)OS),windows) my_static_libraries += libwinpthread endif +endif # this module is not from soong ifneq ($(filter ../%,$(my_src_files)),) my_soong_problems += dotdot_srcs @@ -1324,14 +1327,9 @@ ifneq ($(LOCAL_USE_VNDK),) ## switch all soong libraries over to the /vendor ## variant. #################################################### - ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) - # Soong-built libraries should always use the .vendor variant - my_whole_static_libraries := $(addsuffix .vendor,$(my_whole_static_libraries)) - my_static_libraries := $(addsuffix .vendor,$(my_static_libraries)) - my_shared_libraries := $(addsuffix .vendor,$(my_shared_libraries)) - my_system_shared_libraries := $(addsuffix .vendor,$(my_system_shared_libraries)) - my_header_libraries := $(addsuffix .vendor,$(my_header_libraries)) - else + ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) + # We don't do this renaming for soong-defined modules since they already have correct + # names (with .vendor suffix when necessary) in their LOCAL_*_LIBRARIES. my_whole_static_libraries := $(foreach l,$(my_whole_static_libraries),\ $(if $(SPLIT_VENDOR.STATIC_LIBRARIES.$(l)),$(l).vendor,$(l))) my_static_libraries := $(foreach l,$(my_static_libraries),\ @@ -1375,7 +1373,7 @@ endif import_includes := $(intermediates)/import_includes import_includes_deps := $(strip \ $(if $(LOCAL_USE_VNDK),\ - $(call intermediates-dir-for,HEADER_LIBRARIES,device_kernel_headers.vendor,$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))/export_includes) \ + $(call intermediates-dir-for,HEADER_LIBRARIES,device_kernel_headers,$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))/export_includes) \ $(foreach l, $(installed_shared_library_module_names), \ $(call intermediates-dir-for,SHARED_LIBRARIES,$(l),$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))/export_includes) \ $(foreach l, $(my_static_libraries) $(my_whole_static_libraries), \ diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index c12084fd2b..de7111135e 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -84,7 +84,11 @@ ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) endif ifdef LOCAL_USE_VNDK - SPLIT_VENDOR.$(LOCAL_MODULE_CLASS).$(patsubst %.vendor,%,$(LOCAL_MODULE)) := 1 + name_without_suffix := $(patsubst %.vendor,%,$(LOCAL_MODULE)) + ifneq ($(name_without_suffix),$(LOCAL_MODULE) + SPLIT_VENDOR.$(LOCAL_MODULE_CLASS).$(name_without_suffix) := 1 + endif + name_without_suffix := endif endif @@ -172,9 +176,7 @@ my_shared_libraries := $(LOCAL_SHARED_LIBRARIES) # Extra shared libraries introduced by LOCAL_CXX_STL. include $(BUILD_SYSTEM)/cxx_stl_setup.mk ifdef LOCAL_USE_VNDK - ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) - my_shared_libraries := $(addsuffix .vendor,$(my_shared_libraries)) - else + ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) my_shared_libraries := $(foreach l,$(my_shared_libraries),\ $(if $(SPLIT_VENDOR.SHARED_LIBRARIES.$(l)),$(l).vendor,$(l))) endif From 37ae422c6f213a1250a6f668e50990837c83d0b0 Mon Sep 17 00:00:00 2001 From: Keun-young Park Date: Thu, 27 Jul 2017 14:11:49 -0700 Subject: [PATCH 024/123] add legacy-android-test java library to PDK platform.zip - Partners building java test using legacy test API needs it. bug: 64121067 Test: make platform-java and check if library is in platform.zip Change-Id: If831f8cc89a386ccb51f46935667057efb3cdf91 --- core/pdk_config.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/core/pdk_config.mk b/core/pdk_config.mk index 8c986d6840..92ba8b781f 100644 --- a/core/pdk_config.mk +++ b/core/pdk_config.mk @@ -18,6 +18,7 @@ PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR += \ target/common/obj/JAVA_LIBRARIES/core-oj_intermediates \ target/common/obj/JAVA_LIBRARIES/core-libart_intermediates \ target/common/obj/JAVA_LIBRARIES/legacy-test_intermediates \ + target/common/obj/JAVA_LIBRARIES/legacy-android-test_intermediates \ target/common/obj/JAVA_LIBRARIES/ext_intermediates \ target/common/obj/JAVA_LIBRARIES/framework_intermediates \ target/common/obj/JAVA_LIBRARIES/ims-common_intermediates \ From 9821e00caaf95cd3301b7c54f2ab46a2e5760545 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Tue, 18 Jul 2017 13:42:12 +0800 Subject: [PATCH 025/123] Share system properties with all GSI project with treble_system.prop Use TARGET_SYSTEM_PROP to assign a common system property file in each GSI BoardConfig.mk Bug: 62647757 Test: make and check the file system/build.prop in out folder Change-Id: Ifb3e02356869f97573a3690a6d67c2b4a9471c46 Merged-In: Ifb3e02356869f97573a3690a6d67c2b4a9471c46 (cherry picked from commit 7e101699094f130965df440ae6e1572a4ab10c08) --- target/board/generic_arm64_a/BoardConfig.mk | 3 +++ target/board/generic_arm64_ab/BoardConfig.mk | 3 +++ target/board/generic_arm64_ab/system.prop | 0 target/board/generic_arm_a/BoardConfig.mk | 3 +++ target/board/generic_arm_a/system.prop | 0 .../board/{generic_arm64_a/system.prop => treble_system.prop} | 0 6 files changed, 9 insertions(+) delete mode 100644 target/board/generic_arm64_ab/system.prop delete mode 100644 target/board/generic_arm_a/system.prop rename target/board/{generic_arm64_a/system.prop => treble_system.prop} (100%) diff --git a/target/board/generic_arm64_a/BoardConfig.mk b/target/board/generic_arm64_a/BoardConfig.mk index 4ecfee614c..e92f84d2c6 100644 --- a/target/board/generic_arm64_a/BoardConfig.mk +++ b/target/board/generic_arm64_a/BoardConfig.mk @@ -17,6 +17,9 @@ # Common boardconfig settings for generic AOSP products targetting mobile # (phone/table) devices. +# System properties +TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop + # Bootloader is not part of generic AOSP image TARGET_NO_BOOTLOADER := true diff --git a/target/board/generic_arm64_ab/BoardConfig.mk b/target/board/generic_arm64_ab/BoardConfig.mk index d1bba3945c..83e44a5f75 100644 --- a/target/board/generic_arm64_ab/BoardConfig.mk +++ b/target/board/generic_arm64_ab/BoardConfig.mk @@ -17,6 +17,9 @@ # Common boardconfig settings for generic AOSP products targetting mobile # (phone/table) devices. +# System properties +TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop + # Bootloader is not part of generic AOSP image TARGET_NO_BOOTLOADER := true diff --git a/target/board/generic_arm64_ab/system.prop b/target/board/generic_arm64_ab/system.prop deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/target/board/generic_arm_a/BoardConfig.mk b/target/board/generic_arm_a/BoardConfig.mk index db3e394f6f..03912485a1 100644 --- a/target/board/generic_arm_a/BoardConfig.mk +++ b/target/board/generic_arm_a/BoardConfig.mk @@ -17,6 +17,9 @@ # Common boardconfig settings for generic AOSP products targetting mobile # (phone/table) devices. +# System properties +TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop + # Bootloader is not part of generic AOSP image TARGET_NO_BOOTLOADER := true diff --git a/target/board/generic_arm_a/system.prop b/target/board/generic_arm_a/system.prop deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/target/board/generic_arm64_a/system.prop b/target/board/treble_system.prop similarity index 100% rename from target/board/generic_arm64_a/system.prop rename to target/board/treble_system.prop From e572132aa63a90e5118fdf8a8a30bf40e7b6f1e6 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Fri, 30 Jun 2017 17:01:10 +0800 Subject: [PATCH 026/123] Add new product aosp_arm_ab The product is for GSI with ARM 32-bits and A/B update. Bug: 38339485 Test: Build pass Change-Id: Ifad208d2e625f30d0a3dd964d53d81257eeefabf Merged-In: Ifad208d2e625f30d0a3dd964d53d81257eeefabf (cherry picked from commit fbc4835faaf7ecacc008d12b1a8d1a04aaf27475) --- target/board/generic_arm_ab/BoardConfig.mk | 68 ++++++++++++++++++++++ target/product/AndroidProducts.mk | 1 + target/product/aosp_arm_ab.mk | 35 +++++++++++ 3 files changed, 104 insertions(+) create mode 100644 target/board/generic_arm_ab/BoardConfig.mk create mode 100644 target/product/aosp_arm_ab.mk diff --git a/target/board/generic_arm_ab/BoardConfig.mk b/target/board/generic_arm_ab/BoardConfig.mk new file mode 100644 index 0000000000..58d597b2fc --- /dev/null +++ b/target/board/generic_arm_ab/BoardConfig.mk @@ -0,0 +1,68 @@ +# +# Copyright (C) 2017 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. +# + +# Common boardconfig settings for generic AOSP products targetting mobile +# (phone/table) devices. + +# System properties +TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop + +# Bootloader is not part of generic AOSP image +TARGET_NO_BOOTLOADER := true + +# Kernel is also not part of generic AOSP image +TARGET_NO_KERNEL := true + +# system.img is always ext4 with sparse option +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false +TARGET_USES_MKE2FS := true + +# Enable dex pre-opt to speed up initial boot +ifeq ($(HOST_OS),linux) + ifeq ($(WITH_DEXPREOPT),) + WITH_DEXPREOPT := true + WITH_DEXPREOPT_PIC := true + ifneq ($(TARGET_BUILD_VARIANT),user) + # Retain classes.dex in APK's for non-user builds + DEX_PREOPT_DEFAULT := nostripping + endif + endif +endif + +# Generic AOSP image always requires separate vendor.img +TARGET_COPY_OUT_VENDOR := vendor + +# Generic AOSP image does NOT support HWC1 +TARGET_USES_HWC2 := true + +TARGET_ARCH := arm +TARGET_ARCH_VARIANT := armv7-a-neon +TARGET_CPU_ABI := armeabi-v7a +TARGET_CPU_ABI2 := armeabi +TARGET_CPU_VARIANT := generic + +# Enable A/B update +TARGET_NO_RECOVERY := true +BOARD_BUILD_SYSTEM_ROOT_IMAGE := true + +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 + +# TODO(b/35790399): remove when b/35790399 is fixed. +BOARD_NAND_SPARE_SIZE := 0 +BOARD_FLASH_BLOCK_SIZE := 512 + +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk index 285fc3930f..19106e01a1 100644 --- a/target/product/AndroidProducts.mk +++ b/target/product/AndroidProducts.mk @@ -52,6 +52,7 @@ PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/generic_mips.mk \ $(LOCAL_DIR)/aosp_arm.mk \ $(LOCAL_DIR)/aosp_arm_a.mk \ + $(LOCAL_DIR)/aosp_arm_ab.mk \ $(LOCAL_DIR)/full.mk \ $(LOCAL_DIR)/aosp_x86.mk \ $(LOCAL_DIR)/aosp_x86_arm.mk \ diff --git a/target/product/aosp_arm_ab.mk b/target/product/aosp_arm_ab.mk new file mode 100644 index 0000000000..423d38fbae --- /dev/null +++ b/target/product/aosp_arm_ab.mk @@ -0,0 +1,35 @@ +# +# Copyright (C) 2017 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. +# + +# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at +# /vendor/[build|default].prop when build split is on. In order to have sysprops +# on the generic system image, place them in build/make/target/board/generic_arm_a/ +# system.prop. + +include build/make/target/product/treble_common.mk + +AB_OTA_UPDATER := true +AB_OTA_PARTITIONS := system +PRODUCT_PACKAGES += \ + update_engine \ + update_verifier + +$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) + +PRODUCT_NAME := aosp_arm_ab +PRODUCT_DEVICE := generic_arm_ab +PRODUCT_BRAND := Android +PRODUCT_MODEL := AOSP on ARM32 From e4648214e8583a86e07f39653d2ee2bf6eafa857 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Mon, 3 Jul 2017 17:34:25 +0800 Subject: [PATCH 027/123] Add new products aosp_x86_a and aosp_x86_64_a The product is for GSI with x86 64-bits and 32-bits without A/B update. Bug: 38339837 Test: Build pass and boot to home screen on 32/64-bits x86 emulator by replacing system image with GSI Change-Id: I9f956bc35ba5700900df7c2fca45bf794684a418 Merged-In: I9f956bc35ba5700900df7c2fca45bf794684a418 (cherry picked from commit 4b189c810e32fb73f0cc9085ec78379011699ab7) --- target/board/generic_x86_64_a/BoardConfig.mk | 68 ++++++++++++++++++++ target/board/generic_x86_a/BoardConfig.mk | 62 ++++++++++++++++++ target/product/AndroidProducts.mk | 2 + target/product/aosp_x86_64_a.mk | 30 +++++++++ target/product/aosp_x86_a.mk | 29 +++++++++ 5 files changed, 191 insertions(+) create mode 100644 target/board/generic_x86_64_a/BoardConfig.mk create mode 100644 target/board/generic_x86_a/BoardConfig.mk create mode 100644 target/product/aosp_x86_64_a.mk create mode 100644 target/product/aosp_x86_a.mk diff --git a/target/board/generic_x86_64_a/BoardConfig.mk b/target/board/generic_x86_64_a/BoardConfig.mk new file mode 100644 index 0000000000..bd1f750e3b --- /dev/null +++ b/target/board/generic_x86_64_a/BoardConfig.mk @@ -0,0 +1,68 @@ +# +# Copyright (C) 2017 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. +# + +# Common boardconfig settings for generic AOSP products targetting mobile +# (phone/table) devices. + +# System properties +TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop + +# Bootloader is not part of generic AOSP image +TARGET_NO_BOOTLOADER := true + +# Kernel is also not part of generic AOSP image +TARGET_NO_KERNEL := true + +# system.img is always ext4 with sparse option +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false +TARGET_USES_MKE2FS := true + +# Enable dex pre-opt to speed up initial boot +ifeq ($(HOST_OS),linux) + ifeq ($(WITH_DEXPREOPT),) + WITH_DEXPREOPT := true + WITH_DEXPREOPT_PIC := true + ifneq ($(TARGET_BUILD_VARIANT),user) + # Retain classes.dex in APK's for non-user builds + DEX_PREOPT_DEFAULT := nostripping + endif + endif +endif + +# Generic AOSP image always requires separate vendor.img +TARGET_COPY_OUT_VENDOR := vendor + +# Generic AOSP image does NOT support HWC1 +TARGET_USES_HWC2 := true + +TARGET_CPU_ABI := x86_64 +TARGET_ARCH := x86_64 +TARGET_ARCH_VARIANT := x86_64 + +TARGET_2ND_CPU_ABI := x86 +TARGET_2ND_ARCH := x86 +TARGET_2ND_ARCH_VARIANT := x86_64 + +TARGET_USES_64_BIT_BINDER := true + +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB + +# TODO(b/35790399): remove when b/35790399 is fixed. +BOARD_NAND_SPARE_SIZE := 0 +BOARD_FLASH_BLOCK_SIZE := 512 + +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/generic_x86_a/BoardConfig.mk b/target/board/generic_x86_a/BoardConfig.mk new file mode 100644 index 0000000000..4ca6ebe86d --- /dev/null +++ b/target/board/generic_x86_a/BoardConfig.mk @@ -0,0 +1,62 @@ +# +# Copyright (C) 2017 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. +# + +# Common boardconfig settings for generic AOSP products targetting mobile +# (phone/table) devices. + +# System properties +TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop + +# Bootloader is not part of generic AOSP image +TARGET_NO_BOOTLOADER := true + +# Kernel is also not part of generic AOSP image +TARGET_NO_KERNEL := true + +# system.img is always ext4 with sparse option +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false +TARGET_USES_MKE2FS := true + +# Enable dex pre-opt to speed up initial boot +ifeq ($(HOST_OS),linux) + ifeq ($(WITH_DEXPREOPT),) + WITH_DEXPREOPT := true + WITH_DEXPREOPT_PIC := true + ifneq ($(TARGET_BUILD_VARIANT),user) + # Retain classes.dex in APK's for non-user builds + DEX_PREOPT_DEFAULT := nostripping + endif + endif +endif + +# Generic AOSP image always requires separate vendor.img +TARGET_COPY_OUT_VENDOR := vendor + +# Generic AOSP image does NOT support HWC1 +TARGET_USES_HWC2 := true + +TARGET_CPU_ABI := x86 +TARGET_ARCH := x86 +TARGET_ARCH_VARIANT := x86 + +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB + +# TODO(b/35790399): remove when b/35790399 is fixed. +BOARD_NAND_SPARE_SIZE := 0 +BOARD_FLASH_BLOCK_SIZE := 512 + +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk index 19106e01a1..b95a28687f 100644 --- a/target/product/AndroidProducts.mk +++ b/target/product/AndroidProducts.mk @@ -55,6 +55,7 @@ PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/aosp_arm_ab.mk \ $(LOCAL_DIR)/full.mk \ $(LOCAL_DIR)/aosp_x86.mk \ + $(LOCAL_DIR)/aosp_x86_a.mk \ $(LOCAL_DIR)/aosp_x86_arm.mk \ $(LOCAL_DIR)/full_x86.mk \ $(LOCAL_DIR)/aosp_mips.mk \ @@ -64,6 +65,7 @@ PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/aosp_arm64_ab.mk \ $(LOCAL_DIR)/aosp_mips64.mk \ $(LOCAL_DIR)/aosp_x86_64.mk \ + $(LOCAL_DIR)/aosp_x86_64_a.mk \ $(LOCAL_DIR)/sdk_phone_armv7.mk \ $(LOCAL_DIR)/sdk_phone_x86.mk \ $(LOCAL_DIR)/sdk_phone_mips.mk \ diff --git a/target/product/aosp_x86_64_a.mk b/target/product/aosp_x86_64_a.mk new file mode 100644 index 0000000000..eab8b4abe6 --- /dev/null +++ b/target/product/aosp_x86_64_a.mk @@ -0,0 +1,30 @@ +# +# Copyright (C) 2017 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. +# + +# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at +# /vendor/[build|default].prop when build split is on. In order to have sysprops +# on the generic system image, place them in build/make/target/board/generic_arm64_a/ +# system.prop. + +include build/make/target/product/treble_common.mk + +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) + +PRODUCT_NAME := aosp_x86_64_a +PRODUCT_DEVICE := generic_x86_64_a +PRODUCT_BRAND := Android +PRODUCT_MODEL := AOSP on x86_64 diff --git a/target/product/aosp_x86_a.mk b/target/product/aosp_x86_a.mk new file mode 100644 index 0000000000..df8410730c --- /dev/null +++ b/target/product/aosp_x86_a.mk @@ -0,0 +1,29 @@ +# +# Copyright (C) 2017 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. +# + +# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at +# /vendor/[build|default].prop when build split is on. In order to have sysprops +# on the generic system image, place them in build/make/target/board/generic_arm64_a/ +# system.prop. + +include build/make/target/product/treble_common.mk + +$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) + +PRODUCT_NAME := aosp_x86_a +PRODUCT_DEVICE := generic_x86_a +PRODUCT_BRAND := Android +PRODUCT_MODEL := AOSP on x86 From 0f0cc8a17f1a07177f26f5c99454e7a93609cd4b Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Mon, 3 Jul 2017 18:28:40 +0800 Subject: [PATCH 028/123] Add new products aosp_x86_ab and aosp_x86_64_ab The product is for GSI with x86 64-bits and 32-bits with A/B update. Bug: 38339398 Test: Build pass Change-Id: I1f945a812e0fbf8c4266d2f91624c2c674941383 Merged-In: I1f945a812e0fbf8c4266d2f91624c2c674941383 (cherry picked from commit 06956fe54c1fdd36904a1f889597ceee9c38133e) --- target/board/generic_x86_64_ab/BoardConfig.mk | 71 +++++++++++++++++++ target/board/generic_x86_ab/BoardConfig.mk | 65 +++++++++++++++++ target/product/AndroidProducts.mk | 2 + target/product/aosp_x86_64_ab.mk | 36 ++++++++++ target/product/aosp_x86_ab.mk | 35 +++++++++ 5 files changed, 209 insertions(+) create mode 100644 target/board/generic_x86_64_ab/BoardConfig.mk create mode 100644 target/board/generic_x86_ab/BoardConfig.mk create mode 100644 target/product/aosp_x86_64_ab.mk create mode 100644 target/product/aosp_x86_ab.mk diff --git a/target/board/generic_x86_64_ab/BoardConfig.mk b/target/board/generic_x86_64_ab/BoardConfig.mk new file mode 100644 index 0000000000..41bd7b7345 --- /dev/null +++ b/target/board/generic_x86_64_ab/BoardConfig.mk @@ -0,0 +1,71 @@ +# +# Copyright (C) 2017 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. +# + +# Common boardconfig settings for generic AOSP products targetting mobile +# (phone/table) devices. + +# System properties +TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop + +# Bootloader is not part of generic AOSP image +TARGET_NO_BOOTLOADER := true + +# Kernel is also not part of generic AOSP image +TARGET_NO_KERNEL := true + +# system.img is always ext4 with sparse option +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false +TARGET_USES_MKE2FS := true + +# Enable dex pre-opt to speed up initial boot +ifeq ($(HOST_OS),linux) + ifeq ($(WITH_DEXPREOPT),) + WITH_DEXPREOPT := true + WITH_DEXPREOPT_PIC := true + ifneq ($(TARGET_BUILD_VARIANT),user) + # Retain classes.dex in APK's for non-user builds + DEX_PREOPT_DEFAULT := nostripping + endif + endif +endif + +# Generic AOSP image always requires separate vendor.img +TARGET_COPY_OUT_VENDOR := vendor + +# Generic AOSP image does NOT support HWC1 +TARGET_USES_HWC2 := true + +TARGET_CPU_ABI := x86_64 +TARGET_ARCH := x86_64 +TARGET_ARCH_VARIANT := x86_64 + +TARGET_2ND_CPU_ABI := x86 +TARGET_2ND_ARCH := x86 +TARGET_2ND_ARCH_VARIANT := x86_64 + +TARGET_USES_64_BIT_BINDER := true + +# Enable A/B update +BOARD_BUILD_SYSTEM_ROOT_IMAGE := true + +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB + +# TODO(b/35790399): remove when b/35790399 is fixed. +BOARD_NAND_SPARE_SIZE := 0 +BOARD_FLASH_BLOCK_SIZE := 512 + +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/generic_x86_ab/BoardConfig.mk b/target/board/generic_x86_ab/BoardConfig.mk new file mode 100644 index 0000000000..6a286674dd --- /dev/null +++ b/target/board/generic_x86_ab/BoardConfig.mk @@ -0,0 +1,65 @@ +# +# Copyright (C) 2017 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. +# + +# Common boardconfig settings for generic AOSP products targetting mobile +# (phone/table) devices. + +# System properties +TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop + +# Bootloader is not part of generic AOSP image +TARGET_NO_BOOTLOADER := true + +# Kernel is also not part of generic AOSP image +TARGET_NO_KERNEL := true + +# system.img is always ext4 with sparse option +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false +TARGET_USES_MKE2FS := true + +# Enable dex pre-opt to speed up initial boot +ifeq ($(HOST_OS),linux) + ifeq ($(WITH_DEXPREOPT),) + WITH_DEXPREOPT := true + WITH_DEXPREOPT_PIC := true + ifneq ($(TARGET_BUILD_VARIANT),user) + # Retain classes.dex in APK's for non-user builds + DEX_PREOPT_DEFAULT := nostripping + endif + endif +endif + +# Generic AOSP image always requires separate vendor.img +TARGET_COPY_OUT_VENDOR := vendor + +# Generic AOSP image does NOT support HWC1 +TARGET_USES_HWC2 := true + +TARGET_CPU_ABI := x86 +TARGET_ARCH := x86 +TARGET_ARCH_VARIANT := x86 + +# Enable A/B update +BOARD_BUILD_SYSTEM_ROOT_IMAGE := true + +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB + +# TODO(b/35790399): remove when b/35790399 is fixed. +BOARD_NAND_SPARE_SIZE := 0 +BOARD_FLASH_BLOCK_SIZE := 512 + +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk index b95a28687f..9e2adee014 100644 --- a/target/product/AndroidProducts.mk +++ b/target/product/AndroidProducts.mk @@ -56,6 +56,7 @@ PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/full.mk \ $(LOCAL_DIR)/aosp_x86.mk \ $(LOCAL_DIR)/aosp_x86_a.mk \ + $(LOCAL_DIR)/aosp_x86_ab.mk \ $(LOCAL_DIR)/aosp_x86_arm.mk \ $(LOCAL_DIR)/full_x86.mk \ $(LOCAL_DIR)/aosp_mips.mk \ @@ -66,6 +67,7 @@ PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/aosp_mips64.mk \ $(LOCAL_DIR)/aosp_x86_64.mk \ $(LOCAL_DIR)/aosp_x86_64_a.mk \ + $(LOCAL_DIR)/aosp_x86_64_ab.mk \ $(LOCAL_DIR)/sdk_phone_armv7.mk \ $(LOCAL_DIR)/sdk_phone_x86.mk \ $(LOCAL_DIR)/sdk_phone_mips.mk \ diff --git a/target/product/aosp_x86_64_ab.mk b/target/product/aosp_x86_64_ab.mk new file mode 100644 index 0000000000..4fb2acfcd0 --- /dev/null +++ b/target/product/aosp_x86_64_ab.mk @@ -0,0 +1,36 @@ +# +# Copyright (C) 2017 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. +# + +# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at +# /vendor/[build|default].prop when build split is on. In order to have sysprops +# on the generic system image, place them in build/make/target/board/generic_arm64_a/ +# system.prop. + +include build/make/target/product/treble_common.mk + +AB_OTA_UPDATER := true +AB_OTA_PARTITIONS := system +PRODUCT_PACKAGES += \ + update_engine \ + update_verifier + +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) + +PRODUCT_NAME := aosp_x86_64_ab +PRODUCT_DEVICE := generic_x86_64_ab +PRODUCT_BRAND := Android +PRODUCT_MODEL := AOSP on x86_64 diff --git a/target/product/aosp_x86_ab.mk b/target/product/aosp_x86_ab.mk new file mode 100644 index 0000000000..4bd63ab4e6 --- /dev/null +++ b/target/product/aosp_x86_ab.mk @@ -0,0 +1,35 @@ +# +# Copyright (C) 2017 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. +# + +# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at +# /vendor/[build|default].prop when build split is on. In order to have sysprops +# on the generic system image, place them in build/make/target/board/generic_arm64_a/ +# system.prop. + +include build/make/target/product/treble_common.mk + +AB_OTA_UPDATER := true +AB_OTA_PARTITIONS := system +PRODUCT_PACKAGES += \ + update_engine \ + update_verifier + +$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) + +PRODUCT_NAME := aosp_x86_ab +PRODUCT_DEVICE := generic_x86_ab +PRODUCT_BRAND := Android +PRODUCT_MODEL := AOSP on x86 From 22c06e7c8ed557a884b6d3998c9e7cec1a57d20b Mon Sep 17 00:00:00 2001 From: Ian Pedowitz Date: Fri, 28 Jul 2017 11:01:55 -0700 Subject: [PATCH 029/123] oc-mr1-dev is OC-MR1, don't allow building beyond it Bug: 63544673 Test: Can't lunch marlin-userdebug-PPR1 $ lunch marlin-userdebug-PPR1 build/core/version_defaults.mk:55: Invalid TARGET_PLATFORM_VERSION 'PPR1', must be one of build/core/version_defaults.mk:56: *** OPM1. Stop. Change-Id: I116b0cebb353600277876eabccf41e7dda736151 Merged-In: I2d9019af8c4e24e34c743be85d4e0ff224de9d17 --- core/version_defaults.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 49f65a9b70..b7913b0b73 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -40,7 +40,7 @@ endif DEFAULT_PLATFORM_VERSION := OPM1 MIN_PLATFORM_VERSION := OPM1 -MAX_PLATFORM_VERSION := PPR1 +MAX_PLATFORM_VERSION := OPM1 ALLOWED_VERSIONS := $(call allowed-platform-versions,\ $(MIN_PLATFORM_VERSION),\ @@ -74,12 +74,10 @@ endif # please add that PLATFORM_VERSION to the following text file: # cts/tests/tests/os/assets/platform_versions.txt PLATFORM_VERSION.OPM1 := OMR1 -PLATFORM_VERSION.PPR1 := P # 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.OPM1 := OMR1 -PLATFORM_VERSION_CODENAME.PPR1 := P ifndef PLATFORM_VERSION PLATFORM_VERSION := $(PLATFORM_VERSION.$(TARGET_PLATFORM_VERSION)) From bc88ff69cf9646a83b5e3412e9529f3108f4811a Mon Sep 17 00:00:00 2001 From: Bo Hu Date: Tue, 1 Aug 2017 19:02:09 +0000 Subject: [PATCH 030/123] Revert "Revert "emulator: create qemu images for system,vendor"" This reverts commit 9b99ddc8a58fc54c04a74b4a158bc06b90420f02. and add syste-qemu.img to the dependency list of sdk target BUG: 64235252 Test: build sdk target successfully (cherry picked from commit f0d50bbef0521f28c6ae2dc87bc6fe27dfe7ed2c) Change-Id: I813233c7c3f06eb1eca18aad5ea890a55814eb1b --- core/Makefile | 21 +++++++++++++++++++++ core/tasks/sdk-addon.mk | 2 +- target/board/generic/BoardConfig.mk | 1 + target/board/generic_arm64/BoardConfig.mk | 1 + target/board/generic_mips/BoardConfig.mk | 1 + target/board/generic_mips64/BoardConfig.mk | 1 + target/board/generic_x86/BoardConfig.mk | 4 ++++ target/board/generic_x86_64/BoardConfig.mk | 1 + 8 files changed, 31 insertions(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index af3c4cb9d7..c6c9ebf60b 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2740,6 +2740,26 @@ endif # TARGET_BUILD_APPS .PHONY: dalvikfiles dalvikfiles: $(INTERNAL_DALVIK_MODULES) +ifeq ($(BUILD_QEMU_IMAGES),true) +INSTALLED_QEMU_SYSTEMIMAGE := $(PRODUCT_OUT)/system-qemu.img +MK_QEMU_IMAGE_SH := device/generic/goldfish/tools/mk_qemu_image.sh +SGDISK_HOST := $(HOST_OUT_EXECUTABLES)/sgdisk +$(INSTALLED_QEMU_SYSTEMIMAGE): $(INSTALLED_SYSTEMIMAGE) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) + @echo Create system-qemu.img + (export SGDISK=$(SGDISK_HOST); $(MK_QEMU_IMAGE_SH) ${PRODUCT_OUT}/system.img) + +systemimage: $(INSTALLED_QEMU_SYSTEMIMAGE) +droidcore: $(INSTALLED_QEMU_SYSTEMIMAGE) +ifeq ($(BOARD_USES_VENDORIMAGE),true) +INSTALLED_QEMU_VENDORIMAGE := $(PRODUCT_OUT)/vendor-qemu.img +$(INSTALLED_QEMU_VENDORIMAGE): $(INSTALLED_VENDORIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) + @echo Create vendor-qemu.img + (export SGDISK=$(SGDISK_HOST); $(MK_QEMU_IMAGE_SH) ${PRODUCT_OUT}/vendor.img) + +vendorimage: $(INSTALLED_QEMU_VENDORIMAGE) +droidcore: $(INSTALLED_QEMU_VENDORIMAGE) +endif +endif # ----------------------------------------------------------------- # The emulator package ifeq ($(BUILD_EMULATOR),true) @@ -2835,6 +2855,7 @@ deps := \ $(SYMBOLS_ZIP) \ $(COVERAGE_ZIP) \ $(INSTALLED_SYSTEMIMAGE) \ + $(INSTALLED_QEMU_SYSTEMIMAGE) \ $(INSTALLED_USERDATAIMAGE_TARGET) \ $(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_SDK_BUILD_PROP_TARGET) \ diff --git a/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk index 610e0ce621..e3bd47d13e 100644 --- a/core/tasks/sdk-addon.mk +++ b/core/tasks/sdk-addon.mk @@ -63,7 +63,7 @@ endif # Files copied in the system-image directory files_to_copy += \ - $(addon_dir_img):$(BUILT_SYSTEMIMAGE):images/$(TARGET_CPU_ABI)/system.img \ + $(addon_dir_img):$(INSTALLED_QEMU_SYSTEMIMAGE):images/$(TARGET_CPU_ABI)/system.img \ $(addon_dir_img):$(BUILT_USERDATAIMAGE_TARGET):images/$(TARGET_CPU_ABI)/userdata.img \ $(addon_dir_img):$(BUILT_RAMDISK_TARGET):images/$(TARGET_CPU_ABI)/ramdisk.img \ $(addon_dir_img):$(PRODUCT_OUT)/system/build.prop:images/$(TARGET_CPU_ABI)/build.prop \ diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 946e480fa3..609cf25d93 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -43,6 +43,7 @@ NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 # Build OpenGLES emulation guest and host libraries BUILD_EMULATOR_OPENGL := true +BUILD_QEMU_IMAGES := true # Build and enable the OpenGL ES View renderer. When running on the emulator, # the GLES renderer disables itself if host GL acceleration isn't available. diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index 5917425d89..56a86b8db5 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -74,6 +74,7 @@ NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 # Build OpenGLES emulation host and guest libraries BUILD_EMULATOR_OPENGL := true +BUILD_QEMU_IMAGES := true # Build and enable the OpenGL ES View renderer. When running on the emulator, # the GLES renderer disables itself if host GL acceleration isn't available. diff --git a/target/board/generic_mips/BoardConfig.mk b/target/board/generic_mips/BoardConfig.mk index c36cc4a31c..cd29f3527d 100644 --- a/target/board/generic_mips/BoardConfig.mk +++ b/target/board/generic_mips/BoardConfig.mk @@ -51,6 +51,7 @@ NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 # Build OpenGLES emulation guest and host libraries BUILD_EMULATOR_OPENGL := true +BUILD_QEMU_IMAGES := true # Build and enable the OpenGL ES View renderer. When running on the emulator, # the GLES renderer disables itself if host GL acceleration isn't available. diff --git a/target/board/generic_mips64/BoardConfig.mk b/target/board/generic_mips64/BoardConfig.mk index 4798e3fefd..17aae27b58 100644 --- a/target/board/generic_mips64/BoardConfig.mk +++ b/target/board/generic_mips64/BoardConfig.mk @@ -66,6 +66,7 @@ NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 # Build OpenGLES emulation guest and host libraries BUILD_EMULATOR_OPENGL := true +BUILD_QEMU_IMAGES := true # Build and enable the OpenGL ES View renderer. When running on the emulator, # the GLES renderer disables itself if host GL acceleration isn't available. diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index 26b2944cd5..08bd6d144f 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -31,6 +31,10 @@ NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 # Build OpenGLES emulation host and guest libraries BUILD_EMULATOR_OPENGL := true +# Build partitioned system.img and vendor.img (if applicable) +# for qemu, otherwise, init cannot find PART_NAME +BUILD_QEMU_IMAGES := true + # Build and enable the OpenGL ES View renderer. When running on the emulator, # the GLES renderer disables itself if host GL acceleration isn't available. USE_OPENGL_RENDERER := true diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index 9b8e5c8752..2499199944 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -36,6 +36,7 @@ NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 # Build OpenGLES emulation host and guest libraries BUILD_EMULATOR_OPENGL := true +BUILD_QEMU_IMAGES := true # Build and enable the OpenGL ES View renderer. When running on the emulator, # the GLES renderer disables itself if host GL acceleration isn't available. From 1287e59f1583cdb677431cb6f48adf10c59b9d18 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Tue, 1 Aug 2017 18:46:27 -0700 Subject: [PATCH 031/123] Vendor modules in make also have __ANDROID_VNDK__ defined. Bug: 64277220 Test: BOARD_VNDK_VERSION m -j Change-Id: Ia9811ea526d0878b539c8c3da9e82e6bf33fe8e8 Merged-In: Ia9811ea526d0878b539c8c3da9e82e6bf33fe8e8 --- core/binary.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/binary.mk b/core/binary.mk index bbc3550947..4836c4b071 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -270,7 +270,7 @@ ifneq ($(LOCAL_SDK_VERSION),) endif ifneq ($(LOCAL_USE_VNDK),) - my_cflags += -D__ANDROID_API__=__ANDROID_API_FUTURE__ + my_cflags += -D__ANDROID_API__=__ANDROID_API_FUTURE__ -D__ANDROID_VNDK__ endif ifndef LOCAL_IS_HOST_MODULE From 9afc0d534919b3ead51b4ee00b360b9f4a4914dc Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Thu, 27 Jul 2017 21:22:14 +0800 Subject: [PATCH 032/123] treble_common.mk: add the vbmeta.img to disable verification AVB should be disabled for Treble VTS. Otherwise, OEM devices cannot boot the generic system.img provided by Google. Bug: 64055917 Test: Compiles and boot a device with the vbmeta.img Change-Id: I0eaae7beebc8b901d0b4766c2cdc34a27ad02b59 --- core/Makefile | 8 ++++++++ target/product/treble_common.mk | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/core/Makefile b/core/Makefile index af3c4cb9d7..966c1349f4 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2013,6 +2013,14 @@ $(INSTALLED_VBMETAIMAGE_TARGET): $(AVBTOOL) $(INSTALLED_BOOTIMAGE_TARGET) $(INST vbmetaimage-nodeps: $(build-vbmetaimage-target) +else ifeq (true,$(BOARD_BUILD_DISABLED_VBMETAIMAGE)) +BUILT_DISABLED_VBMETAIMAGE := $(PRODUCT_OUT)/vbmeta.img + +INSTALLED_VBMETAIMAGE_TARGET := $(BUILT_DISABLED_VBMETAIMAGE) +$(INSTALLED_VBMETAIMAGE_TARGET): $(AVBTOOL) + $(hide) $(AVBTOOL) make_vbmeta_image \ + --flag 2 --padding_size 4096 --output $@ + endif # BOARD_AVB_ENABLE # ----------------------------------------------------------------- diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk index 52e244161d..52af7ea950 100644 --- a/target/product/treble_common.mk +++ b/target/product/treble_common.mk @@ -214,3 +214,13 @@ PRODUCT_PACKAGES += \ # Android O. PRODUCT_PACKAGES += \ netutils-wrapper-1.0 + +# Android Verified Boot (AVB): +# Builds a special vbmeta.img that disables AVB verification. +# Otherwise, AVB will prevent the device from booting the generic system.img. +# Also checks that BOARD_AVB_ENABLE is not set, to prevent adding verity +# metadata into system.img. +ifeq ($(BOARD_AVB_ENABLE),true) +$(error BOARD_AVB_ENABLE cannot be set for Treble GSI) +endif +BOARD_BUILD_DISABLED_VBMETAIMAGE := true From f33efbd03e20103fe4625a1be1fffd37cba0b383 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Wed, 2 Aug 2017 17:19:27 -0700 Subject: [PATCH 033/123] Replace -classpath with --class-loader-context for preopt Use --class-loader-context to pass the context to dex2oat instead of using runtime arguments. In preparation to simplify dex2oat handling of contexts. Bug: 37966546 Bug: 38138251 Test: make & check that the prebuilds have '&' as their classpath key (cherry picked from commit 965f8aec4c70804ae1eb59bdf2de83d349463a66) Change-Id: Id027e1fcbd69ac5e338214a03ae44222988544f3 --- core/dex_preopt_libart.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk index 47fdba610d..0f2bb866b1 100644 --- a/core/dex_preopt_libart.mk +++ b/core/dex_preopt_libart.mk @@ -11,9 +11,9 @@ else DEX2OAT := $(HOST_OUT_EXECUTABLES)/dex2oatd$(HOST_EXECUTABLE_SUFFIX) endif -# Pass special classpath to skip uses library check. +# Pass special class loader context to skip the classpath and collision check. # Should modify build system to pass used libraries properly later. -DEX2OAT_CLASSPATH := "&" +DEX2OAT_CLASS_LOADER_CONTEXT := "&" DEX2OAT_DEPENDENCY += $(DEX2OAT) @@ -146,7 +146,7 @@ $(hide) rm -f $(2) $(hide) mkdir -p $(dir $(2)) $(hide) ANDROID_LOG_TAGS="*:e" $(DEX2OAT) \ --runtime-arg -Xms$(DEX2OAT_XMS) --runtime-arg -Xmx$(DEX2OAT_XMX) \ - --runtime-arg -classpath --runtime-arg $(DEX2OAT_CLASSPATH) \ + --class-loader-context=$(DEX2OAT_CLASS_LOADER_CONTEXT) \ --boot-image=$(PRIVATE_DEX_PREOPT_IMAGE_LOCATION) \ --dex-file=$(1) \ --dex-location=$(PRIVATE_DEX_LOCATION) \ From f28bf722c2ffe78fbc888c5d13bbd48d6128ce8e Mon Sep 17 00:00:00 2001 From: Ian Pedowitz Date: Thu, 3 Aug 2017 17:38:26 -0700 Subject: [PATCH 034/123] Making a comment a bit more explicit Bug: 64364822 Test: N/A comment only Change-Id: I4ef65aef4521326ac48539ad27422f881cc3e883 --- core/version_defaults.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index b7913b0b73..ee4a4677c2 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -71,7 +71,8 @@ endif # frameworks/support/compat/gingerbread/android/support/v4/os/BuildCompat.java # When you change PLATFORM_VERSION for a given PLATFORM_SDK_VERSION -# please add that PLATFORM_VERSION to the following text file: +# please add that PLATFORM_VERSION as well as clean up obsolete PLATFORM_VERSION's +# in the following text file: # cts/tests/tests/os/assets/platform_versions.txt PLATFORM_VERSION.OPM1 := OMR1 From 8b60c822abbc57e662cf81409241deb1ccb972a3 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Mon, 10 Jul 2017 15:09:32 +0800 Subject: [PATCH 035/123] Force generic system image to load dex pre-opt from system Generic system image always generates dex pre-opt in system image, to improve the time of first boot. But the property ro.cp_system_other_odex could be defined in vendor image, so we disable the property in generic system image to force dex pre-opt be loaded from system image. Bug: 62645784 Test: Test the patch on a A/B project with GSI, confirm the dex pre-opt is loaded from GSI. Change-Id: I71b4a5bed517841b5f889d21d73429fa91da25ba Merged-In: I71b4a5bed517841b5f889d21d73429fa91da25ba (cherry picked from commit 5677b877fbeb500b6c81228e49ddb35375ca3446) --- target/board/treble_system.prop | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/board/treble_system.prop b/target/board/treble_system.prop index e69de29bb2..bedf10c521 100644 --- a/target/board/treble_system.prop +++ b/target/board/treble_system.prop @@ -0,0 +1,2 @@ +# GSI always generate dex pre-opt in system image +ro.cp_system_other_odex=0 From 19e0320ccbf31979fe48db7817898ff2150ae40d Mon Sep 17 00:00:00 2001 From: Alexey Polyudov Date: Mon, 31 Jul 2017 17:42:42 -0700 Subject: [PATCH 036/123] build: aux: Fix link type checking for AUX builds AUX build environent is volatile and is only instantiated in a context of AUX-aware module. link-type checking is happening outside such context, and is not able to correctly determine AUX build dependencies. 1. Save enough of context in LINK_TYPE variable; Use AUX- instead of AUX 2. Load correct set of AUX meta build vars before building link_type rules Bug: 62060489 Test: make auxiliary build no longer tries to access "/STATIC_LIBRARIES" path Change-Id: I9764d4a0740da1c55a6f8429398872fc4362942c (cherry picked from commit 55ebe631b4a50f940850323354241baab9d9be24) --- core/link_type.mk | 2 +- core/main.mk | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core/link_type.mk b/core/link_type.mk index ff525cb040..f7604ff4af 100644 --- a/core/link_type.mk +++ b/core/link_type.mk @@ -10,7 +10,7 @@ # my_link_deps: the dependencies, in the form of : # -my_link_prefix := LINK_TYPE:$(call find-idf-prefix,$(my_kind),$(my_host_cross)):$(if $(my_common),$(my_common):_,_:$(if $(my_2nd_arch_prefix),$(my_2nd_arch_prefix),_)) +my_link_prefix := LINK_TYPE:$(call find-idf-prefix,$(my_kind),$(my_host_cross))$(if $(filter AUX,$(my_kind)),-$(AUX_OS_VARIANT)):$(if $(my_common),$(my_common):_,_:$(if $(my_2nd_arch_prefix),$(my_2nd_arch_prefix),_)) link_type := $(my_link_prefix):$(LOCAL_MODULE_CLASS):$(LOCAL_MODULE) ALL_LINK_TYPES := $(ALL_LINK_TYPES) $(link_type) $(link_type).TYPE := $(my_link_type) diff --git a/core/main.mk b/core/main.mk index 0aab4f46b0..81ab0becca 100644 --- a/core/main.mk +++ b/core/main.mk @@ -610,7 +610,7 @@ add-required-deps := # - TARGET # - HOST # - HOST_CROSS -# - AUX +# - AUX- # 3: Whether to use the common intermediates directory or not # - _ # - COMMON @@ -637,9 +637,15 @@ add-required-deps := link_type_error := -define link-type-prefix +define link-type-prefix-base $(word 2,$(subst :,$(space),$(1))) endef +define link-type-prefix +$(if $(filter AUX-%,$(link-type-prefix-base)),$(patsubst AUX-%,AUX,$(link-type-prefix-base)),$(link-type-prefix-base)) +endef +define link-type-aux-variant +$(if $(filter AUX-%,$(link-type-prefix-base)),$(patsubst AUX-%,%,$(link-type-prefix-base))) +endef define link-type-common $(patsubst _,,$(word 3,$(subst :,$(space),$(1)))) endef @@ -729,7 +735,11 @@ endif # 2. The jni_link_type rule for embedded native code # 3. The 2ND_jni_link_type for the second architecture native code define link-type-file -$(call intermediates-dir-for,$(link-type-class),$(link-type-name),$(filter AUX HOST HOST_CROSS,$(link-type-prefix)),$(link-type-common),$(link-type-2ndarchprefix),$(filter HOST_CROSS,$(link-type-prefix)))/$(if $(filter APPS,$(link-type-class)),$(if $(link-type-common),,$(link-type-2ndarchprefix)jni_))link_type +$(eval _ltf_aux_variant:=$(link-type-aux-variant))\ +$(if $(_ltf_aux_variant),$(call aux-variant-load-env,$(_ltf_aux_variant)))\ +$(call intermediates-dir-for,$(link-type-class),$(link-type-name),$(filter AUX HOST HOST_CROSS,$(link-type-prefix)),$(link-type-common),$(link-type-2ndarchprefix),$(filter HOST_CROSS,$(link-type-prefix)))/$(if $(filter APPS,$(link-type-class)),$(if $(link-type-common),,$(link-type-2ndarchprefix)jni_))link_type\ +$(if $(_ltf_aux_variant),$(call aux-variant-load-env,none))\ +$(eval _ltf_aux_variant:=) endef # Write out the file-based link_type rules for the ALLOW_MISSING_DEPENDENCIES From 98c2735b828cdbdce7af54fa066d55b405be0296 Mon Sep 17 00:00:00 2001 From: Amit Pawar Date: Fri, 4 Aug 2017 13:20:55 -0700 Subject: [PATCH 037/123] oc-mr1-dev is now 8.1.0 Bug: 62103626 Test: In progress Change-Id: I53d2248669892e200d1e5d966027f35f38a8a1f8 Merged-In: I2d9019af8c4e24e34c743be85d4e0ff224de9d17 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index ee4a4677c2..7087672271 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -74,7 +74,7 @@ endif # please add that PLATFORM_VERSION as well as clean up obsolete PLATFORM_VERSION's # in the following text file: # cts/tests/tests/os/assets/platform_versions.txt -PLATFORM_VERSION.OPM1 := OMR1 +PLATFORM_VERSION.OPM1 := 8.1.0 # 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". From 6197aba946217fe9e14d005b65a9615867188ff8 Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Wed, 12 Jul 2017 20:25:19 -0700 Subject: [PATCH 038/123] thermal: Add Thermal HAL 1.1 to treble_common.mk Add rev 1.1 of Thermal HAL. Test: VtsHalThermalV1_1TargetTest; plus manual on marlin Bug: 30982366 Change-Id: Iaaef326e5d2bad05d934614b79c7c44e7592fdc4 (cherry picked from commit ca0adce23564c4b01304423c1cfe3ec409784b3b) --- target/product/treble_common.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk index 090232334b..f31e9acd3e 100644 --- a/target/product/treble_common.mk +++ b/target/product/treble_common.mk @@ -75,6 +75,7 @@ PRODUCT_PACKAGES := \ android.hardware.tetheroffload.config@1.0 \ android.hardware.tetheroffload.control@1.0 \ android.hardware.thermal@1.0 \ + android.hardware.thermal@1.1 \ android.hardware.tv.cec@1.0 \ android.hardware.tv.input@1.0 \ android.hardware.usb@1.0 \ From 614482f09fa102bd9ba84090f7d228a14080472e Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Tue, 13 Jun 2017 18:36:50 -0700 Subject: [PATCH 039/123] thermalserviced: add ThermalService daemon Add ThermalService daemon to embedded.mk as part of the minimal build of open source parts of the tree. Test: manual on marlin Bug: 30982366 Change-Id: I8315a8f5871ec24d8970deaa8527ee74db1c4dc7 (cherry picked from commit d006688090e7ef31985dd728c2b92e4951371d57) --- target/product/embedded.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/embedded.mk b/target/product/embedded.mk index 22c6112336..aefba439a9 100644 --- a/target/product/embedded.mk +++ b/target/product/embedded.mk @@ -76,6 +76,7 @@ PRODUCT_PACKAGES += \ shell_and_utilities \ storaged \ surfaceflinger \ + thermalserviced \ tombstoned \ tzdatacheck \ vndservice \ From c11e0eac1ccad8c6a9e72284031b712e207b2579 Mon Sep 17 00:00:00 2001 From: Roozbeh Pournader Date: Tue, 8 Aug 2017 16:58:13 -0700 Subject: [PATCH 040/123] Add en-XC (cracked pseudo-locale) to L10n build Also sort the locales alphabetically (keeping en-US first) and move them to separate lines. Bug: 64394698 Test: none Change-Id: I3aad3ce1ad9093ffe0ffdf56ebb6f287aec29d44 --- target/product/languages_full.mk | 94 +++++++++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 7 deletions(-) diff --git a/target/product/languages_full.mk b/target/product/languages_full.mk index 36c3de88f9..8cfe68addf 100644 --- a/target/product/languages_full.mk +++ b/target/product/languages_full.mk @@ -15,10 +15,90 @@ # # This is a build configuration that just contains a list of languages. -# It helps in situations where languages must come first in the list, -# mostly because screen densities interfere with the list of locales and -# the system misbehaves when a density is the first locale. - -# These are all the locales that have translations and are displayable -# by TextView in this branch. -PRODUCT_LOCALES := en_US en_AU en_IN fr_FR it_IT es_ES et_EE de_DE nl_NL cs_CZ pl_PL ja_JP zh_TW zh_CN zh_HK ru_RU ko_KR nb_NO es_US da_DK el_GR tr_TR pt_PT pt_BR sv_SE bg_BG ca_ES en_GB fi_FI hi_IN hr_HR hu_HU in_ID iw_IL lt_LT lv_LV ro_RO sk_SK sl_SI sr_RS uk_UA vi_VN tl_PH ar_EG fa_IR th_TH sw_TZ ms_MY af_ZA zu_ZA am_ET en_XA ar_XB fr_CA km_KH lo_LA ne_NP si_LK mn_MN hy_AM az_AZ ka_GE my_MM mr_IN ml_IN is_IS mk_MK ky_KG eu_ES gl_ES bn_BD ta_IN kn_IN te_IN uz_UZ ur_PK kk_KZ sq_AL gu_IN pa_IN be_BY bs_BA sr_Latn_RS +# +# These are all the locales that have translations. +PRODUCT_LOCALES := \ + en_US \ + af_ZA \ + am_ET \ + ar_EG \ + ar_XB \ + az_AZ \ + be_BY \ + bg_BG \ + bn_BD \ + bs_BA \ + ca_ES \ + cs_CZ \ + da_DK \ + de_DE \ + el_GR \ + en_AU \ + en_GB \ + en_IN \ + en_XA \ + en_XC \ + es_ES \ + es_US \ + et_EE \ + eu_ES \ + fa_IR \ + fi_FI \ + fr_CA \ + fr_FR \ + gl_ES \ + gu_IN \ + hi_IN \ + hr_HR \ + hu_HU \ + hy_AM \ + in_ID \ + is_IS \ + it_IT \ + iw_IL \ + ja_JP \ + ka_GE \ + kk_KZ \ + km_KH \ + kn_IN \ + ko_KR \ + ky_KG \ + lo_LA \ + lt_LT \ + lv_LV \ + mk_MK \ + ml_IN \ + mn_MN \ + mr_IN \ + ms_MY \ + my_MM \ + nb_NO \ + ne_NP \ + nl_NL \ + pa_IN \ + pl_PL \ + pt_BR \ + pt_PT \ + ro_RO \ + ru_RU \ + si_LK \ + sk_SK \ + sl_SI \ + sq_AL \ + sr_Latn_RS \ + sr_RS \ + sv_SE \ + sw_TZ \ + ta_IN \ + te_IN \ + th_TH \ + tl_PH \ + tr_TR \ + uk_UA \ + ur_PK \ + uz_UZ \ + vi_VN \ + zh_CN \ + zh_HK \ + zh_TW \ + zu_ZA From e3793d947fbc60985ec9b16b67164d11571a3bda Mon Sep 17 00:00:00 2001 From: Roozbeh Pournader Date: Wed, 9 Aug 2017 11:55:12 -0700 Subject: [PATCH 041/123] Enable Canadian English on L10n builds Bug: 64491256 Test: mmma -j packages/apps/Settings (and checking the APK using aapt dump badging) Change-Id: I1108802a89bd82ccc6e2cc0c2464b8e30eb796b4 --- target/product/languages_full.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/languages_full.mk b/target/product/languages_full.mk index 8cfe68addf..846cd70fc5 100644 --- a/target/product/languages_full.mk +++ b/target/product/languages_full.mk @@ -34,6 +34,7 @@ PRODUCT_LOCALES := \ de_DE \ el_GR \ en_AU \ + en_CA \ en_GB \ en_IN \ en_XA \ From 6ea81532ea0f1ea723ae1771e666e39210270bbf Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Thu, 10 Aug 2017 09:42:02 +0900 Subject: [PATCH 042/123] Phony module vndk_package is added This phony module aggregates all the VNDK-related libraries so that they can be installed to the system partition simply by adding 'vndk_package' to PRODUCT_PACKAGES. This is to sneure that all VNDK libraries are installed even when there is no vendor library using some of the VNDK libs (especially when building system image only). Bug: 64013660 Test: BOARD_VNDK_VERSION=current m -j vndk_package Change-Id: I3a14a7eaaffd6a7f3258a4be59b1c5813153714d --- target/product/vndk/Android.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 target/product/vndk/Android.mk diff --git a/target/product/vndk/Android.mk b/target/product/vndk/Android.mk new file mode 100644 index 0000000000..20e8436697 --- /dev/null +++ b/target/product/vndk/Android.mk @@ -0,0 +1,11 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := vndk_package +LOCAL_REQUIRED_MODULES := \ + $(addsuffix .vendor,$(VNDK_CORE_LIBRARIES)) \ + $(addsuffix .vendor,$(VNDK_SAMEPROCESS_LIBRARIES)) \ + $(LLNDK_LIBRARIES) + +include $(BUILD_PHONY_PACKAGE) From 80755694f3fa03008f8f91173d17be71f55e2c64 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Fri, 28 Jul 2017 11:35:40 +0800 Subject: [PATCH 043/123] Move common settings in BoardConfig.mk into a common makefile Bug: 63878637 Test: Build pass and boot into home screen with aosp_arm64_ab of GSI Change-Id: I1b843fcccd83e2e30eba66451b10f093ccfd458f --- target/board/generic_arm64_a/BoardConfig.mk | 45 +-------------- target/board/generic_arm64_ab/BoardConfig.mk | 48 +--------------- target/board/generic_arm_a/BoardConfig.mk | 43 +------------- target/board/generic_arm_ab/BoardConfig.mk | 43 +------------- target/board/generic_x86_64_a/BoardConfig.mk | 45 +-------------- target/board/generic_x86_64_ab/BoardConfig.mk | 46 +-------------- target/board/generic_x86_a/BoardConfig.mk | 43 +------------- target/board/generic_x86_ab/BoardConfig.mk | 44 +-------------- target/board/treble_common.mk | 56 +++++++++++++++++++ target/board/treble_common_32.mk | 17 ++++++ target/board/treble_common_64.mk | 20 +++++++ 11 files changed, 103 insertions(+), 347 deletions(-) create mode 100644 target/board/treble_common.mk create mode 100644 target/board/treble_common_32.mk create mode 100644 target/board/treble_common_64.mk diff --git a/target/board/generic_arm64_a/BoardConfig.mk b/target/board/generic_arm64_a/BoardConfig.mk index e92f84d2c6..4729744736 100644 --- a/target/board/generic_arm64_a/BoardConfig.mk +++ b/target/board/generic_arm64_a/BoardConfig.mk @@ -14,40 +14,7 @@ # limitations under the License. # -# Common boardconfig settings for generic AOSP products targetting mobile -# (phone/table) devices. - -# System properties -TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop - -# Bootloader is not part of generic AOSP image -TARGET_NO_BOOTLOADER := true - -# Kernel is also not part of generic AOSP image -TARGET_NO_KERNEL := true - -# system.img is always ext4 with sparse option -TARGET_USERIMAGES_USE_EXT4 := true -TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false -TARGET_USES_MKE2FS := true - -# Enable dex pre-opt to speed up initial boot -ifeq ($(HOST_OS),linux) - ifeq ($(WITH_DEXPREOPT),) - WITH_DEXPREOPT := true - WITH_DEXPREOPT_PIC := true - ifneq ($(TARGET_BUILD_VARIANT),user) - # Retain classes.dex in APK's for non-user builds - DEX_PREOPT_DEFAULT := nostripping - endif - endif -endif - -# Generic AOSP image always requires separate vendor.img -TARGET_COPY_OUT_VENDOR := vendor - -# Generic AOSP image does NOT support HWC1 -TARGET_USES_HWC2 := true +include build/make/target/board/treble_common_64.mk TARGET_ARCH := arm64 TARGET_ARCH_VARIANT := armv8-a @@ -60,13 +27,3 @@ TARGET_2ND_ARCH_VARIANT := armv7-a-neon TARGET_2ND_CPU_ABI := armeabi-v7a TARGET_2ND_CPU_ABI2 := armeabi TARGET_2ND_CPU_VARIANT := generic - -TARGET_USES_64_BIT_BINDER := true - -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB - -# TODO(b/35790399): remove when b/35790399 is fixed. -BOARD_NAND_SPARE_SIZE := 0 -BOARD_FLASH_BLOCK_SIZE := 512 - -BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/generic_arm64_ab/BoardConfig.mk b/target/board/generic_arm64_ab/BoardConfig.mk index 83e44a5f75..56cc2da7d8 100644 --- a/target/board/generic_arm64_ab/BoardConfig.mk +++ b/target/board/generic_arm64_ab/BoardConfig.mk @@ -14,41 +14,7 @@ # limitations under the License. # -# Common boardconfig settings for generic AOSP products targetting mobile -# (phone/table) devices. - -# System properties -TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop - -# Bootloader is not part of generic AOSP image -TARGET_NO_BOOTLOADER := true - -# Kernel is also not part of generic AOSP image -TARGET_NO_KERNEL := true - -# system.img is always ext4 with sparse option -TARGET_USERIMAGES_USE_EXT4 := true -TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false -TARGET_USES_MKE2FS := true - -# Enable dex pre-opt to speed up initial boot -ifeq ($(HOST_OS),linux) - ifeq ($(WITH_DEXPREOPT),) - WITH_DEXPREOPT := true - WITH_DEXPREOPT_PIC := true - ifneq ($(TARGET_BUILD_VARIANT),user) - # Retain classes.dex in APK's for non-user builds - DEX_PREOPT_DEFAULT := nostripping - endif - endif -endif - -# Generic AOSP image always requires separate vendor.img -TARGET_COPY_OUT_VENDOR := vendor - -# Generic AOSP image does NOT support HWC1 -TARGET_USES_HWC2 := true -NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 +include build/make/target/board/treble_common_64.mk TARGET_ARCH := arm64 TARGET_ARCH_VARIANT := armv8-a @@ -63,8 +29,6 @@ TARGET_2ND_CPU_ABI2 := armeabi # TODO(jiyong) can we set krait here? TARGET_2ND_CPU_VARIANT := cortex-a15 -TARGET_USES_64_BIT_BINDER := true - # Enable A/B update TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true @@ -73,16 +37,6 @@ BOARD_BUILD_SYSTEM_ROOT_IMAGE := true BOARD_ROOT_EXTRA_FOLDERS := bt_firmware firmware firmware/radio persist BOARD_ROOT_EXTRA_SYMLINKS := /vendor/lib/dsp:/dsp -# TODO(b/35603549): this is currently set to 2.5GB to support sailfish/marlin -# Fix this! -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 - -# TODO(b/35790399): remove when b/35790399 is fixed. -BOARD_NAND_SPARE_SIZE := 0 -BOARD_FLASH_BLOCK_SIZE := 512 - -BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true - # TODO(b/36764215): remove this setting when the generic system image # no longer has QCOM-specific directories under /. BOARD_SEPOLICY_DIRS += build/target/board/generic_arm64_ab/sepolicy diff --git a/target/board/generic_arm_a/BoardConfig.mk b/target/board/generic_arm_a/BoardConfig.mk index 03912485a1..57a5196a96 100644 --- a/target/board/generic_arm_a/BoardConfig.mk +++ b/target/board/generic_arm_a/BoardConfig.mk @@ -14,51 +14,10 @@ # limitations under the License. # -# Common boardconfig settings for generic AOSP products targetting mobile -# (phone/table) devices. - -# System properties -TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop - -# Bootloader is not part of generic AOSP image -TARGET_NO_BOOTLOADER := true - -# Kernel is also not part of generic AOSP image -TARGET_NO_KERNEL := true - -# system.img is always ext4 with sparse option -TARGET_USERIMAGES_USE_EXT4 := true -TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false -TARGET_USES_MKE2FS := true - -# Enable dex pre-opt to speed up initial boot -ifeq ($(HOST_OS),linux) - ifeq ($(WITH_DEXPREOPT),) - WITH_DEXPREOPT := true - WITH_DEXPREOPT_PIC := true - ifneq ($(TARGET_BUILD_VARIANT),user) - # Retain classes.dex in APK's for non-user builds - DEX_PREOPT_DEFAULT := nostripping - endif - endif -endif - -# Generic AOSP image always requires separate vendor.img -TARGET_COPY_OUT_VENDOR := vendor - -# Generic AOSP image does NOT support HWC1 -TARGET_USES_HWC2 := true +include build/make/target/board/treble_common_32.mk TARGET_ARCH := arm TARGET_ARCH_VARIANT := armv7-a-neon TARGET_CPU_ABI := armeabi-v7a TARGET_CPU_ABI2 := armeabi TARGET_CPU_VARIANT := generic - -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 - -# TODO(b/35790399): remove when b/35790399 is fixed. -BOARD_NAND_SPARE_SIZE := 0 -BOARD_FLASH_BLOCK_SIZE := 512 - -BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/generic_arm_ab/BoardConfig.mk b/target/board/generic_arm_ab/BoardConfig.mk index 58d597b2fc..ae8de14681 100644 --- a/target/board/generic_arm_ab/BoardConfig.mk +++ b/target/board/generic_arm_ab/BoardConfig.mk @@ -14,40 +14,7 @@ # limitations under the License. # -# Common boardconfig settings for generic AOSP products targetting mobile -# (phone/table) devices. - -# System properties -TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop - -# Bootloader is not part of generic AOSP image -TARGET_NO_BOOTLOADER := true - -# Kernel is also not part of generic AOSP image -TARGET_NO_KERNEL := true - -# system.img is always ext4 with sparse option -TARGET_USERIMAGES_USE_EXT4 := true -TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false -TARGET_USES_MKE2FS := true - -# Enable dex pre-opt to speed up initial boot -ifeq ($(HOST_OS),linux) - ifeq ($(WITH_DEXPREOPT),) - WITH_DEXPREOPT := true - WITH_DEXPREOPT_PIC := true - ifneq ($(TARGET_BUILD_VARIANT),user) - # Retain classes.dex in APK's for non-user builds - DEX_PREOPT_DEFAULT := nostripping - endif - endif -endif - -# Generic AOSP image always requires separate vendor.img -TARGET_COPY_OUT_VENDOR := vendor - -# Generic AOSP image does NOT support HWC1 -TARGET_USES_HWC2 := true +include build/make/target/board/treble_common_32.mk TARGET_ARCH := arm TARGET_ARCH_VARIANT := armv7-a-neon @@ -58,11 +25,3 @@ TARGET_CPU_VARIANT := generic # Enable A/B update TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true - -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 - -# TODO(b/35790399): remove when b/35790399 is fixed. -BOARD_NAND_SPARE_SIZE := 0 -BOARD_FLASH_BLOCK_SIZE := 512 - -BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/generic_x86_64_a/BoardConfig.mk b/target/board/generic_x86_64_a/BoardConfig.mk index bd1f750e3b..2c0260439c 100644 --- a/target/board/generic_x86_64_a/BoardConfig.mk +++ b/target/board/generic_x86_64_a/BoardConfig.mk @@ -14,40 +14,7 @@ # limitations under the License. # -# Common boardconfig settings for generic AOSP products targetting mobile -# (phone/table) devices. - -# System properties -TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop - -# Bootloader is not part of generic AOSP image -TARGET_NO_BOOTLOADER := true - -# Kernel is also not part of generic AOSP image -TARGET_NO_KERNEL := true - -# system.img is always ext4 with sparse option -TARGET_USERIMAGES_USE_EXT4 := true -TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false -TARGET_USES_MKE2FS := true - -# Enable dex pre-opt to speed up initial boot -ifeq ($(HOST_OS),linux) - ifeq ($(WITH_DEXPREOPT),) - WITH_DEXPREOPT := true - WITH_DEXPREOPT_PIC := true - ifneq ($(TARGET_BUILD_VARIANT),user) - # Retain classes.dex in APK's for non-user builds - DEX_PREOPT_DEFAULT := nostripping - endif - endif -endif - -# Generic AOSP image always requires separate vendor.img -TARGET_COPY_OUT_VENDOR := vendor - -# Generic AOSP image does NOT support HWC1 -TARGET_USES_HWC2 := true +include build/make/target/board/treble_common_64.mk TARGET_CPU_ABI := x86_64 TARGET_ARCH := x86_64 @@ -56,13 +23,3 @@ TARGET_ARCH_VARIANT := x86_64 TARGET_2ND_CPU_ABI := x86 TARGET_2ND_ARCH := x86 TARGET_2ND_ARCH_VARIANT := x86_64 - -TARGET_USES_64_BIT_BINDER := true - -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB - -# TODO(b/35790399): remove when b/35790399 is fixed. -BOARD_NAND_SPARE_SIZE := 0 -BOARD_FLASH_BLOCK_SIZE := 512 - -BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/generic_x86_64_ab/BoardConfig.mk b/target/board/generic_x86_64_ab/BoardConfig.mk index 41bd7b7345..e49863a4b2 100644 --- a/target/board/generic_x86_64_ab/BoardConfig.mk +++ b/target/board/generic_x86_64_ab/BoardConfig.mk @@ -14,40 +14,7 @@ # limitations under the License. # -# Common boardconfig settings for generic AOSP products targetting mobile -# (phone/table) devices. - -# System properties -TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop - -# Bootloader is not part of generic AOSP image -TARGET_NO_BOOTLOADER := true - -# Kernel is also not part of generic AOSP image -TARGET_NO_KERNEL := true - -# system.img is always ext4 with sparse option -TARGET_USERIMAGES_USE_EXT4 := true -TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false -TARGET_USES_MKE2FS := true - -# Enable dex pre-opt to speed up initial boot -ifeq ($(HOST_OS),linux) - ifeq ($(WITH_DEXPREOPT),) - WITH_DEXPREOPT := true - WITH_DEXPREOPT_PIC := true - ifneq ($(TARGET_BUILD_VARIANT),user) - # Retain classes.dex in APK's for non-user builds - DEX_PREOPT_DEFAULT := nostripping - endif - endif -endif - -# Generic AOSP image always requires separate vendor.img -TARGET_COPY_OUT_VENDOR := vendor - -# Generic AOSP image does NOT support HWC1 -TARGET_USES_HWC2 := true +include build/make/target/board/treble_common_64.mk TARGET_CPU_ABI := x86_64 TARGET_ARCH := x86_64 @@ -57,15 +24,6 @@ TARGET_2ND_CPU_ABI := x86 TARGET_2ND_ARCH := x86 TARGET_2ND_ARCH_VARIANT := x86_64 -TARGET_USES_64_BIT_BINDER := true - # Enable A/B update +TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true - -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB - -# TODO(b/35790399): remove when b/35790399 is fixed. -BOARD_NAND_SPARE_SIZE := 0 -BOARD_FLASH_BLOCK_SIZE := 512 - -BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/generic_x86_a/BoardConfig.mk b/target/board/generic_x86_a/BoardConfig.mk index 4ca6ebe86d..67cb07d7f9 100644 --- a/target/board/generic_x86_a/BoardConfig.mk +++ b/target/board/generic_x86_a/BoardConfig.mk @@ -14,49 +14,8 @@ # limitations under the License. # -# Common boardconfig settings for generic AOSP products targetting mobile -# (phone/table) devices. - -# System properties -TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop - -# Bootloader is not part of generic AOSP image -TARGET_NO_BOOTLOADER := true - -# Kernel is also not part of generic AOSP image -TARGET_NO_KERNEL := true - -# system.img is always ext4 with sparse option -TARGET_USERIMAGES_USE_EXT4 := true -TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false -TARGET_USES_MKE2FS := true - -# Enable dex pre-opt to speed up initial boot -ifeq ($(HOST_OS),linux) - ifeq ($(WITH_DEXPREOPT),) - WITH_DEXPREOPT := true - WITH_DEXPREOPT_PIC := true - ifneq ($(TARGET_BUILD_VARIANT),user) - # Retain classes.dex in APK's for non-user builds - DEX_PREOPT_DEFAULT := nostripping - endif - endif -endif - -# Generic AOSP image always requires separate vendor.img -TARGET_COPY_OUT_VENDOR := vendor - -# Generic AOSP image does NOT support HWC1 -TARGET_USES_HWC2 := true +include build/make/target/board/treble_common_32.mk TARGET_CPU_ABI := x86 TARGET_ARCH := x86 TARGET_ARCH_VARIANT := x86 - -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB - -# TODO(b/35790399): remove when b/35790399 is fixed. -BOARD_NAND_SPARE_SIZE := 0 -BOARD_FLASH_BLOCK_SIZE := 512 - -BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/generic_x86_ab/BoardConfig.mk b/target/board/generic_x86_ab/BoardConfig.mk index 6a286674dd..6e51102a23 100644 --- a/target/board/generic_x86_ab/BoardConfig.mk +++ b/target/board/generic_x86_ab/BoardConfig.mk @@ -14,52 +14,12 @@ # limitations under the License. # -# Common boardconfig settings for generic AOSP products targetting mobile -# (phone/table) devices. - -# System properties -TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop - -# Bootloader is not part of generic AOSP image -TARGET_NO_BOOTLOADER := true - -# Kernel is also not part of generic AOSP image -TARGET_NO_KERNEL := true - -# system.img is always ext4 with sparse option -TARGET_USERIMAGES_USE_EXT4 := true -TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false -TARGET_USES_MKE2FS := true - -# Enable dex pre-opt to speed up initial boot -ifeq ($(HOST_OS),linux) - ifeq ($(WITH_DEXPREOPT),) - WITH_DEXPREOPT := true - WITH_DEXPREOPT_PIC := true - ifneq ($(TARGET_BUILD_VARIANT),user) - # Retain classes.dex in APK's for non-user builds - DEX_PREOPT_DEFAULT := nostripping - endif - endif -endif - -# Generic AOSP image always requires separate vendor.img -TARGET_COPY_OUT_VENDOR := vendor - -# Generic AOSP image does NOT support HWC1 -TARGET_USES_HWC2 := true +include build/make/target/board/treble_common_32.mk TARGET_CPU_ABI := x86 TARGET_ARCH := x86 TARGET_ARCH_VARIANT := x86 # Enable A/B update +TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true - -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB - -# TODO(b/35790399): remove when b/35790399 is fixed. -BOARD_NAND_SPARE_SIZE := 0 -BOARD_FLASH_BLOCK_SIZE := 512 - -BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/treble_common.mk b/target/board/treble_common.mk new file mode 100644 index 0000000000..962d0b763f --- /dev/null +++ b/target/board/treble_common.mk @@ -0,0 +1,56 @@ +# +# Copyright (C) 2017 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. +# + +# Common boardconfig settings for generic AOSP products targetting mobile +# (phone/table) devices. + +# Properties +TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true + +# Bootloader, kernel and recovery are not part of generic AOSP image +TARGET_NO_BOOTLOADER := true +TARGET_NO_KERNEL := true + +# system.img is always ext4 with sparse option +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false +TARGET_USES_MKE2FS := true +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB + +# Generic AOSP image always requires separate vendor.img +TARGET_COPY_OUT_VENDOR := vendor + +# Enable dex pre-opt to speed up initial boot +ifeq ($(HOST_OS),linux) + ifeq ($(WITH_DEXPREOPT),) + WITH_DEXPREOPT := true + WITH_DEXPREOPT_PIC := true + ifneq ($(TARGET_BUILD_VARIANT),user) + # Retain classes.dex in APK's for non-user builds + DEX_PREOPT_DEFAULT := nostripping + endif + endif +endif + +# Generic AOSP image does NOT support HWC1 +TARGET_USES_HWC2 := true +# Set emulator framebuffer display device buffer count to 3 +NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 + +# TODO(b/35790399): remove when b/35790399 is fixed. +BOARD_NAND_SPARE_SIZE := 0 +BOARD_FLASH_BLOCK_SIZE := 512 diff --git a/target/board/treble_common_32.mk b/target/board/treble_common_32.mk new file mode 100644 index 0000000000..b66c41eb04 --- /dev/null +++ b/target/board/treble_common_32.mk @@ -0,0 +1,17 @@ +# +# Copyright (C) 2017 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. +# + +include build/make/target/board/treble_common.mk diff --git a/target/board/treble_common_64.mk b/target/board/treble_common_64.mk new file mode 100644 index 0000000000..8980dfde1d --- /dev/null +++ b/target/board/treble_common_64.mk @@ -0,0 +1,20 @@ +# +# Copyright (C) 2017 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. +# + +include build/make/target/board/treble_common.mk + +# Enable 64-bits binder +TARGET_USES_64_BIT_BINDER := true From cc1d9c35fc6b8938e4d21f0d7fcbd06db0493cd3 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Thu, 10 Aug 2017 17:05:45 +0800 Subject: [PATCH 044/123] Reduce the system partition size of generic system images Some device has small ROM size, so the GSI should be as small as possible. The patch change the image sizes to be: - 64 projects (default): 1.25GB (1280MB) - 32 projects (default): 0.75GB (768MB) - ARM32 projects: 734MB Bug: 64458958 Test: Build all GSI projects Change-Id: I7f7a266e48e99b0b4d5c6a84b8187b56e4482c94 --- target/board/generic_arm_a/BoardConfig.mk | 4 ++++ target/board/generic_arm_ab/BoardConfig.mk | 4 ++++ target/board/treble_common.mk | 1 - target/board/treble_common_32.mk | 3 +++ target/board/treble_common_64.mk | 3 +++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/target/board/generic_arm_a/BoardConfig.mk b/target/board/generic_arm_a/BoardConfig.mk index 57a5196a96..5293ae61aa 100644 --- a/target/board/generic_arm_a/BoardConfig.mk +++ b/target/board/generic_arm_a/BoardConfig.mk @@ -21,3 +21,7 @@ TARGET_ARCH_VARIANT := armv7-a-neon TARGET_CPU_ABI := armeabi-v7a TARGET_CPU_ABI2 := armeabi TARGET_CPU_VARIANT := generic + +# b/64458958 +# Partition size is 734MB for ARM32 (non A/B update) +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 769654784 diff --git a/target/board/generic_arm_ab/BoardConfig.mk b/target/board/generic_arm_ab/BoardConfig.mk index ae8de14681..376aaab665 100644 --- a/target/board/generic_arm_ab/BoardConfig.mk +++ b/target/board/generic_arm_ab/BoardConfig.mk @@ -25,3 +25,7 @@ TARGET_CPU_VARIANT := generic # Enable A/B update TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true + +# b/64458958 +# Partition size is 734MB for ARM32 (A/B update) +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 769654784 diff --git a/target/board/treble_common.mk b/target/board/treble_common.mk index 962d0b763f..de31f5a133 100644 --- a/target/board/treble_common.mk +++ b/target/board/treble_common.mk @@ -29,7 +29,6 @@ TARGET_NO_KERNEL := true TARGET_USERIMAGES_USE_EXT4 := true TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false TARGET_USES_MKE2FS := true -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB # Generic AOSP image always requires separate vendor.img TARGET_COPY_OUT_VENDOR := vendor diff --git a/target/board/treble_common_32.mk b/target/board/treble_common_32.mk index b66c41eb04..67041a1176 100644 --- a/target/board/treble_common_32.mk +++ b/target/board/treble_common_32.mk @@ -15,3 +15,6 @@ # include build/make/target/board/treble_common.mk + +# Partition size is default 0.75GB (768MB) for 32 bits projects +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 805306368 diff --git a/target/board/treble_common_64.mk b/target/board/treble_common_64.mk index 8980dfde1d..957f593b30 100644 --- a/target/board/treble_common_64.mk +++ b/target/board/treble_common_64.mk @@ -18,3 +18,6 @@ include build/make/target/board/treble_common.mk # Enable 64-bits binder TARGET_USES_64_BIT_BINDER := true + +# Partition size is default 1.25GB (1280MB) for 64 bits projects +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1342177280 From 7c205107ce47651f2252ab6d2f439c32aa965d77 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Mon, 7 Aug 2017 12:31:17 +0100 Subject: [PATCH 045/123] Implement LOCAL_COMPRESSED_MODULE. - Prebuilts with LOCAL_MODULE_CLASS == APPS and BUILD_PACKAGE that define LOCAL_COMPRESSED_MODULE := true will be installed compressed in the system partition. - The compression algorithm is simple gzip for now. In addition : - Compressed modules are not dex-preopted. - JNI shared libraries are always embedded inside compressed modules, they are never installed as separate files on the FS. Test: Manual Bug: 63802184 Change-Id: Id12b1ff0b1d68791ec1178783f7e78910e122a33 --- core/clear_vars.mk | 1 + core/definitions.mk | 9 ++++++++ core/install_jni_libs.mk | 5 +++++ core/package_internal.mk | 27 +++++++++++++++++++++++ core/prebuilt_internal.mk | 45 +++++++++++++++++++++++++++++++++++---- 5 files changed, 83 insertions(+), 4 deletions(-) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 1fba952fbf..a6878669c5 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -34,6 +34,7 @@ LOCAL_CLANG_LDFLAGS:= LOCAL_CLASSPATH:= LOCAL_COMPATIBILITY_SUITE:= LOCAL_COMPATIBILITY_SUPPORT_FILES:= +LOCAL_COMPRESSED_MODULE:= LOCAL_CONLYFLAGS:= LOCAL_COPY_HEADERS:= LOCAL_COPY_HEADERS_TO:= diff --git a/core/definitions.mk b/core/definitions.mk index 330d360336..95e9a020d2 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2723,6 +2723,15 @@ $(hide) if ! $(ZIPALIGN) -c $(ZIPALIGN_PAGE_ALIGN_FLAGS) 4 $@ >/dev/null ; then fi endef +# Compress a package using the standard gzip algorithm. +define compress-package +$(hide) \ + mv $@ $@.uncompressed; \ + $(MINIGZIP) -c $@.uncompressed > $@.compressed; \ + rm -f $@.uncompressed; \ + mv $@.compressed $@; +endef + # Remove dynamic timestamps from packages # define remove-timestamps-from-package diff --git a/core/install_jni_libs.mk b/core/install_jni_libs.mk index 6b550c1c0c..e88db400a1 100644 --- a/core/install_jni_libs.mk +++ b/core/install_jni_libs.mk @@ -32,6 +32,11 @@ else my_embed_jni := true endif endif +# If we're installing this APP as a compressed module, we include all JNI libraries +# in the compressed artifact, rather than as separate files on the partition in question. +ifdef LOCAL_COMPRESSED_MODULE +my_embed_jni := true +endif jni_shared_libraries := jni_shared_libraries_abis := diff --git a/core/package_internal.mk b/core/package_internal.mk index 74dd15ed54..28c3a0882d 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -215,8 +215,19 @@ R_file_stamp := $(intermediates.COMMON)/src/R.stamp LOCAL_INTERMEDIATE_TARGETS += $(R_file_stamp) endif +ifdef LOCAL_COMPRESSED_MODULE +ifneq (true,$(LOCAL_COMPRESSED_MODULE)) +$(call pretty-error, Unknown value for LOCAL_COMPRESSED_MODULE $(LOCAL_COMPRESSED_MODULE)) +endif +endif + +ifdef LOCAL_COMPRESSED_MODULE +LOCAL_BUILT_MODULE_STEM := package.apk.gz +LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk.gz +else # !LOCAL_COMPRESSED_MODULE LOCAL_BUILT_MODULE_STEM := package.apk LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk +endif LOCAL_PROGUARD_ENABLED:=$(strip $(LOCAL_PROGUARD_ENABLED)) ifndef LOCAL_PROGUARD_ENABLED @@ -307,6 +318,12 @@ LOCAL_RESOURCE_DIR := $(data_binding_res_out) LOCAL_AAPT_FLAGS += --auto-add-overlay --extra-packages com.android.databinding.library endif # LOCAL_DATA_BINDING +# If the module is a compressed module, we don't pre-opt it because its final +# installation location will be the data partition. +ifdef LOCAL_COMPRESSED_MODULE +LOCAL_DEX_PREOPT := false +endif + include $(BUILD_SYSTEM)/android_manifest.mk ################################# @@ -358,6 +375,10 @@ installed_apk_splits := my_apk_split_configs := ifdef LOCAL_PACKAGE_SPLITS +ifdef LOCAL_COMPRESSED_MODULE +$(error $(LOCAL_MODULE): LOCAL_COMPRESSED_MODULE is not currently supported for split installs) +endif # LOCAL_COMPRESSED_MODULE + my_apk_split_configs := $(LOCAL_PACKAGE_SPLITS) my_split_suffixes := $(subst $(comma),_,$(my_apk_split_configs)) built_apk_splits := $(foreach s,$(my_split_suffixes),$(intermediates)/package_$(s).apk) @@ -570,6 +591,9 @@ $(LOCAL_BUILT_MODULE): PRIVATE_RES_PACKAGE := $(my_res_package) $(LOCAL_BUILT_MODULE) : $(my_res_package) $(AAPT2) | $(ACP) else $(LOCAL_BUILT_MODULE) : $(all_res_assets) $(full_android_manifest) $(AAPT) +endif +ifdef LOCAL_COMPRESSED_MODULE +$(LOCAL_BUILT_MODULE) : $(MINIGZIP) endif @echo "target Package: $(PRIVATE_MODULE) ($@)" ifdef LOCAL_USE_AAPT2 @@ -606,6 +630,9 @@ ifneq (nostripping,$(LOCAL_DEX_PREOPT)) endif endif $(sign-package) +ifdef LOCAL_COMPRESSED_MODULE + $(compress-package) +endif # LOCAL_COMPRESSED_MODULE ############################### ## Build dpi-specific apks, if it's apps_only build. diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index de7111135e..edda97e551 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -105,13 +105,33 @@ else prebuilt_module_is_dex_javalib := endif -ifeq ($(LOCAL_MODULE_CLASS),APPS) -LOCAL_BUILT_MODULE_STEM := package.apk -ifndef LOCAL_INSTALLED_MODULE_STEM -LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk +ifdef LOCAL_COMPRESSED_MODULE +ifneq (true,$(LOCAL_COMPRESSED_MODULE)) +$(call pretty-error, Unknown value for LOCAL_COMPRESSED_MODULE $(LOCAL_COMPRESSED_MODULE)) endif endif +ifeq ($(LOCAL_MODULE_CLASS),APPS) +ifdef LOCAL_COMPRESSED_MODULE +LOCAL_BUILT_MODULE_STEM := package.apk.gz +else +LOCAL_BUILT_MODULE_STEM := package.apk +endif # LOCAL_COMPRESSED_MODULE + +ifndef LOCAL_INSTALLED_MODULE_STEM +ifdef LOCAL_COMPRESSED_MODULE +LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk.gz +else +LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk +endif # LOCAL_COMPRESSED_MODULE +endif # LOCAL_INSTALLED_MODULE_STEM + +else # $(LOCAL_MODULE_CLASS) != APPS) +ifdef LOCAL_COMPRESSED_MODULE +$(error $(LOCAL_MODULE) : LOCAL_COMPRESSED_MODULE can only be defined for module class APPS) +endif # LOCAL_COMPRESSED_MODULE +endif + ifneq ($(filter true keep_symbols no_debuglink mini-debug-info,$(my_strip_module) $(my_pack_module_relocations)),) ifdef LOCAL_IS_HOST_MODULE $(error Cannot strip/pack host module LOCAL_PATH=$(LOCAL_PATH)) @@ -314,6 +334,12 @@ LOCAL_DEX_PREOPT := false endif endif +# If the module is a compressed module, we don't pre-opt it because its final +# installation location will be the data partition. +ifdef LOCAL_COMPRESSED_MODULE +LOCAL_DEX_PREOPT := false +endif + ####################################### # defines built_odex along with rule to install odex include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk @@ -338,6 +364,10 @@ embedded_prebuilt_jni_libs := 'lib/*.so' endif $(built_module): PRIVATE_EMBEDDED_JNI_LIBS := $(embedded_prebuilt_jni_libs) +ifdef LOCAL_COMPRESSED_MODULE +$(built_module) : $(MINIGZIP) +endif + $(built_module) : $(my_prebuilt_src_file) | $(ZIPALIGN) $(SIGNAPK_JAR) $(transform-prebuilt-to-target) $(uncompress-shared-libs) @@ -359,6 +389,9 @@ endif # LOCAL_DEX_PREOPT else # LOCAL_CERTIFICATE == PRESIGNED $(align-package) endif # LOCAL_CERTIFICATE +ifdef LOCAL_COMPRESSED_MODULE + $(compress-package) +endif # LOCAL_COMPRESSED_MODULE endif # ! LOCAL_REPLACE_PREBUILT_APK_INSTALLED ############################### @@ -371,6 +404,10 @@ endif ############################### ## Install split apks. ifdef LOCAL_PACKAGE_SPLITS +ifdef LOCAL_COMPRESSED_MODULE +$(error $(LOCAL_MODULE): LOCAL_COMPRESSED_MODULE is not currently supported for split installs) +endif # LOCAL_COMPRESSED_MODULE + # LOCAL_PACKAGE_SPLITS is a list of apks to be installed. built_apk_splits := $(addprefix $(intermediates)/,$(notdir $(LOCAL_PACKAGE_SPLITS))) installed_apk_splits := $(addprefix $(my_module_path)/,$(notdir $(LOCAL_PACKAGE_SPLITS))) From 4ae165c7ae331098ddb74809eabc38229693e5bd Mon Sep 17 00:00:00 2001 From: Jeff Hao Date: Wed, 2 Aug 2017 16:45:49 -0700 Subject: [PATCH 046/123] Add dirty-images-objects handling to boot image build. Allows grouping of classes with dirty static fields to be grouped together in the image to have fewer dirty pages. Bug: 62554875 Test: mm test-art-host (cherry picked from commit 865d54caf29acbf576b70428da015a38603dec8e) Change-Id: Id711ad1c2d98b12b0f55a29acca8a96834d69ede --- core/dex_preopt_libart.mk | 4 ++++ core/dex_preopt_libart_boot.mk | 9 ++++++++- target/product/base.mk | 4 ++++ target/product/core_minimal.mk | 4 ++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk index 0f2bb866b1..aa11d1587c 100644 --- a/core/dex_preopt_libart.mk +++ b/core/dex_preopt_libart.mk @@ -25,6 +25,10 @@ PRELOADED_CLASSES := $(call word-colon,1,$(firstword \ COMPILED_CLASSES := $(call word-colon,1,$(firstword \ $(filter %system/etc/compiled-classes,$(PRODUCT_COPY_FILES)))) +# Use the first dirty-image-objects file in PRODUCT_COPY_FILES. +DIRTY_IMAGE_OBJECTS := $(call word-colon,1,$(firstword \ + $(filter %system/etc/dirty-image-objects,$(PRODUCT_COPY_FILES)))) + define get-product-default-property $(strip $(patsubst $(1)=%,%,$(filter $(1)=%,$(PRODUCT_DEFAULT_PROPERTY_OVERRIDES)))) endef diff --git a/core/dex_preopt_libart_boot.mk b/core/dex_preopt_libart_boot.mk index 6e49f64acf..d7281185bb 100644 --- a/core/dex_preopt_libart_boot.mk +++ b/core/dex_preopt_libart_boot.mk @@ -37,6 +37,12 @@ ifneq ($(COMPILED_CLASSES),) COMPILED_CLASSES_FLAGS := --compiled-classes=$(COMPILED_CLASSES) endif +# If we have a dirty-image-objects file, create a parameter. +DIRTY_IMAGE_OBJECTS_FLAGS := +ifneq ($(DIRTY_IMAGE_OBJECTS),) + DIRTY_IMAGE_OBJECTS_FLAGS := --dirty-image-objects=$(DIRTY_IMAGE_OBJECTS) +endif + # The rule to install boot.art # Depends on installed boot.oat, boot-*.art, boot-*.oat $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE) : $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) | $(ACP) $($(my_2nd_arch_prefix)LIBART_TARGET_BOOT_ART_EXTRA_INSTALLED_FILES) @@ -53,6 +59,7 @@ $($(my_2nd_arch_prefix)LIBART_TARGET_BOOT_ART_EXTRA_INSTALLED_FILES) : $($(my_2n ifeq (,$(my_out_boot_image_profile_location)) my_boot_image_flags := $(COMPILED_CLASSES_FLAGS) my_boot_image_flags += --image-classes=$(PRELOADED_CLASSES) +my_boot_image_flags += $(DIRTY_IMAGE_OBJECTS_FLAGS) else my_boot_image_flags := --compiler-filter=speed-profile my_boot_image_flags += --profile-file=$(my_out_boot_image_profile_location) @@ -61,7 +68,7 @@ endif $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME): PRIVATE_BOOT_IMAGE_FLAGS := $(my_boot_image_flags) $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME): PRIVATE_2ND_ARCH_VAR_PREFIX := $(my_2nd_arch_prefix) # Use dex2oat debug version for better error reporting -$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGET_BOOT_DEX_FILES) $(PRELOADED_CLASSES) $(COMPILED_CLASSES) $(DEX2OAT_DEPENDENCY) $(my_out_profile_location) +$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGET_BOOT_DEX_FILES) $(PRELOADED_CLASSES) $(COMPILED_CLASSES) $(DIRTY_IMAGE_OBJECTS) $(DEX2OAT_DEPENDENCY) $(my_out_profile_location) @echo "target dex2oat: $@" @mkdir -p $(dir $@) @mkdir -p $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED)) diff --git a/target/product/base.mk b/target/product/base.mk index 84feaf75a7..a3d8f7e6b6 100644 --- a/target/product/base.mk +++ b/target/product/base.mk @@ -158,5 +158,9 @@ PRODUCT_COPY_FILES := $(call add-to-product-copy-files-if-exists,\ PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists,\ frameworks/base/compiled-classes:system/etc/compiled-classes) +# Note: it is acceptable to not have a dirty-image-objects file. In that case, the special bin +# for known dirty objects in the image will be empty. +PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists,\ + frameworks/base/dirty-image-objects:system/etc/dirty-image-objects) $(call inherit-product, $(SRC_TARGET_DIR)/product/embedded.mk) diff --git a/target/product/core_minimal.mk b/target/product/core_minimal.mk index a40f21605b..7b5a16041c 100644 --- a/target/product/core_minimal.mk +++ b/target/product/core_minimal.mk @@ -150,6 +150,10 @@ PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists,\ frameworks/base/compiled-classes-phone:system/etc/compiled-classes) +# Enable dirty image object binning to reduce dirty pages in the image. +PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists,\ + frameworks/base/dirty-image-objects-phone:system/etc/dirty-image-objects) + # On userdebug builds, collect more tombstones by default. ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ From 37ba2d97df409a18d0bb0968df53f507788a8403 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 11 Aug 2017 14:43:53 -0700 Subject: [PATCH 047/123] Update paths for frameworks/base/config Bug: 64259751 Test: make Change-Id: Ie159ef9f3f96d7ecd22429327a64161bd63f525b --- target/product/base.mk | 6 +++--- target/product/core_minimal.mk | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/product/base.mk b/target/product/base.mk index a3d8f7e6b6..9e3862379d 100644 --- a/target/product/base.mk +++ b/target/product/base.mk @@ -151,16 +151,16 @@ PRODUCT_PACKAGES_DEBUG := \ sqlite3 PRODUCT_COPY_FILES := $(call add-to-product-copy-files-if-exists,\ - frameworks/base/preloaded-classes:system/etc/preloaded-classes) + frameworks/base/config/preloaded-classes:system/etc/preloaded-classes) # Note: it is acceptable to not have a compiled-classes file. In that case, all boot classpath # classes will be compiled. PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists,\ - frameworks/base/compiled-classes:system/etc/compiled-classes) + frameworks/base/config/compiled-classes:system/etc/compiled-classes) # Note: it is acceptable to not have a dirty-image-objects file. In that case, the special bin # for known dirty objects in the image will be empty. PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists,\ - frameworks/base/dirty-image-objects:system/etc/dirty-image-objects) + frameworks/base/config/dirty-image-objects:system/etc/dirty-image-objects) $(call inherit-product, $(SRC_TARGET_DIR)/product/embedded.mk) diff --git a/target/product/core_minimal.mk b/target/product/core_minimal.mk index 7b5a16041c..80df1c9b8c 100644 --- a/target/product/core_minimal.mk +++ b/target/product/core_minimal.mk @@ -148,7 +148,7 @@ PRODUCT_COPY_FILES += \ # Enable boot.oat filtering of compiled classes to reduce boot.oat size. b/28026683 PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists,\ - frameworks/base/compiled-classes-phone:system/etc/compiled-classes) + frameworks/base/config/compiled-classes-phone:system/etc/compiled-classes) # Enable dirty image object binning to reduce dirty pages in the image. PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists,\ From c61b6bd2ed7060e3b8fb661e6b423b59e92d76bf Mon Sep 17 00:00:00 2001 From: Yahan Zhou Date: Fri, 21 Apr 2017 12:14:44 -0700 Subject: [PATCH 048/123] Build vendor image for emulator BUG: 37511975 Test: lunch sdk_gphone_x86-user, make with dist option, unzip sdk_gphone_x86-emulator-eng.xxxx.zip to system image folder, emulator can boot Change-Id: I75b9f0de17fece3dec5ae1662400808af321bd4d --- core/Makefile | 3 ++- target/board/generic/BoardConfig.mk | 5 +++++ target/board/generic_arm64/BoardConfig.mk | 5 +++++ target/board/generic_mips/BoardConfig.mk | 5 +++++ target/board/generic_mips64/BoardConfig.mk | 5 +++++ target/board/generic_x86/BoardConfig.mk | 5 +++++ target/board/generic_x86_64/BoardConfig.mk | 5 +++++ 7 files changed, 32 insertions(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index c6c9ebf60b..3b9960812b 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2768,7 +2768,8 @@ INTERNAL_EMULATOR_PACKAGE_FILES += \ prebuilts/qemu-kernel/$(TARGET_ARCH)/kernel-qemu \ $(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_SYSTEMIMAGE) \ - $(INSTALLED_USERDATAIMAGE_TARGET) + $(INSTALLED_USERDATAIMAGE_TARGET) \ + $(INSTALLED_VENDORIMAGE_TARGET) name := $(TARGET_PRODUCT)-emulator-$(FILE_NAME_TAG) diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 609cf25d93..ee5eedc388 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -52,6 +52,11 @@ USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 # 2 GB BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 +TARGET_COPY_OUT_VENDOR := vendor +# ~100 MB vendor image. Please adjust system image / vendor image sizes +# when finalizing them. +BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index 56a86b8db5..143623c23d 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -83,6 +83,11 @@ USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2684354560 # 2.5 GB BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 +TARGET_COPY_OUT_VENDOR := vendor +# ~100 MB vendor image. Please adjust system image / vendor image sizes +# when finalizing them. +BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 diff --git a/target/board/generic_mips/BoardConfig.mk b/target/board/generic_mips/BoardConfig.mk index cd29f3527d..e12fb73eee 100644 --- a/target/board/generic_mips/BoardConfig.mk +++ b/target/board/generic_mips/BoardConfig.mk @@ -60,6 +60,11 @@ USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 # 2 GB BOARD_USERDATAIMAGE_PARTITION_SIZE := 734003200 +TARGET_COPY_OUT_VENDOR := vendor +# ~100 MB vendor image. Please adjust system image / vendor image sizes +# when finalizing them. +BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 diff --git a/target/board/generic_mips64/BoardConfig.mk b/target/board/generic_mips64/BoardConfig.mk index 17aae27b58..4a6ca02451 100644 --- a/target/board/generic_mips64/BoardConfig.mk +++ b/target/board/generic_mips64/BoardConfig.mk @@ -75,6 +75,11 @@ USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1879048192 # 1.75 GB BOARD_USERDATAIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB, lots of space for running tests +TARGET_COPY_OUT_VENDOR := vendor +# ~100 MB vendor image. Please adjust system image / vendor image sizes +# when finalizing them. +BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index 08bd6d144f..1ac50af70c 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -42,6 +42,11 @@ USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 +TARGET_COPY_OUT_VENDOR := vendor +# ~100 MB vendor image. Please adjust system image / vendor image sizes +# when finalizing them. +BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index 2499199944..51f9b8983c 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -45,6 +45,11 @@ USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2684354560 # 2.5 GB BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 +TARGET_COPY_OUT_VENDOR := vendor +# ~100 MB vendor image. Please adjust system image / vendor image sizes +# when finalizing them. +BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 From d5f90a52e710e80c94e64780317ea196ef6bdab6 Mon Sep 17 00:00:00 2001 From: bohu Date: Fri, 26 May 2017 10:26:15 -0700 Subject: [PATCH 049/123] build-emulator: fully treblize emulator image Install emulator specific binaries and libraries to vendor partition; update selinux; add vndk. BUG: 37511975 Test: build user build, launch emualtor, run CTS. Change-Id: I70f58947e98b41b195d77b4347d2efdc09348392 --- target/board/generic/sepolicy/adbd.te | 1 + target/board/generic/sepolicy/audioserver.te | 1 + target/board/generic/sepolicy/bootanim.te | 3 +- target/board/generic/sepolicy/cameraserver.te | 2 + target/board/generic/sepolicy/file.te | 1 - target/board/generic/sepolicy/file_contexts | 25 +++++-- .../board/generic/sepolicy/goldfish_setup.te | 27 ++----- .../generic/sepolicy/hal_drm_widevine.te | 11 +++ target/board/generic/sepolicy/init.te | 1 + target/board/generic/sepolicy/mediacodec.te | 1 + target/board/generic/sepolicy/netd.te | 2 + target/board/generic/sepolicy/priv_app.te | 5 ++ target/board/generic/sepolicy/qemu_props.te | 5 +- target/board/generic/sepolicy/qemud.te | 8 -- target/board/generic/sepolicy/rild.te | 1 - .../board/generic/sepolicy/system_server.te | 1 - target/board/generic/sepolicy/vold.te | 1 + target/board/generic/sepolicy/zygote.te | 3 + target/product/emulator.mk | 74 +++++++++++++++---- 19 files changed, 113 insertions(+), 60 deletions(-) create mode 100644 target/board/generic/sepolicy/adbd.te create mode 100644 target/board/generic/sepolicy/audioserver.te create mode 100644 target/board/generic/sepolicy/cameraserver.te create mode 100644 target/board/generic/sepolicy/hal_drm_widevine.te create mode 100644 target/board/generic/sepolicy/mediacodec.te create mode 100644 target/board/generic/sepolicy/priv_app.te delete mode 100644 target/board/generic/sepolicy/qemud.te delete mode 100644 target/board/generic/sepolicy/rild.te create mode 100644 target/board/generic/sepolicy/vold.te diff --git a/target/board/generic/sepolicy/adbd.te b/target/board/generic/sepolicy/adbd.te new file mode 100644 index 0000000000..9546c1a472 --- /dev/null +++ b/target/board/generic/sepolicy/adbd.te @@ -0,0 +1 @@ +set_prop(adbd, ctl_mdnsd_prop); diff --git a/target/board/generic/sepolicy/audioserver.te b/target/board/generic/sepolicy/audioserver.te new file mode 100644 index 0000000000..c3c4a3a3d0 --- /dev/null +++ b/target/board/generic/sepolicy/audioserver.te @@ -0,0 +1 @@ +allow audioserver bootanim:binder call; diff --git a/target/board/generic/sepolicy/bootanim.te b/target/board/generic/sepolicy/bootanim.te index b4b1eef832..4be1c8a204 100644 --- a/target/board/generic/sepolicy/bootanim.te +++ b/target/board/generic/sepolicy/bootanim.te @@ -1,4 +1,5 @@ allow bootanim self:process execmem; allow bootanim ashmem_device:chr_file execute; - +#TODO: This can safely be ignored until b/62954877 is fixed +dontaudit bootanim system_data_file:dir read; set_prop(bootanim, qemu_prop) diff --git a/target/board/generic/sepolicy/cameraserver.te b/target/board/generic/sepolicy/cameraserver.te new file mode 100644 index 0000000000..6cf5d6ae48 --- /dev/null +++ b/target/board/generic/sepolicy/cameraserver.te @@ -0,0 +1,2 @@ +allow cameraserver system_file:dir { open read }; +allow cameraserver hal_allocator:fd use; diff --git a/target/board/generic/sepolicy/file.te b/target/board/generic/sepolicy/file.te index 9227f8018a..f4ae9e43b3 100644 --- a/target/board/generic/sepolicy/file.te +++ b/target/board/generic/sepolicy/file.te @@ -1,2 +1 @@ -type qemud_socket, file_type; type sysfs_writable, fs_type, sysfs_type, mlstrustedobject; diff --git a/target/board/generic/sepolicy/file_contexts b/target/board/generic/sepolicy/file_contexts index d1a1e8cefc..f550f4db2e 100644 --- a/target/board/generic/sepolicy/file_contexts +++ b/target/board/generic/sepolicy/file_contexts @@ -7,16 +7,29 @@ /dev/block/vda u:object_r:system_block_device:s0 /dev/block/vdb u:object_r:cache_block_device:s0 /dev/block/vdc u:object_r:userdata_block_device:s0 +/dev/block/vdd u:object_r:metadata_block_device:s0 +/dev/block/vde u:object_r:system_block_device:s0 /dev/goldfish_pipe u:object_r:qemu_device:s0 /dev/goldfish_sync u:object_r:qemu_device:s0 /dev/qemu_.* u:object_r:qemu_device:s0 -/dev/socket/qemud u:object_r:qemud_socket:s0 /dev/ttyGF[0-9]* u:object_r:serial_device:s0 /dev/ttyS2 u:object_r:console_device:s0 -/system/bin/qemud u:object_r:qemud_exec:s0 /sys/qemu_trace(/.*)? u:object_r:sysfs_writable:s0 -/system/etc/init.goldfish.sh u:object_r:goldfish_setup_exec:s0 -/system/vendor/bin/init.ranchu-core.sh u:object_r:goldfish_setup_exec:s0 -/system/vendor/bin/init.ranchu-net.sh u:object_r:goldfish_setup_exec:s0 -/system/bin/qemu-props u:object_r:qemu_props_exec:s0 +/vendor/bin/init\.ranchu-core\.sh u:object_r:goldfish_setup_exec:s0 +/vendor/bin/init\.ranchu-net\.sh u:object_r:goldfish_setup_exec:s0 +/vendor/bin/qemu-props u:object_r:qemu_props_exec:s0 + +/vendor/bin/hw/android\.hardware\.drm@1\.0-service\.widevine u:object_r:hal_drm_widevine_exec:s0 + +/vendor/lib(64)?/hw/gralloc\.ranchu\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libEGL_emulation\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libGLESv1_CM_emulation\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libGLESv2_emulation\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libEGL_swiftshader\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libGLESv1_CM_swiftshader\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libGLESv2_swiftshader\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libOpenglSystemCommon\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/lib_renderControl_enc\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libGLESv1_enc\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libGLESv2_enc\.so u:object_r:same_process_hal_file:s0 diff --git a/target/board/generic/sepolicy/goldfish_setup.te b/target/board/generic/sepolicy/goldfish_setup.te index 78d20fca06..bcd49bdc43 100644 --- a/target/board/generic/sepolicy/goldfish_setup.te +++ b/target/board/generic/sepolicy/goldfish_setup.te @@ -1,29 +1,12 @@ # goldfish-setup service: runs init.goldfish.sh script type goldfish_setup, domain; -type goldfish_setup_exec, exec_type, file_type; +type goldfish_setup_exec, vendor_file_type, exec_type, file_type; init_daemon_domain(goldfish_setup) -# Inherit open file to shell (interpreter) for script. -allow goldfish_setup shell_exec:file rx_file_perms; - -# Run ifconfig, route commands to configure interfaces and routes. -allow goldfish_setup system_file:file execute_no_trans; -allow goldfish_setup toolbox_exec:file rx_file_perms; allow goldfish_setup self:capability { net_admin net_raw }; -allow goldfish_setup self:udp_socket create_socket_perms; +allow goldfish_setup self:udp_socket { create ioctl }; +allow goldfish_setup vendor_toolbox_exec:file execute_no_trans; allowxperm goldfish_setup self:udp_socket ioctl priv_sock_ioctls; - -wakelock_use(goldfish_setup) -net_domain(goldfish_setup) - -# Set net.eth0.dns*, debug.sf.nobootanimation -set_prop(goldfish_setup, system_prop) -set_prop(goldfish_setup, debug_prop) - -# Set ro.radio.noril -set_prop(goldfish_setup, radio_noril_prop) - -# Stop ril-daemon service (by setting ctl.stop to ril-daemon, which -# transforms to a permission check on ctl.ril-daemon). -set_prop(goldfish_setup, ctl_rildaemon_prop) +wakelock_use(goldfish_setup); +allow goldfish_setup vendor_shell_exec:file { rx_file_perms }; diff --git a/target/board/generic/sepolicy/hal_drm_widevine.te b/target/board/generic/sepolicy/hal_drm_widevine.te new file mode 100644 index 0000000000..c1a63ca742 --- /dev/null +++ b/target/board/generic/sepolicy/hal_drm_widevine.te @@ -0,0 +1,11 @@ +# define SELinux domain +type hal_drm_widevine, domain; +hal_server_domain(hal_drm_widevine, hal_drm) + +type hal_drm_widevine_exec, exec_type, vendor_file_type, file_type; +init_daemon_domain(hal_drm_widevine) + +allow hal_drm mediacodec:fd use; +allow hal_drm { appdomain -isolated_app }:fd use; + +hal_client_domain(hal_drm_widevine, hal_graphics_composer); diff --git a/target/board/generic/sepolicy/init.te b/target/board/generic/sepolicy/init.te index 3aa81d1b58..84a4e8dbfe 100644 --- a/target/board/generic/sepolicy/init.te +++ b/target/board/generic/sepolicy/init.te @@ -1 +1,2 @@ allow init tmpfs:lnk_file create_file_perms; +dontaudit init kernel:system module_request; diff --git a/target/board/generic/sepolicy/mediacodec.te b/target/board/generic/sepolicy/mediacodec.te new file mode 100644 index 0000000000..acf4e59b94 --- /dev/null +++ b/target/board/generic/sepolicy/mediacodec.te @@ -0,0 +1 @@ +allow mediacodec system_file:dir { open read }; diff --git a/target/board/generic/sepolicy/netd.te b/target/board/generic/sepolicy/netd.te index 2b002ec9c6..09a28b9967 100644 --- a/target/board/generic/sepolicy/netd.te +++ b/target/board/generic/sepolicy/netd.te @@ -1 +1,3 @@ dontaudit netd self:capability sys_module; +#TODO: This can safely be ignored until b/62954877 is fixed +dontaudit netd kernel:system module_request; diff --git a/target/board/generic/sepolicy/priv_app.te b/target/board/generic/sepolicy/priv_app.te new file mode 100644 index 0000000000..3d16f32b0f --- /dev/null +++ b/target/board/generic/sepolicy/priv_app.te @@ -0,0 +1,5 @@ +#TODO: b/62908025 +dontaudit priv_app firstboot_prop:file { getattr open }; +dontaudit priv_app device:dir { open read }; +dontaudit priv_app proc_interrupts:file { getattr open read }; +dontaudit priv_app proc_modules:file { getattr open read }; diff --git a/target/board/generic/sepolicy/qemu_props.te b/target/board/generic/sepolicy/qemu_props.te index d5571fd229..0f5ec8c941 100644 --- a/target/board/generic/sepolicy/qemu_props.te +++ b/target/board/generic/sepolicy/qemu_props.te @@ -1,12 +1,9 @@ # qemu-props service: Sets system properties on boot. type qemu_props, domain; -type qemu_props_exec, exec_type, file_type; +type qemu_props_exec, vendor_file_type, exec_type, file_type; init_daemon_domain(qemu_props) -# Set properties. set_prop(qemu_props, qemu_prop) set_prop(qemu_props, dalvik_prop) -set_prop(qemu_props, config_prop) -set_prop(qemu_props, opengles_prop) set_prop(qemu_props, qemu_cmdline) diff --git a/target/board/generic/sepolicy/qemud.te b/target/board/generic/sepolicy/qemud.te deleted file mode 100644 index eee21c4062..0000000000 --- a/target/board/generic/sepolicy/qemud.te +++ /dev/null @@ -1,8 +0,0 @@ -# qemu support daemon -type qemud, domain; -type qemud_exec, exec_type, file_type; - -init_daemon_domain(qemud) - -# Access /dev/ttyS1 and /dev/ttyGF1. -allow qemud serial_device:chr_file rw_file_perms; diff --git a/target/board/generic/sepolicy/rild.te b/target/board/generic/sepolicy/rild.te deleted file mode 100644 index e148b6c139..0000000000 --- a/target/board/generic/sepolicy/rild.te +++ /dev/null @@ -1 +0,0 @@ -unix_socket_connect(rild, qemud, qemud) diff --git a/target/board/generic/sepolicy/system_server.te b/target/board/generic/sepolicy/system_server.te index f9e277b8aa..906309563d 100644 --- a/target/board/generic/sepolicy/system_server.te +++ b/target/board/generic/sepolicy/system_server.te @@ -1,3 +1,2 @@ -unix_socket_connect(system_server, qemud, qemud) get_prop(system_server, opengles_prop) get_prop(system_server, radio_noril_prop) diff --git a/target/board/generic/sepolicy/vold.te b/target/board/generic/sepolicy/vold.te new file mode 100644 index 0000000000..5f3bdd446e --- /dev/null +++ b/target/board/generic/sepolicy/vold.te @@ -0,0 +1 @@ +dontaudit vold kernel:system module_request; diff --git a/target/board/generic/sepolicy/zygote.te b/target/board/generic/sepolicy/zygote.te index a90f02b1ac..e97d895c30 100644 --- a/target/board/generic/sepolicy/zygote.te +++ b/target/board/generic/sepolicy/zygote.te @@ -1 +1,4 @@ set_prop(zygote, qemu_prop) +# TODO (b/63631799) fix this access +# Suppress denials to storage. Webview zygote should not be accessing. +dontaudit webview_zygote mnt_expand_file:dir getattr; diff --git a/target/product/emulator.mk b/target/product/emulator.mk index 5a5fb8e1b1..0e1e581cdd 100644 --- a/target/product/emulator.mk +++ b/target/product/emulator.mk @@ -36,11 +36,13 @@ PRODUCT_PACKAGES += \ libGLESv2_emulation \ libGLESv1_enc \ qemu-props \ - qemud \ camera.goldfish \ camera.goldfish.jpeg \ camera.ranchu \ camera.ranchu.jpeg \ + keystore.goldfish \ + keystore.ranchu \ + gatekeeper.ranchu \ lights.goldfish \ gps.goldfish \ gps.ranchu \ @@ -62,7 +64,9 @@ PRODUCT_PACKAGES += \ android.hardware.graphics.mapper@2.0-impl \ hwcomposer.goldfish \ hwcomposer.ranchu \ + sh_vendor \ vintf \ + toybox_vendor \ CarrierConfig PRODUCT_PACKAGES += \ @@ -72,40 +76,78 @@ PRODUCT_PACKAGES += \ android.hardware.soundtrigger@2.0-impl PRODUCT_PACKAGES += \ - android.hardware.keymaster@3.0-impl \ - android.hardware.keymaster@3.0-service + android.hardware.keymaster@3.0-impl \ + android.hardware.keymaster@3.0-service PRODUCT_PACKAGES += \ android.hardware.gnss@1.0-service \ android.hardware.gnss@1.0-impl PRODUCT_PACKAGES += \ - android.hardware.sensors@1.0-impl \ - android.hardware.sensors@1.0-service + android.hardware.sensors@1.0-impl \ + android.hardware.sensors@1.0-service + +PRODUCT_PACKAGES += \ + android.hardware.drm@1.0-service \ + android.hardware.drm@1.0-impl PRODUCT_PACKAGES += \ android.hardware.power@1.0-service \ android.hardware.power@1.0-impl -# camera service treble disable until all backwards compat is complete -PRODUCT_PROPERTY_OVERRIDES += \ - camera.disable_treble=1 +PRODUCT_PACKAGES += \ + camera.device@1.0-impl \ + android.hardware.camera.provider@2.4-service \ + android.hardware.camera.provider@2.4-impl \ + +PRODUCT_PACKAGES += \ + android.hardware.gatekeeper@1.0-impl \ + android.hardware.gatekeeper@1.0-service + +# need this for gles libraries to load properly +# after moving to /vendor/lib/ +PRODUCT_PACKAGES += \ + android.hardware.renderscript@1.0.vndk-sp\ + android.hardware.graphics.allocator@2.0.vndk-sp\ + android.hardware.graphics.mapper@2.0.vndk-sp\ + android.hardware.graphics.common@1.0.vndk-sp\ + libhwbinder.vndk-sp\ + libbase.vndk-sp\ + libcutils.vndk-sp\ + libhardware.vndk-sp\ + libhidlbase.vndk-sp\ + libhidltransport.vndk-sp\ + libutils.vndk-sp\ + libc++.vndk-sp\ + libRS_internal.vndk-sp\ + libRSDriver.vndk-sp\ + libRSCpuRef.vndk-sp\ + libbcinfo.vndk-sp\ + libblas.vndk-sp\ + libft2.vndk-sp\ + libpng.vndk-sp\ + libcompiler_rt.vndk-sp\ + libbacktrace.vndk-sp\ + libunwind.vndk-sp\ + liblzma.vndk-sp\ + libz.vndk-sp\ + PRODUCT_COPY_FILES += \ - device/generic/goldfish/fstab.goldfish:root/fstab.goldfish \ - device/generic/goldfish/init.goldfish.rc:root/init.goldfish.rc \ - device/generic/goldfish/init.goldfish.sh:system/etc/init.goldfish.sh \ - device/generic/goldfish/init.ranchu-core.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.ranchu-core.sh \ - device/generic/goldfish/init.ranchu-net.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.ranchu-net.sh \ - device/generic/goldfish/init.ranchu.rc:root/init.ranchu.rc \ - device/generic/goldfish/ueventd.goldfish.rc:root/ueventd.goldfish.rc \ + device/generic/goldfish/init.ranchu-core.sh:vendor/bin/init.ranchu-core.sh \ + device/generic/goldfish/init.ranchu-net.sh:vendor/bin/init.ranchu-net.sh \ device/generic/goldfish/init.ranchu.rc:root/init.ranchu.rc \ device/generic/goldfish/fstab.ranchu:root/fstab.ranchu \ + device/generic/goldfish/fstab.ranchu.early:root/fstab.ranchu.early \ device/generic/goldfish/ueventd.ranchu.rc:root/ueventd.ranchu.rc \ - device/generic/goldfish/manifest.xml:$(TARGET_COPY_OUT_VENDOR)/manifest.xml \ device/generic/goldfish/input/goldfish_rotary.idc:system/usr/idc/goldfish_rotary.idc \ + device/generic/goldfish/manifest.xml:$(TARGET_COPY_OUT_VENDOR)/manifest.xml \ + device/generic/goldfish/data/etc/permissions/privapp-permissions-goldfish.xml:system/etc/permissions/privapp-permissions-goldfish.xml \ + device/generic/goldfish/data/etc/config.ini:config.ini \ frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml PRODUCT_PACKAGE_OVERLAYS := device/generic/goldfish/overlay PRODUCT_CHARACTERISTICS := emulator + +PRODUCT_FULL_TREBLE_OVERRIDE := true From f2e71a4353b45a8b06327b00048e05301f424f31 Mon Sep 17 00:00:00 2001 From: bohu Date: Thu, 15 Jun 2017 11:35:39 -0700 Subject: [PATCH 050/123] sdk:enable emulator to launch in build environment Recent changes in emulator requires advancedFeatures.ini, encryptionkey.img and new kernels (such as 3.18) at OUT directory so emulator can find them. This CL set those up as part of the build process. Change-Id: Ib3b7c4c48a22cecb44255e643402fd1c37797522 --- target/product/sdk_phone_arm64.mk | 9 +++++++++ target/product/sdk_phone_armv7.mk | 9 +++++++++ target/product/sdk_phone_x86.mk | 4 ++++ target/product/sdk_phone_x86_64.mk | 5 +++++ 4 files changed, 27 insertions(+) diff --git a/target/product/sdk_phone_arm64.mk b/target/product/sdk_phone_arm64.mk index a689475b3b..3bab84d452 100644 --- a/target/product/sdk_phone_arm64.mk +++ b/target/product/sdk_phone_arm64.mk @@ -19,6 +19,15 @@ # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. +# Note: the following lines need to stay at the beginning so that it can +# take priority and override the rules it inherit from other mk files +# see copy file rules in core/Makefile +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \ + prebuilts/qemu-kernel/arm64/3.18/kernel-qemu2:kernel-ranchu \ + device/generic/goldfish/fstab.ranchu.arm:root/fstab.ranchu \ + device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early + $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk) diff --git a/target/product/sdk_phone_armv7.mk b/target/product/sdk_phone_armv7.mk index ebdd0e7f42..910692f926 100644 --- a/target/product/sdk_phone_armv7.mk +++ b/target/product/sdk_phone_armv7.mk @@ -14,6 +14,15 @@ # limitations under the License. # +# Note: the following lines need to stay at the beginning so that it can +# take priority and override the rules it inherit from other mk files +# see copy file rules in core/Makefile +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \ + prebuilts/qemu-kernel/arm/3.18/kernel-qemu2:kernel-ranchu \ + device/generic/goldfish/fstab.ranchu.arm:root/fstab.ranchu \ + device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early + $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) # AOSP emulator images build the AOSP messaging app. diff --git a/target/product/sdk_phone_x86.mk b/target/product/sdk_phone_x86.mk index 01c2e8339f..90f4e164b0 100644 --- a/target/product/sdk_phone_x86.mk +++ b/target/product/sdk_phone_x86.mk @@ -18,6 +18,10 @@ # Open-Source part of the tree. It's geared toward a US-centric # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini:advancedFeatures.ini \ + device/generic/goldfish/data/etc/encryptionkey.img:encryptionkey.img \ + prebuilts/qemu-kernel/x86/3.18/kernel-qemu2:kernel-ranchu $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) diff --git a/target/product/sdk_phone_x86_64.mk b/target/product/sdk_phone_x86_64.mk index c3bc5e9589..63e6843375 100644 --- a/target/product/sdk_phone_x86_64.mk +++ b/target/product/sdk_phone_x86_64.mk @@ -19,6 +19,11 @@ # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini:advancedFeatures.ini \ + device/generic/goldfish/data/etc/encryptionkey.img:encryptionkey.img \ + prebuilts/qemu-kernel/x86_64/3.18/kernel-qemu2:kernel-ranchu + $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) From cb694ebb345fae6656ab7e7ad5629550392472af Mon Sep 17 00:00:00 2001 From: bohu Date: Thu, 22 Jun 2017 22:03:32 -0700 Subject: [PATCH 051/123] emulator: move rild.libpath to vendor BUG: 62137708 Test: buld sdk_gphone_x86-user, launch emulator make sure radio works Change-Id: I4ef1483a8d95a74b54deb6f0d4b2461c733c8140 --- target/board/generic/BoardConfig.mk | 2 +- target/board/generic/system.prop | 1 - target/board/generic_arm64/BoardConfig.mk | 1 + target/board/generic_arm64/system.prop | 1 - target/board/generic_x86/BoardConfig.mk | 1 + target/board/generic_x86/system.prop | 1 - target/board/generic_x86_64/BoardConfig.mk | 1 + target/board/generic_x86_64/system.prop | 1 - target/product/sdk_phone_arm64.mk | 3 +++ target/product/sdk_phone_armv7.mk | 3 +++ target/product/sdk_phone_x86.mk | 3 +++ target/product/sdk_phone_x86_64.mk | 3 +++ 12 files changed, 16 insertions(+), 5 deletions(-) diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index ee5eedc388..016fa63444 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -63,4 +63,4 @@ BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy - +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/generic/system.prop b/target/board/generic/system.prop index 5b2e7bf43e..ad8e5b806e 100644 --- a/target/board/generic/system.prop +++ b/target/board/generic/system.prop @@ -3,4 +3,3 @@ # rild.libpath=/vendor/lib/libreference-ril.so -rild.libargs=-d /dev/ttyS0 diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index 143623c23d..b2441a39b1 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -93,4 +93,5 @@ BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy diff --git a/target/board/generic_arm64/system.prop b/target/board/generic_arm64/system.prop index 32c512953b..5b0183a37c 100644 --- a/target/board/generic_arm64/system.prop +++ b/target/board/generic_arm64/system.prop @@ -3,4 +3,3 @@ # rild.libpath=/vendor/lib64/libreference-ril.so -rild.libargs=-d /dev/ttyS0 diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index 1ac50af70c..cd03c4c9c0 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -43,6 +43,7 @@ TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 TARGET_COPY_OUT_VENDOR := vendor +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true # ~100 MB vendor image. Please adjust system image / vendor image sizes # when finalizing them. BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 diff --git a/target/board/generic_x86/system.prop b/target/board/generic_x86/system.prop index 973db2c801..64829f3ce4 100644 --- a/target/board/generic_x86/system.prop +++ b/target/board/generic_x86/system.prop @@ -3,4 +3,3 @@ # rild.libpath=/vendor/lib/libreference-ril.so -rild.libargs=-d /dev/ttyS0 diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index 51f9b8983c..c7d6a25c36 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -54,6 +54,7 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true BOARD_SEPOLICY_DIRS += \ build/target/board/generic/sepolicy \ diff --git a/target/board/generic_x86_64/system.prop b/target/board/generic_x86_64/system.prop index 5e546c4965..ed9d1731c7 100644 --- a/target/board/generic_x86_64/system.prop +++ b/target/board/generic_x86_64/system.prop @@ -3,4 +3,3 @@ # rild.libpath=/vendor/lib64/libreference-ril.so -rild.libargs=-d /dev/ttyS0 diff --git a/target/product/sdk_phone_arm64.mk b/target/product/sdk_phone_arm64.mk index 3bab84d452..599673ae50 100644 --- a/target/product/sdk_phone_arm64.mk +++ b/target/product/sdk_phone_arm64.mk @@ -14,6 +14,9 @@ # limitations under the License. # +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib64/libreference-ril.so + # This is a build configuration for a full-featured build of the # Open-Source part of the tree. It's geared toward a US-centric # build quite specifically for the emulator, and might not be diff --git a/target/product/sdk_phone_armv7.mk b/target/product/sdk_phone_armv7.mk index 910692f926..e99f0f5b43 100644 --- a/target/product/sdk_phone_armv7.mk +++ b/target/product/sdk_phone_armv7.mk @@ -14,6 +14,9 @@ # limitations under the License. # +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib/libreference-ril.so + # Note: the following lines need to stay at the beginning so that it can # take priority and override the rules it inherit from other mk files # see copy file rules in core/Makefile diff --git a/target/product/sdk_phone_x86.mk b/target/product/sdk_phone_x86.mk index 90f4e164b0..1e827732f7 100644 --- a/target/product/sdk_phone_x86.mk +++ b/target/product/sdk_phone_x86.mk @@ -14,6 +14,9 @@ # limitations under the License. # +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib/libreference-ril.so + # This is a build configuration for a full-featured build of the # Open-Source part of the tree. It's geared toward a US-centric # build quite specifically for the emulator, and might not be diff --git a/target/product/sdk_phone_x86_64.mk b/target/product/sdk_phone_x86_64.mk index 63e6843375..a18c4f8864 100644 --- a/target/product/sdk_phone_x86_64.mk +++ b/target/product/sdk_phone_x86_64.mk @@ -14,6 +14,9 @@ # limitations under the License. # +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib64/libreference-ril.so + # This is a build configuration for a full-featured build of the # Open-Source part of the tree. It's geared toward a US-centric # build quite specifically for the emulator, and might not be From e5e0742444d0a6fc93c68b989d34215d12e30693 Mon Sep 17 00:00:00 2001 From: bohu Date: Fri, 19 May 2017 15:07:02 -0700 Subject: [PATCH 052/123] emualtor: keep libopenjdkjvmti*.so on sdk images BUG: 38353037 Those libopenjdkjvmti*.so files are needed by profilers. Those files are shipped on real devices as well. Change-Id: Iac7dd2844b0f3ea5194dec8732fbaacf53c4bf4a --- core/main.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/main.mk b/core/main.mk index 81ab0becca..3d42c8f72d 100644 --- a/core/main.mk +++ b/core/main.mk @@ -877,6 +877,8 @@ ifdef is_sdk_build $(TARGET_OUT_DATA)/%, \ $(sort $(call get-tagged-modules,gnu))) target_gnu_MODULES := $(filter-out $(TARGET_OUT_EXECUTABLES)/%,$(target_gnu_MODULES)) + target_gnu_MODULES := $(filter-out %/libopenjdkjvmti.so,$(target_gnu_MODULES)) + target_gnu_MODULES := $(filter-out %/libopenjdkjvmtid.so,$(target_gnu_MODULES)) $(info Removing from sdk:)$(foreach d,$(target_gnu_MODULES),$(info : $(d))) modules_to_install := \ $(filter-out $(target_gnu_MODULES),$(modules_to_install)) From 753e9e4462cb5350f0ba98c76a720cb7b408c3a1 Mon Sep 17 00:00:00 2001 From: bohu Date: Thu, 10 Aug 2017 00:20:01 -0700 Subject: [PATCH 053/123] emulator: squash misc modifications from oc-emu-dev Change-Id: I7380292cd4dc851a987683bdf61d511dbf74aff6 --- core/Makefile | 3 +-- core/tasks/sdk-addon.mk | 4 +++- target/board/generic/BoardConfig.mk | 1 + target/board/generic/device.mk | 3 +-- target/board/generic_arm64/BoardConfig.mk | 1 + target/board/generic_arm64/device.mk | 3 +-- target/board/generic_mips/BoardConfig.mk | 1 + target/board/generic_mips/device.mk | 3 +-- target/board/generic_mips64/BoardConfig.mk | 1 + target/board/generic_mips64/device.mk | 3 +-- target/board/generic_x86/BoardConfig.mk | 3 ++- target/board/generic_x86/device.mk | 3 +-- target/board/generic_x86_64/BoardConfig.mk | 1 + target/board/generic_x86_64/device.mk | 3 +-- target/product/aosp_arm.mk | 15 ++++++++++++++- target/product/aosp_arm64.mk | 16 ++++++++++++---- target/product/aosp_x86.mk | 13 +++++++++++++ target/product/aosp_x86_64.mk | 14 +++++++------- target/product/sdk_base.mk | 4 ++-- target/product/sdk_phone_arm64.mk | 2 ++ 20 files changed, 67 insertions(+), 30 deletions(-) diff --git a/core/Makefile b/core/Makefile index 3b9960812b..c6c9ebf60b 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2768,8 +2768,7 @@ INTERNAL_EMULATOR_PACKAGE_FILES += \ prebuilts/qemu-kernel/$(TARGET_ARCH)/kernel-qemu \ $(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_SYSTEMIMAGE) \ - $(INSTALLED_USERDATAIMAGE_TARGET) \ - $(INSTALLED_VENDORIMAGE_TARGET) + $(INSTALLED_USERDATAIMAGE_TARGET) name := $(TARGET_PRODUCT)-emulator-$(FILE_NAME_TAG) diff --git a/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk index e3bd47d13e..e26773ce80 100644 --- a/core/tasks/sdk-addon.mk +++ b/core/tasks/sdk-addon.mk @@ -64,6 +64,7 @@ endif # Files copied in the system-image directory files_to_copy += \ $(addon_dir_img):$(INSTALLED_QEMU_SYSTEMIMAGE):images/$(TARGET_CPU_ABI)/system.img \ + $(addon_dir_img):$(INSTALLED_QEMU_VENDORIMAGE):images/$(TARGET_CPU_ABI)/vendor.img \ $(addon_dir_img):$(BUILT_USERDATAIMAGE_TARGET):images/$(TARGET_CPU_ABI)/userdata.img \ $(addon_dir_img):$(BUILT_RAMDISK_TARGET):images/$(TARGET_CPU_ABI)/ramdisk.img \ $(addon_dir_img):$(PRODUCT_OUT)/system/build.prop:images/$(TARGET_CPU_ABI)/build.prop \ @@ -114,9 +115,10 @@ $(full_target): $(sdk_addon_deps) | $(ACP) $(hide) ( F=$$(pwd)/$@ ; cd $(PRIVATE_STAGING_DIR)/.. && zip -rqX $$F $(notdir $(PRIVATE_STAGING_DIR)) ) $(full_target_img): PRIVATE_STAGING_DIR := $(call append-path,$(staging),$(addon_dir_img))/images/$(TARGET_CPU_ABI) -$(full_target_img): $(full_target) $(addon_img_source_prop) +$(full_target_img): $(full_target) $(addon_img_source_prop) | $(ACP) @echo Packaging SDK Addon System-Image: $@ $(hide) mkdir -p $(dir $@) + $(ACP) -r $(PRODUCT_OUT)/data $(PRIVATE_STAGING_DIR)/data $(hide) ( F=$$(pwd)/$@ ; cd $(PRIVATE_STAGING_DIR)/.. && zip -rqX $$F $(notdir $(PRIVATE_STAGING_DIR)) ) diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 016fa63444..8bb3ed0d90 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -61,6 +61,7 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/generic/device.mk b/target/board/generic/device.mk index e56a4d1d34..e18c1652b4 100644 --- a/target/board/generic/device.mk +++ b/target/board/generic/device.mk @@ -19,8 +19,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.ril.hsxpa=1 \ - ro.ril.gprsclass=10 \ - ro.adb.qemud=1 + ro.ril.gprsclass=10 PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index b2441a39b1..a7a8943efb 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -92,6 +92,7 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy diff --git a/target/board/generic_arm64/device.mk b/target/board/generic_arm64/device.mk index 9647a4ebe8..ca287eb8b2 100644 --- a/target/board/generic_arm64/device.mk +++ b/target/board/generic_arm64/device.mk @@ -19,8 +19,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.ril.hsxpa=1 \ - ro.ril.gprsclass=10 \ - ro.adb.qemud=1 + ro.ril.gprsclass=10 PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ diff --git a/target/board/generic_mips/BoardConfig.mk b/target/board/generic_mips/BoardConfig.mk index e12fb73eee..a9e46b42a3 100644 --- a/target/board/generic_mips/BoardConfig.mk +++ b/target/board/generic_mips/BoardConfig.mk @@ -69,5 +69,6 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy diff --git a/target/board/generic_mips/device.mk b/target/board/generic_mips/device.mk index 06a7d8a3e2..a2633e1876 100644 --- a/target/board/generic_mips/device.mk +++ b/target/board/generic_mips/device.mk @@ -19,8 +19,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.ril.hsxpa=1 \ - ro.ril.gprsclass=10 \ - ro.adb.qemud=1 + ro.ril.gprsclass=10 PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ diff --git a/target/board/generic_mips64/BoardConfig.mk b/target/board/generic_mips64/BoardConfig.mk index 4a6ca02451..6cb6c11a57 100644 --- a/target/board/generic_mips64/BoardConfig.mk +++ b/target/board/generic_mips64/BoardConfig.mk @@ -84,6 +84,7 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy diff --git a/target/board/generic_mips64/device.mk b/target/board/generic_mips64/device.mk index 66ec9db9b9..2ccbcbd185 100644 --- a/target/board/generic_mips64/device.mk +++ b/target/board/generic_mips64/device.mk @@ -19,8 +19,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.ril.hsxpa=1 \ - ro.ril.gprsclass=10 \ - ro.adb.qemud=1 + ro.ril.gprsclass=10 PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index cd03c4c9c0..bb2166b536 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -40,7 +40,7 @@ BUILD_QEMU_IMAGES := true USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2684354560 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 TARGET_COPY_OUT_VENDOR := vendor BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true @@ -52,6 +52,7 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_SEPOLICY_DIRS += \ build/target/board/generic/sepolicy \ diff --git a/target/board/generic_x86/device.mk b/target/board/generic_x86/device.mk index b5b0fafb0b..24c39a5ccb 100644 --- a/target/board/generic_x86/device.mk +++ b/target/board/generic_x86/device.mk @@ -19,8 +19,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.ril.hsxpa=1 \ - ro.ril.gprsclass=10 \ - ro.adb.qemud=1 + ro.ril.gprsclass=10 PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index c7d6a25c36..b49a10ca01 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -55,6 +55,7 @@ BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true +DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_SEPOLICY_DIRS += \ build/target/board/generic/sepolicy \ diff --git a/target/board/generic_x86_64/device.mk b/target/board/generic_x86_64/device.mk index b5b0fafb0b..24c39a5ccb 100755 --- a/target/board/generic_x86_64/device.mk +++ b/target/board/generic_x86_64/device.mk @@ -19,8 +19,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.ril.hsxpa=1 \ - ro.ril.gprsclass=10 \ - ro.adb.qemud=1 + ro.ril.gprsclass=10 PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ diff --git a/target/product/aosp_arm.mk b/target/product/aosp_arm.mk index 781cae6a01..9ed528499f 100644 --- a/target/product/aosp_arm.mk +++ b/target/product/aosp_arm.mk @@ -1,5 +1,5 @@ # -# Copyright 2013 The Android Open-Source Project +# Copyright 2017 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. @@ -13,6 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib/libreference-ril.so + +# Note: the following lines need to stay at the beginning so that it can +# take priority and override the rules it inherit from other mk files +# see copy file rules in core/Makefile +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \ + prebuilts/qemu-kernel/arm/3.18/kernel-qemu2:kernel-ranchu \ + device/generic/goldfish/fstab.ranchu.arm:root/fstab.ranchu \ + device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early + include $(SRC_TARGET_DIR)/product/full.mk PRODUCT_NAME := aosp_arm diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk index 98afe5f924..18d613bd82 100644 --- a/target/product/aosp_arm64.mk +++ b/target/product/aosp_arm64.mk @@ -1,5 +1,5 @@ # -# Copyright (C) 2013 The Android Open-Source Project +# Copyright (C) 2017 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. @@ -14,14 +14,22 @@ # limitations under the License. # +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib64/libreference-ril.so + # This is a build configuration for a full-featured build of the # Open-Source part of the tree. It's geared toward a US-centric # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. -# This is for enabling ethernet support for ranchu. -# Consider removing this after RIL support is provided in ranchu. -PRODUCT_COPY_FILES += frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml +# Note: the following lines need to stay at the beginning so that it can +# take priority and override the rules it inherit from other mk files +# see copy file rules in core/Makefile +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \ + prebuilts/qemu-kernel/arm64/3.18/kernel-qemu2:kernel-ranchu \ + device/generic/goldfish/fstab.ranchu.arm:root/fstab.ranchu \ + device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) diff --git a/target/product/aosp_x86.mk b/target/product/aosp_x86.mk index cba43c429f..03203ced31 100644 --- a/target/product/aosp_x86.mk +++ b/target/product/aosp_x86.mk @@ -13,6 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib/libreference-ril.so + +# This is a build configuration for a full-featured build of the +# Open-Source part of the tree. It's geared toward a US-centric +# build quite specifically for the emulator, and might not be +# entirely appropriate to inherit from for on-device configurations. +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini:advancedFeatures.ini \ + device/generic/goldfish/data/etc/encryptionkey.img:encryptionkey.img \ + prebuilts/qemu-kernel/x86/3.18/kernel-qemu2:kernel-ranchu + include $(SRC_TARGET_DIR)/product/full_x86.mk PRODUCT_NAME := aosp_x86 diff --git a/target/product/aosp_x86_64.mk b/target/product/aosp_x86_64.mk index 4006346a82..693bdaf0b0 100644 --- a/target/product/aosp_x86_64.mk +++ b/target/product/aosp_x86_64.mk @@ -14,18 +14,18 @@ # limitations under the License. # +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib64/libreference-ril.so + # This is a build configuration for a full-featured build of the # Open-Source part of the tree. It's geared toward a US-centric # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. -# If running on an emulator or some other device that has a LAN connection -# that isn't a wifi connection. This will instruct init.rc to enable the -# network connection so that you can use it with ADB - -# This is for enabling ethernet support for ranchu. -# Consider removing this after RIL support is provided in ranchu. -PRODUCT_COPY_FILES += frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini:advancedFeatures.ini \ + device/generic/goldfish/data/etc/encryptionkey.img:encryptionkey.img \ + prebuilts/qemu-kernel/x86_64/3.18/kernel-qemu2:kernel-ranchu $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) diff --git a/target/product/sdk_base.mk b/target/product/sdk_base.mk index 0b14203b08..6d4d59f0b8 100644 --- a/target/product/sdk_base.mk +++ b/target/product/sdk_base.mk @@ -24,11 +24,10 @@ PRODUCT_PACKAGES := \ Development \ Dialer \ EmulatorSmokeTests \ - Fallback \ Gallery2 \ GestureBuilder \ Launcher3 \ - LegacyCamera \ + Camera2 \ librs_jni \ libwnndict \ libWnnEngDic \ @@ -102,6 +101,7 @@ PRODUCT_COPY_FILES := \ frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ frameworks/native/data/etc/android.hardware.camera.xml:system/etc/permissions/android.hardware.camera.xml \ frameworks/native/data/etc/android.hardware.fingerprint.xml:system/etc/permissions/android.hardware.fingerprint.xml \ + frameworks/native/data/etc/android.software.autofill.xml:system/etc/permissions/android.software.autofill.xml \ frameworks/av/media/libeffects/data/audio_effects.conf:system/etc/audio_effects.conf \ device/generic/goldfish/audio_policy.conf:system/etc/audio_policy.conf diff --git a/target/product/sdk_phone_arm64.mk b/target/product/sdk_phone_arm64.mk index 599673ae50..2aa688b133 100644 --- a/target/product/sdk_phone_arm64.mk +++ b/target/product/sdk_phone_arm64.mk @@ -46,3 +46,5 @@ PRODUCT_BRAND := Android PRODUCT_NAME := sdk_phone_arm64 PRODUCT_DEVICE := generic_arm64 PRODUCT_MODEL := Android SDK built for arm64 + + From 2999f29ea08e7fc70abaa5f32f688bebb648137c Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Mon, 14 Aug 2017 17:47:28 +0800 Subject: [PATCH 054/123] Move common 32/64 bits product settings to another files Move the common 32/64 bits product settings from aosp_xxx.mk to target/product/treble_common_(32|64).mk The original core_64_bit.mk is not match the GSI requirement, and will be revised soon. So, clone the content of core_64_bit.mk into treble_common_64.mk. Bug: 64653300 Test: Build pass Change-Id: I6154a5c4927287c703a874b5cbf6a7f0c2c3594c --- target/product/aosp_arm64_a.mk | 7 +++--- target/product/aosp_arm64_ab.mk | 7 +++--- target/product/aosp_arm_a.mk | 6 ++--- target/product/aosp_arm_ab.mk | 6 ++--- target/product/aosp_x86_64_a.mk | 7 +++--- target/product/aosp_x86_64_ab.mk | 7 +++--- target/product/aosp_x86_a.mk | 6 ++--- target/product/aosp_x86_ab.mk | 6 ++--- target/product/treble_common.mk | 5 +++++ target/product/treble_common_32.mk | 22 +++++++++++++++++++ target/product/treble_common_64.mk | 35 ++++++++++++++++++++++++++++++ 11 files changed, 86 insertions(+), 28 deletions(-) create mode 100644 target/product/treble_common_32.mk create mode 100644 target/product/treble_common_64.mk diff --git a/target/product/aosp_arm64_a.mk b/target/product/aosp_arm64_a.mk index 4258f04f7b..84d4b4f6ef 100644 --- a/target/product/aosp_arm64_a.mk +++ b/target/product/aosp_arm64_a.mk @@ -16,12 +16,11 @@ # PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at # /vendor/[build|default].prop when build split is on. In order to have sysprops -# on the generic system image, place them in build/make/target/board/generic_arm64_a/ -# system.prop. +# on the generic system image, place them in build/make/target/board/ +# treble_system.prop. -include build/make/target/product/treble_common.mk +include build/make/target/product/treble_common_64.mk -$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) PRODUCT_NAME := aosp_arm64_a diff --git a/target/product/aosp_arm64_ab.mk b/target/product/aosp_arm64_ab.mk index ae50c42167..75ded35b67 100644 --- a/target/product/aosp_arm64_ab.mk +++ b/target/product/aosp_arm64_ab.mk @@ -16,10 +16,10 @@ # PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at # /vendor/[build|default].prop when build split is on. In order to have sysprops -# on the generic system image, place them in build/make/target/board/generic_arm64_a/ -# system.prop. +# on the generic system image, place them in build/make/target/board/ +# treble_system.prop. -include build/make/target/product/treble_common.mk +include build/make/target/product/treble_common_64.mk AB_OTA_UPDATER := true AB_OTA_PARTITIONS := system @@ -27,7 +27,6 @@ PRODUCT_PACKAGES += \ update_engine \ update_verifier -$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) PRODUCT_NAME := aosp_arm64_ab diff --git a/target/product/aosp_arm_a.mk b/target/product/aosp_arm_a.mk index 6be8e82a4c..845d091f6a 100644 --- a/target/product/aosp_arm_a.mk +++ b/target/product/aosp_arm_a.mk @@ -16,10 +16,10 @@ # PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at # /vendor/[build|default].prop when build split is on. In order to have sysprops -# on the generic system image, place them in build/make/target/board/generic_arm_a/ -# system.prop. +# on the generic system image, place them in build/make/target/board/ +# treble_system.prop. -include build/make/target/product/treble_common.mk +include build/make/target/product/treble_common_32.mk $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) diff --git a/target/product/aosp_arm_ab.mk b/target/product/aosp_arm_ab.mk index 423d38fbae..3a862eb777 100644 --- a/target/product/aosp_arm_ab.mk +++ b/target/product/aosp_arm_ab.mk @@ -16,10 +16,10 @@ # PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at # /vendor/[build|default].prop when build split is on. In order to have sysprops -# on the generic system image, place them in build/make/target/board/generic_arm_a/ -# system.prop. +# on the generic system image, place them in build/make/target/board/ +# treble_system.prop. -include build/make/target/product/treble_common.mk +include build/make/target/product/treble_common_32.mk AB_OTA_UPDATER := true AB_OTA_PARTITIONS := system diff --git a/target/product/aosp_x86_64_a.mk b/target/product/aosp_x86_64_a.mk index eab8b4abe6..53f8252f9f 100644 --- a/target/product/aosp_x86_64_a.mk +++ b/target/product/aosp_x86_64_a.mk @@ -16,12 +16,11 @@ # PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at # /vendor/[build|default].prop when build split is on. In order to have sysprops -# on the generic system image, place them in build/make/target/board/generic_arm64_a/ -# system.prop. +# on the generic system image, place them in build/make/target/board/ +# treble_system.prop. -include build/make/target/product/treble_common.mk +include build/make/target/product/treble_common_64.mk -$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) PRODUCT_NAME := aosp_x86_64_a diff --git a/target/product/aosp_x86_64_ab.mk b/target/product/aosp_x86_64_ab.mk index 4fb2acfcd0..6080695eb7 100644 --- a/target/product/aosp_x86_64_ab.mk +++ b/target/product/aosp_x86_64_ab.mk @@ -16,10 +16,10 @@ # PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at # /vendor/[build|default].prop when build split is on. In order to have sysprops -# on the generic system image, place them in build/make/target/board/generic_arm64_a/ -# system.prop. +# on the generic system image, place them in build/make/target/board/ +# treble_system.prop. -include build/make/target/product/treble_common.mk +include build/make/target/product/treble_common_64.mk AB_OTA_UPDATER := true AB_OTA_PARTITIONS := system @@ -27,7 +27,6 @@ PRODUCT_PACKAGES += \ update_engine \ update_verifier -$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) PRODUCT_NAME := aosp_x86_64_ab diff --git a/target/product/aosp_x86_a.mk b/target/product/aosp_x86_a.mk index df8410730c..72d6e1ab00 100644 --- a/target/product/aosp_x86_a.mk +++ b/target/product/aosp_x86_a.mk @@ -16,10 +16,10 @@ # PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at # /vendor/[build|default].prop when build split is on. In order to have sysprops -# on the generic system image, place them in build/make/target/board/generic_arm64_a/ -# system.prop. +# on the generic system image, place them in build/make/target/board/ +# treble_system.prop. -include build/make/target/product/treble_common.mk +include build/make/target/product/treble_common_32.mk $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) diff --git a/target/product/aosp_x86_ab.mk b/target/product/aosp_x86_ab.mk index 4bd63ab4e6..f3aef958b6 100644 --- a/target/product/aosp_x86_ab.mk +++ b/target/product/aosp_x86_ab.mk @@ -16,10 +16,10 @@ # PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at # /vendor/[build|default].prop when build split is on. In order to have sysprops -# on the generic system image, place them in build/make/target/board/generic_arm64_a/ -# system.prop. +# on the generic system image, place them in build/make/target/board/ +# treble_system.prop. -include build/make/target/product/treble_common.mk +include build/make/target/product/treble_common_32.mk AB_OTA_UPDATER := true AB_OTA_PARTITIONS := system diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk index a16829b4a7..07c7ae1363 100644 --- a/target/product/treble_common.mk +++ b/target/product/treble_common.mk @@ -14,6 +14,11 @@ # limitations under the License. # +# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at +# /vendor/[build|default].prop when build split is on. In order to have sysprops +# on the generic system image, place them in build/make/target/board/ +# treble_system.prop. + # Split selinux policy PRODUCT_FULL_TREBLE_OVERRIDE := true diff --git a/target/product/treble_common_32.mk b/target/product/treble_common_32.mk new file mode 100644 index 0000000000..0023c3b6e8 --- /dev/null +++ b/target/product/treble_common_32.mk @@ -0,0 +1,22 @@ +# +# Copyright (C) 2017 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. +# + +# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at +# /vendor/[build|default].prop when build split is on. In order to have sysprops +# on the generic system image, place them in build/make/target/board/ +# treble_system.prop. + +include build/make/target/product/treble_common.mk diff --git a/target/product/treble_common_64.mk b/target/product/treble_common_64.mk new file mode 100644 index 0000000000..eff0d463cb --- /dev/null +++ b/target/product/treble_common_64.mk @@ -0,0 +1,35 @@ +# +# Copyright (C) 2017 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. +# + +# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at +# /vendor/[build|default].prop when build split is on. In order to have sysprops +# on the generic system image, place them in build/make/target/board/ +# treble_system.prop. + +include build/make/target/product/treble_common.mk + +# For now this will allow 64-bit apps, but still compile all apps with JNI +# for 32-bit only. + +# Copy the 64-bit primary, 32-bit secondary zygote startup script +PRODUCT_COPY_FILES += system/core/rootdir/init.zygote64_32.rc:root/init.zygote64_32.rc + +# Set the zygote property to select the 64-bit primary, 32-bit secondary script +# This line must be parsed before the one in core_minimal.mk +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.zygote=zygote64_32 + +TARGET_SUPPORTS_32_BIT_APPS := true +TARGET_SUPPORTS_64_BIT_APPS := true From 6a4bd696f6df71187be9c9a406ad5cbe101596f1 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Mon, 14 Aug 2017 10:53:50 +0100 Subject: [PATCH 055/123] apkcerts: Add information about the compressed state of the APK. We add a compressed="$extension" attribute to an APK's entry if it's compressed. Bug: 64531948 Test: make dist Change-Id: Ic3f95ed77f0bb16dec825bae944c70ee2d130657 --- core/Makefile | 14 ++++++-------- core/package_internal.mk | 1 + core/prebuilt_internal.mk | 1 + 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/Makefile b/core/Makefile index d180ef5f80..7c54fdb863 100644 --- a/core/Makefile +++ b/core/Makefile @@ -419,8 +419,10 @@ package-stats: $(PACKAGE_STATS_FILE) # ----------------------------------------------------------------- # Cert-to-package mapping. Used by the post-build signing tools. # Use a macro to add newline to each echo command -define _apkcerts_echo_with_newline -$(hide) echo $(1) +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 endef @@ -440,12 +442,8 @@ $(APKCERTS_FILE): @rm -f $@ $(foreach p,$(PACKAGES),\ $(if $(PACKAGES.$(p).EXTERNAL_KEY),\ - $(call _apkcerts_echo_with_newline,\ - 'name="$(p).apk" certificate="EXTERNAL" \ - private_key=""' >> $@),\ - $(call _apkcerts_echo_with_newline,\ - 'name="$(p).apk" certificate="$(PACKAGES.$(p).CERTIFICATE)" \ - private_key="$(PACKAGES.$(p).PRIVATE_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),$@))) # In case value of PACKAGES is empty. $(hide) touch $@ diff --git a/core/package_internal.mk b/core/package_internal.mk index 28c3a0882d..2eb806c38e 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -222,6 +222,7 @@ endif endif ifdef LOCAL_COMPRESSED_MODULE +PACKAGES.$(LOCAL_PACKAGE_NAME).COMPRESSED := gz LOCAL_BUILT_MODULE_STEM := package.apk.gz LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk.gz else # !LOCAL_COMPRESSED_MODULE diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index edda97e551..48593a5b47 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -120,6 +120,7 @@ endif # LOCAL_COMPRESSED_MODULE ifndef LOCAL_INSTALLED_MODULE_STEM ifdef LOCAL_COMPRESSED_MODULE +PACKAGES.$(LOCAL_MODULE).COMPRESSED := gz LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk.gz else LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk From a5085788115663fea0cda588b3b8dba8a9513c95 Mon Sep 17 00:00:00 2001 From: bohu Date: Mon, 14 Aug 2017 14:52:20 -0700 Subject: [PATCH 056/123] sdk: add vendor-qem.img into the deps list if it exists. Fix master-without-vendor sdk_x86-sdk build Change-Id: I5656e7124d30e71120044cce668c54793f77208a --- core/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/core/Makefile b/core/Makefile index d180ef5f80..04dcfe82b1 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2864,6 +2864,7 @@ deps := \ $(COVERAGE_ZIP) \ $(INSTALLED_SYSTEMIMAGE) \ $(INSTALLED_QEMU_SYSTEMIMAGE) \ + $(INSTALLED_QEMU_VENDORIMAGE) \ $(INSTALLED_USERDATAIMAGE_TARGET) \ $(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_SDK_BUILD_PROP_TARGET) \ From 3147e7cfab919c90d322d5cdcd6bd2730d104b38 Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Fri, 28 Jul 2017 20:22:05 +0800 Subject: [PATCH 057/123] Copy adbd from system/bin to recovery/root/sbin This change will be submitted with other changes moving adbd from root/sbin to system/bin. We need to copy it specifically to recovery root. Previously it was copied by rsync $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT). Bug: 63910933 Test: normal boot sailfish, checks adb works Test: recovery boot sailfish, checks adb works Test: normal boot bullhead, checks adb works Test: recovery boot bullhead, checks adb works Change-Id: Ib49605f97a190aec2648cb000d1159b6e15db673 --- CleanSpec.mk | 4 ++++ core/Makefile | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CleanSpec.mk b/CleanSpec.mk index 91f1a0b687..fff622f4bc 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -424,6 +424,10 @@ $(call add-clean-step, rm -rf $(OUT_DIR)/versions_checked.mk) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/vendor/nativetest*) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/nativetest*) +# Move adbd from $(PRODUCT_OUT)/root/sbin to $(PRODUCT_OUT)/system/bin +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/sbin/adbd) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/symbols/sbin/adbd) + # ************************************************ # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST # ************************************************ diff --git a/core/Makefile b/core/Makefile index d180ef5f80..1984086ee1 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1192,6 +1192,8 @@ define build-recoveryimage-target @echo Copying baseline ramdisk... # Use rsync because "cp -Rf" fails to overwrite broken symlinks on Mac. $(hide) rsync -a --exclude=etc --exclude=sdcard $(IGNORE_RECOVERY_SEPOLICY) $(IGNORE_CACHE_LINK) $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT) + # Copy adbd from system/bin to recovery/root/sbin + $(hide) cp -f $(TARGET_OUT_EXECUTABLES)/adbd $(TARGET_RECOVERY_ROOT_OUT)/sbin/adbd @echo Modifying ramdisk contents... $(if $(BOARD_RECOVERY_KERNEL_MODULES), \ $(call build-image-kernel-modules,$(BOARD_RECOVERY_KERNEL_MODULES),$(TARGET_RECOVERY_ROOT_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_recovery))) @@ -1246,6 +1248,8 @@ define build-recoveryimage-target @echo ----- Made recovery image: $(1) -------- endef +ADBD := $(TARGET_OUT_EXECUTABLES)/adbd + ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_BOOT_SIGNER)) $(INSTALLED_BOOTIMAGE_TARGET) : $(BOOT_SIGNER) @@ -1256,7 +1260,7 @@ endif ifeq (true,$(BOARD_AVB_ENABLE)) $(INSTALLED_BOOTIMAGE_TARGET) : $(AVBTOOL) $(BOARD_AVB_BOOT_KEY_PATH) endif -$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ +$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) $(ADBD) \ $(INSTALLED_RAMDISK_TARGET) \ $(INTERNAL_RECOVERYIMAGE_FILES) \ $(recovery_initrc) $(recovery_sepolicy) $(recovery_kernel) \ @@ -1271,7 +1275,7 @@ $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ $(call build-recoveryimage-target, $@) endif -$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ +$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) $(ADBD) \ $(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_BOOTIMAGE_TARGET) \ $(INTERNAL_RECOVERYIMAGE_FILES) \ From 963485ecf727a8d4ef07dc11087fa92a5dc1ffc8 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 10 Aug 2017 20:30:48 +0100 Subject: [PATCH 058/123] Add com.android.location.provider to the system server classpath. bug: 64571709 Test: com.android.location.provider is speed compiled in /system (cherry picked from commit ec5e04096b5aadbb209d12b2f4c510bb7297c66b) Change-Id: I179872125af89101bee7493f24687518cb39a0db --- target/product/core_minimal.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/product/core_minimal.mk b/target/product/core_minimal.mk index 7b5a16041c..2883e5bfe9 100644 --- a/target/product/core_minimal.mk +++ b/target/product/core_minimal.mk @@ -124,7 +124,8 @@ PRODUCT_BOOT_JARS := \ PRODUCT_SYSTEM_SERVER_JARS := \ services \ ethernet-service \ - wifi-service + wifi-service \ + com.android.location.provider \ # The set of packages whose code can be loaded by the system server. PRODUCT_SYSTEM_SERVER_APPS += \ From 3cbe82df5f005a2739b74477cf74bb4c6efd5460 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Fri, 11 Aug 2017 17:30:17 +0800 Subject: [PATCH 059/123] Apply vndk_package to generic system image Add vndk_package into PRODUCT_PACKAGES, which includes HAL interfaces, VNDK, VNDK-SP and LL-NDK. vndk_package increases the total size of GSI content, so changes the system partition size of: * 64 bits projects to 1.5GB * 32 bits projects to 1.0GB Bug: 64654641 Test: build all GSI projects Change-Id: I3c66c966eceebd63ee19f6a3de778beed0be6de5 --- target/board/generic_arm_a/BoardConfig.mk | 4 - target/board/generic_arm_ab/BoardConfig.mk | 4 - target/board/treble_common.mk | 3 + target/board/treble_common_32.mk | 4 +- target/board/treble_common_64.mk | 4 +- target/product/treble_common.mk | 172 +-------------------- 6 files changed, 9 insertions(+), 182 deletions(-) diff --git a/target/board/generic_arm_a/BoardConfig.mk b/target/board/generic_arm_a/BoardConfig.mk index 5293ae61aa..57a5196a96 100644 --- a/target/board/generic_arm_a/BoardConfig.mk +++ b/target/board/generic_arm_a/BoardConfig.mk @@ -21,7 +21,3 @@ TARGET_ARCH_VARIANT := armv7-a-neon TARGET_CPU_ABI := armeabi-v7a TARGET_CPU_ABI2 := armeabi TARGET_CPU_VARIANT := generic - -# b/64458958 -# Partition size is 734MB for ARM32 (non A/B update) -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 769654784 diff --git a/target/board/generic_arm_ab/BoardConfig.mk b/target/board/generic_arm_ab/BoardConfig.mk index 376aaab665..ae8de14681 100644 --- a/target/board/generic_arm_ab/BoardConfig.mk +++ b/target/board/generic_arm_ab/BoardConfig.mk @@ -25,7 +25,3 @@ TARGET_CPU_VARIANT := generic # Enable A/B update TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true - -# b/64458958 -# Partition size is 734MB for ARM32 (A/B update) -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 769654784 diff --git a/target/board/treble_common.mk b/target/board/treble_common.mk index de31f5a133..f7c8b32cc2 100644 --- a/target/board/treble_common.mk +++ b/target/board/treble_common.mk @@ -17,6 +17,9 @@ # Common boardconfig settings for generic AOSP products targetting mobile # (phone/table) devices. +# VNDK +BOARD_VNDK_VERSION := current + # Properties TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/treble_common_32.mk b/target/board/treble_common_32.mk index 67041a1176..fb19d79cf0 100644 --- a/target/board/treble_common_32.mk +++ b/target/board/treble_common_32.mk @@ -16,5 +16,5 @@ include build/make/target/board/treble_common.mk -# Partition size is default 0.75GB (768MB) for 32 bits projects -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 805306368 +# Partition size is default 1GB (1024MB) for 32 bits projects +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1073741824 diff --git a/target/board/treble_common_64.mk b/target/board/treble_common_64.mk index 957f593b30..0a6eb172d4 100644 --- a/target/board/treble_common_64.mk +++ b/target/board/treble_common_64.mk @@ -19,5 +19,5 @@ include build/make/target/board/treble_common.mk # Enable 64-bits binder TARGET_USES_64_BIT_BINDER := true -# Partition size is default 1.25GB (1280MB) for 64 bits projects -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1342177280 +# Partition size is default 1.5GB (1536MB) for 64 bits projects +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk index 07c7ae1363..2488653be3 100644 --- a/target/product/treble_common.mk +++ b/target/product/treble_common.mk @@ -22,179 +22,11 @@ # Split selinux policy PRODUCT_FULL_TREBLE_OVERRIDE := true -# HAL interfaces: -# Some of HAL interface libraries are automatically added by the dependencies -# from the framework. However, we list them all here to make it explicit and -# prevent possible mistake. -PRODUCT_PACKAGES := \ - android.frameworks.displayservice@1.0 \ - android.frameworks.schedulerservice@1.0 \ - android.frameworks.sensorservice@1.0 \ - android.frameworks.vr.composer@1.0 \ - android.hardware.audio@2.0 \ - android.hardware.audio.common@2.0 \ - android.hardware.audio.common@2.0-util \ - android.hardware.audio.effect@2.0 \ - android.hardware.automotive.evs@1.0 \ - android.hardware.automotive.vehicle@2.0 \ - android.hardware.automotive.vehicle@2.0-manager-lib-shared \ - android.hardware.automotive.vehicle@2.1 \ - android.hardware.biometrics.fingerprint@2.1 \ - android.hardware.bluetooth@1.0 \ - android.hardware.boot@1.0 \ - android.hardware.broadcastradio@1.0 \ - android.hardware.broadcastradio@1.1 \ - android.hardware.camera.common@1.0 \ - android.hardware.camera.device@1.0 \ - android.hardware.camera.device@3.2 \ - android.hardware.camera.metadata@3.2 \ - android.hardware.camera.provider@2.4 \ - android.hardware.configstore-utils \ - android.hardware.configstore@1.0 \ - android.hardware.configstore@1.1 \ - android.hardware.contexthub@1.0 \ - android.hardware.drm@1.0 \ - android.hardware.dumpstate@1.0 \ - android.hardware.gatekeeper@1.0 \ - android.hardware.gnss@1.0 \ - android.hardware.graphics.allocator@2.0 \ - android.hardware.graphics.bufferqueue@1.0 \ - android.hardware.graphics.common@1.0 \ - android.hardware.graphics.composer@2.1 \ - android.hardware.graphics.mapper@2.0 \ - android.hardware.health@1.0 \ - android.hardware.ir@1.0 \ - android.hardware.keymaster@3.0 \ - android.hardware.light@2.0 \ - android.hardware.media@1.0 \ - android.hardware.media.omx@1.0-utils \ - android.hardware.media.omx@1.0 \ - android.hardware.memtrack@1.0 \ - android.hardware.nfc@1.0 \ - android.hardware.oemlock@1.0 \ - android.hardware.power@1.0 \ - android.hardware.radio@1.0 \ - android.hardware.radio.deprecated@1.0 \ - android.hardware.sensors@1.0 \ - android.hardware.soundtrigger@2.0 \ - android.hardware.tetheroffload.config@1.0 \ - android.hardware.tetheroffload.control@1.0 \ - android.hardware.thermal@1.0 \ - android.hardware.thermal@1.1 \ - android.hardware.tv.cec@1.0 \ - android.hardware.tv.input@1.0 \ - android.hardware.usb@1.0 \ - android.hardware.usb@1.1 \ - android.hardware.vibrator@1.0 \ - android.hardware.vr@1.0 \ - android.hardware.weaver@1.0 \ - android.hardware.wifi@1.0 \ - android.hardware.wifi@1.1 \ - android.hardware.wifi.supplicant@1.0 \ - android.hidl.allocator@1.0 \ - android.hidl.manager@1.0 \ - android.hidl.memory@1.0 \ - android.hidl.token@1.0 \ - android.system.net.netd@1.0 \ - android.system.wifi.keystore@1.0 \ - -# VNDK: -# Some VNDK shared objects are automatically included indirectly. -# We list them all here to make it explicit and prevent possible mistakes. -# An example of one such mistake was libcurl, which is included in A/B -# devices because of update_engine, but not in non-A/B devices. -PRODUCT_PACKAGES += \ - libaudioroute \ - libaudioutils \ - libbinder \ - libcamera_metadata \ - libcap \ - libcrypto \ - libcrypto_utils \ - libcups \ - libcurl \ - libdiskconfig \ - libdumpstateutil \ - libevent \ - libexif \ - libexpat \ - libfmq \ - libgatekeeper \ - libgui \ - libhardware_legacy \ - libhidlmemory \ - libicui18n \ - libicuuc \ - libjpeg \ - libkeymaster1 \ - libkeymaster_messages \ - libldacBT_abr \ - libldacBT_enc \ - liblz4 \ - liblzma \ - libmdnssd \ - libmemtrack \ - libmemunreachable \ - libmetricslogger \ - libminijail \ - libnetutils \ - libnl \ - libopus \ - libpagemap \ - libpcap \ - libpcre2 \ - libpcrecpp \ - libpdfium \ - libpiex \ - libpower \ - libprocessgroup \ - libprocinfo \ - libprotobuf-cpp-full \ - libprotobuf-cpp-lite \ - libradio_metadata \ - libsoftkeymasterdevice \ - libsonic \ - libsonivox \ - libspeexresampler \ - libsqlite \ - libssl \ - libsuspend \ - libsysutils \ - libtinyalsa \ - libtinyxml2 \ - libui \ - libusbhost \ - libvixl-arm \ - libvixl-arm64 \ - libvorbisidec \ - libwebrtc_audio_preprocessing \ - libxml2 \ - libyuv \ - libziparchive \ - -# VNDK-SP: -PRODUCT_PACKAGES += \ - vndk-sp \ - -# LL-NDK: -PRODUCT_PACKAGES += \ - libandroid_net \ - libc \ - libdl \ - liblog \ - libm \ - libstdc++ \ - libvndksupport \ - libz \ +# All VNDK libraries (HAL interfaces, VNDK, VNDK-SP, LL-NDK) +PRODUCT_PACKAGES += vndk_package # SP-NDK: PRODUCT_PACKAGES += \ - libEGL \ - libGLESv1_CM \ - libGLESv2 \ - libGLESv3 \ - libnativewindow \ - libsync \ libvulkan \ # Audio: From cccd0b2a3048a0611c491fc6d725a83a5cb36c4b Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Thu, 17 Aug 2017 16:45:50 +0800 Subject: [PATCH 060/123] 64-bit GSI: adds init.zygote32_64.rc into root dir for vendor to select For 64-bit GSI, there are two different zygote settings: 1. 64-bit primary, 32-bit secondary (init.zygote64_32.rc) OR 2. 32-bit primary, 64-bit secondary (init.zygote32_64.rc) 3. 64-bit only is currently forbidden (b/64280459#comment6) This change adds the second setting into root dir for vendor.img to select. The first setting already exists. PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.zygote=zygote64_32 is removed because the property will be put into vendor.img. i.e., it has no effect on GSI. Bug: 64280459 Test: build and boot device, checks init.zygote32_64.rc is in rootdir Change-Id: I16b36018acac8cfeee7281d6f4b6c9c19467abec --- target/product/treble_common_64.mk | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/target/product/treble_common_64.mk b/target/product/treble_common_64.mk index eff0d463cb..fc3c16f8c2 100644 --- a/target/product/treble_common_64.mk +++ b/target/product/treble_common_64.mk @@ -24,12 +24,14 @@ include build/make/target/product/treble_common.mk # For now this will allow 64-bit apps, but still compile all apps with JNI # for 32-bit only. -# Copy the 64-bit primary, 32-bit secondary zygote startup script -PRODUCT_COPY_FILES += system/core/rootdir/init.zygote64_32.rc:root/init.zygote64_32.rc - -# Set the zygote property to select the 64-bit primary, 32-bit secondary script -# This line must be parsed before the one in core_minimal.mk -PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.zygote=zygote64_32 +# Copy different zygote settings for vendor.img to select by setting property +# ro.zygote=zygote64_32 or ro.zygote=zygote32_64: +# 1. 64-bit primary, 32-bit secondary OR +# 2. 32-bit primary, 64-bit secondary +# 3. 64-bit only is currently forbidden (b/64280459#comment6) +PRODUCT_COPY_FILES += \ + system/core/rootdir/init.zygote64_32.rc:root/init.zygote64_32.rc \ + system/core/rootdir/init.zygote32_64.rc:root/init.zygote32_64.rc TARGET_SUPPORTS_32_BIT_APPS := true TARGET_SUPPORTS_64_BIT_APPS := true From 82962a982c435b7c5d745f57865fab418cf87bb6 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Fri, 18 Aug 2017 12:22:57 +0900 Subject: [PATCH 061/123] cxx_stl_setup is not executed for modules from soong cxx_stl_setup is adding libunwind_llvm to the dependency even for modules from soong. However, since this dependency was already handled in soong, those modules don't need to go through it again. Bug: 64815735 Test: BOARD_VNDK_VERSION=current mma -j (under /hardware/libhardware) Merged-Id: Id6e2547c752ec831aa56a14c0bf4db0a55d51243 Change-Id: Id6e2547c752ec831aa56a14c0bf4db0a55d51243 (cherry picked from commit 425d489cb9be586c71bac60ce0ce7d81cb573f6d) --- core/binary.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/binary.mk b/core/binary.mk index 000b005ff2..7dd9a135bc 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -53,6 +53,7 @@ my_asflags := $(LOCAL_ASFLAGS) my_cc := $(LOCAL_CC) my_cc_wrapper := $(CC_WRAPPER) my_cxx := $(LOCAL_CXX) +my_cxx_ldlibs := my_cxx_wrapper := $(CXX_WRAPPER) my_c_includes := $(LOCAL_C_INCLUDES) my_generated_sources := $(LOCAL_GENERATED_SOURCES) @@ -447,7 +448,10 @@ my_static_libraries := $(LOCAL_STATIC_LIBRARIES_$($(my_prefix)$(LOCAL_2ND_ARCH_V my_whole_static_libraries := $(LOCAL_WHOLE_STATIC_LIBRARIES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_WHOLE_STATIC_LIBRARIES_$(my_32_64_bit_suffix)) $(my_whole_static_libraries) my_header_libraries := $(LOCAL_HEADER_LIBRARIES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_HEADER_LIBRARIES_$(my_32_64_bit_suffix)) $(my_header_libraries) +# soong defined modules already have done through this +ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) include $(BUILD_SYSTEM)/cxx_stl_setup.mk +endif # Add static HAL libraries ifdef LOCAL_HAL_STATIC_LIBRARIES From 882c99a33b48de355c168a1360912d13e7516dc1 Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Fri, 18 Aug 2017 16:08:36 +0800 Subject: [PATCH 062/123] GSI: adds /odm mount point in root dir Bug: 64700195 Test: boot A/B device with /odm Change-Id: Ie014a052a333b2cb8d89bc43e4326be81e638dcd --- target/board/generic_arm64_ab/BoardConfig.mk | 2 +- target/board/treble_common.mk | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/target/board/generic_arm64_ab/BoardConfig.mk b/target/board/generic_arm64_ab/BoardConfig.mk index 56cc2da7d8..1cab844744 100644 --- a/target/board/generic_arm64_ab/BoardConfig.mk +++ b/target/board/generic_arm64_ab/BoardConfig.mk @@ -34,7 +34,7 @@ TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true # TODO(jiyong) These might be SoC specific. -BOARD_ROOT_EXTRA_FOLDERS := bt_firmware firmware firmware/radio persist +BOARD_ROOT_EXTRA_FOLDERS += bt_firmware firmware firmware/radio persist BOARD_ROOT_EXTRA_SYMLINKS := /vendor/lib/dsp:/dsp # TODO(b/36764215): remove this setting when the generic system image diff --git a/target/board/treble_common.mk b/target/board/treble_common.mk index f7c8b32cc2..8637235a03 100644 --- a/target/board/treble_common.mk +++ b/target/board/treble_common.mk @@ -56,3 +56,8 @@ NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 # TODO(b/35790399): remove when b/35790399 is fixed. BOARD_NAND_SPARE_SIZE := 0 BOARD_FLASH_BLOCK_SIZE := 512 + +# b/64700195: add minimum support for odm.img +# Currently odm.img can only be built by `make custom_images`. +# Adding /odm mount point under root directory. +BOARD_ROOT_EXTRA_FOLDERS += odm From a07bf049b9ac92b9c4f82092ac0b10f78c762998 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Mon, 14 Aug 2017 14:49:21 +0100 Subject: [PATCH 063/123] releasetools: Add support for compressed APKs. Compressed APKs can be identified by a "compressed=" entry in the apkcerts.txt file. When we encounter such an entry, we need to decompress the file to a temporary location before we process its certs. When we're signing, we should also recompress the package after it's signed. Bug: 64531948 Test: ./build/tools/releasetools/check_target_files_signatures.py Test: ./build/tools/releasetools/sign_target_files_apks.py Test: compared signed output before / after this change, verify that it's bitwise identical when no compressed APKs are present. Change-Id: Id32e52f9c11023955330c113117daaf6b73bd8c2 --- .../check_target_files_signatures.py | 31 +++++++- tools/releasetools/common.py | 39 ++++++++-- tools/releasetools/sign_target_files_apks.py | 72 +++++++++++++++---- 3 files changed, 121 insertions(+), 21 deletions(-) diff --git a/tools/releasetools/check_target_files_signatures.py b/tools/releasetools/check_target_files_signatures.py index f9aa4fa8bc..c4877e0928 100755 --- a/tools/releasetools/check_target_files_signatures.py +++ b/tools/releasetools/check_target_files_signatures.py @@ -235,12 +235,40 @@ class TargetFiles(object): self.certmap = None def LoadZipFile(self, filename): - d, z = common.UnzipTemp(filename, ['*.apk']) + # First read the APK certs file to figure out whether there are compressed + # APKs in the archive. If we do have compressed APKs in the archive, then we + # must decompress them individually before we perform any analysis. + + # This is the list of wildcards of files we extract from |filename|. + apk_extensions = ['*.apk'] + + self.certmap, compressed_extension = common.ReadApkCerts(zipfile.ZipFile(filename, "r")) + if compressed_extension: + apk_extensions.append("*.apk" + compressed_extension) + + d, z = common.UnzipTemp(filename, apk_extensions) try: self.apks = {} self.apks_by_basename = {} for dirpath, _, filenames in os.walk(d): for fn in filenames: + # Decompress compressed APKs before we begin processing them. + if compressed_extension and fn.endswith(compressed_extension): + # First strip the compressed extension from the file. + uncompressed_fn = fn[:-len(compressed_extension)] + + # Decompress the compressed file to the output file. + common.Gunzip(os.path.join(dirpath, fn), + os.path.join(dirpath, uncompressed_fn)) + + # Finally, delete the compressed file and use the uncompressed file + # for further processing. Note that the deletion is not strictly required, + # but is done here to ensure that we're not using too much space in + # the temporary directory. + os.remove(os.path.join(dirpath, fn)) + fn = uncompressed_fn + + if fn.endswith(".apk"): fullname = os.path.join(dirpath, fn) displayname = fullname[len(d)+1:] @@ -253,7 +281,6 @@ class TargetFiles(object): finally: shutil.rmtree(d) - self.certmap = common.ReadApkCerts(z) z.close() def CheckSharedUids(self): diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index ce57f62073..9d58954d2d 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -18,6 +18,7 @@ import copy import errno import getopt import getpass +import gzip import imp import os import platform @@ -552,6 +553,13 @@ def GetBootableImage(name, prebuilt_name, unpack_dir, tree_subdir, return None +def Gunzip(in_filename, out_filename): + """Gunzip the given gzip compressed file to a given output file. + """ + with gzip.open(in_filename, "rb") as in_file, open(out_filename, "wb") as out_file: + shutil.copyfileobj(in_file, out_file) + + def UnzipTemp(filename, pattern=None): """Unzip the given archive into a temporary directory and return the name. @@ -757,16 +765,26 @@ def CheckSize(data, target, info_dict): def ReadApkCerts(tf_zip): """Given a target_files ZipFile, parse the META/apkcerts.txt file - and return a {package: cert} dict.""" + and return a tuple with the following elements: (1) a dictionary that maps + packages to certs (based on the "certificate" and "private_key" attributes + in the file. (2) A string representing the extension of compressed APKs in + the target files (e.g ".gz" ".bro").""" certmap = {} + compressed_extension = None + for line in tf_zip.read("META/apkcerts.txt").split("\n"): line = line.strip() if not line: continue - m = re.match(r'^name="(.*)"\s+certificate="(.*)"\s+' - r'private_key="(.*)"$', line) + m = re.match(r'^name="(?P.*)"\s+certificate="(?P.*)"\s+' + r'private_key="(?P.*?)"(\s+compressed="(?P.*)")?$', + line) if m: - name, cert, privkey = m.groups() + matches = m.groupdict() + cert = matches["CERT"] + privkey = matches["PRIVKEY"] + name = matches["NAME"] + this_compressed_extension = matches["COMPRESSED"] public_key_suffix_len = len(OPTIONS.public_key_suffix) private_key_suffix_len = len(OPTIONS.private_key_suffix) if cert in SPECIAL_CERT_STRINGS and not privkey: @@ -777,7 +795,18 @@ def ReadApkCerts(tf_zip): certmap[name] = cert[:-public_key_suffix_len] else: raise ValueError("failed to parse line from apkcerts.txt:\n" + line) - return certmap + if this_compressed_extension: + # Make sure that all the values in the compression map have the same + # extension. We don't support multiple compression methods in the same + # system image. + if compressed_extension: + if this_compressed_extension != compressed_extension: + raise ValueError("multiple compressed extensions : %s vs %s", + (compressed_extension, this_compressed_extension)) + else: + compressed_extension = this_compressed_extension + + return (certmap, ("." + compressed_extension) if compressed_extension else None) COMMON_DOCSTRING = """ diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py index 58bf4896a9..83c248711c 100755 --- a/tools/releasetools/sign_target_files_apks.py +++ b/tools/releasetools/sign_target_files_apks.py @@ -100,8 +100,10 @@ import base64 import cStringIO import copy import errno +import gzip import os import re +import shutil import stat import subprocess import tempfile @@ -124,9 +126,7 @@ OPTIONS.avb_keys = {} OPTIONS.avb_algorithms = {} OPTIONS.avb_extra_args = {} -def GetApkCerts(tf_zip): - certmap = common.ReadApkCerts(tf_zip) - +def GetApkCerts(certmap): # apply the key remapping to the contents of the file for apk, cert in certmap.iteritems(): certmap[apk] = OPTIONS.key_map.get(cert, cert) @@ -140,13 +140,19 @@ def GetApkCerts(tf_zip): return certmap -def CheckAllApksSigned(input_tf_zip, apk_key_map): +def CheckAllApksSigned(input_tf_zip, apk_key_map, compressed_extension): """Check that all the APKs we want to sign have keys specified, and error out if they don't.""" unknown_apks = [] + compressed_apk_extension = None + if compressed_extension: + compressed_apk_extension = ".apk" + compressed_extension for info in input_tf_zip.infolist(): - if info.filename.endswith(".apk"): + if (info.filename.endswith(".apk") or + (compressed_apk_extension and info.filename.endswith(compressed_apk_extension))): name = os.path.basename(info.filename) + if compressed_apk_extension and name.endswith(compressed_apk_extension): + name = name[:-len(compressed_extension)] if name not in apk_key_map: unknown_apks.append(name) if unknown_apks: @@ -157,11 +163,25 @@ def CheckAllApksSigned(input_tf_zip, apk_key_map): sys.exit(1) -def SignApk(data, keyname, pw, platform_api_level, codename_to_api_level_map): +def SignApk(data, keyname, pw, platform_api_level, codename_to_api_level_map, + is_compressed): unsigned = tempfile.NamedTemporaryFile() unsigned.write(data) unsigned.flush() + if is_compressed: + uncompressed = tempfile.NamedTemporaryFile() + with gzip.open(unsigned.name, "rb") as in_file, open(uncompressed.name, "wb") as out_file: + shutil.copyfileobj(in_file, out_file) + + # Finally, close the "unsigned" file (which is gzip compressed), and then + # replace it with the uncompressed version. + # + # TODO(narayan): All this nastiness can be avoided if python 3.2 is in use, + # we could just gzip / gunzip in-memory buffers instead. + unsigned.close() + unsigned = uncompressed + signed = tempfile.NamedTemporaryFile() # For pre-N builds, don't upgrade to SHA-256 JAR signatures based on the APK's @@ -186,7 +206,18 @@ def SignApk(data, keyname, pw, platform_api_level, codename_to_api_level_map): min_api_level=min_api_level, codename_to_api_level_map=codename_to_api_level_map) - data = signed.read() + data = None; + if is_compressed: + # Recompress the file after it has been signed. + compressed = tempfile.NamedTemporaryFile() + with open(signed.name, "rb") as in_file, gzip.open(compressed.name, "wb") as out_file: + shutil.copyfileobj(in_file, out_file) + + data = compressed.read() + compressed.close() + else: + data = signed.read() + unsigned.close() signed.close() @@ -195,11 +226,17 @@ def SignApk(data, keyname, pw, platform_api_level, codename_to_api_level_map): def ProcessTargetFiles(input_tf_zip, output_tf_zip, misc_info, apk_key_map, key_passwords, platform_api_level, - codename_to_api_level_map): + codename_to_api_level_map, + compressed_extension): + + compressed_apk_extension = None + if compressed_extension: + compressed_apk_extension = ".apk" + compressed_extension maxsize = max([len(os.path.basename(i.filename)) for i in input_tf_zip.infolist() - if i.filename.endswith('.apk')]) + if i.filename.endswith('.apk') or + (compressed_apk_extension and i.filename.endswith(compressed_apk_extension))]) system_root_image = misc_info.get("system_root_image") == "true" for info in input_tf_zip.infolist(): @@ -210,13 +247,18 @@ def ProcessTargetFiles(input_tf_zip, output_tf_zip, misc_info, out_info = copy.copy(info) # Sign APKs. - if info.filename.endswith(".apk"): + if (info.filename.endswith(".apk") or + (compressed_apk_extension and info.filename.endswith(compressed_apk_extension))): + is_compressed = compressed_extension and info.filename.endswith(compressed_apk_extension) name = os.path.basename(info.filename) + if is_compressed: + name = name[:-len(compressed_extension)] + key = apk_key_map[name] if key not in common.SPECIAL_CERT_STRINGS: print " signing: %-*s (%s)" % (maxsize, name, key) signed_data = SignApk(data, key, key_passwords[key], platform_api_level, - codename_to_api_level_map) + codename_to_api_level_map, is_compressed) common.ZipWriteStr(output_tf_zip, out_info, signed_data) else: # an APK we're not supposed to sign. @@ -748,8 +790,9 @@ def main(argv): BuildKeyMap(misc_info, key_mapping_options) - apk_key_map = GetApkCerts(input_zip) - CheckAllApksSigned(input_zip, apk_key_map) + certmap, compressed_extension = common.ReadApkCerts(input_zip) + apk_key_map = GetApkCerts(certmap) + CheckAllApksSigned(input_zip, apk_key_map, compressed_extension) key_passwords = common.GetKeyPasswords(set(apk_key_map.values())) platform_api_level, _ = GetApiLevelAndCodename(input_zip) @@ -758,7 +801,8 @@ def main(argv): ProcessTargetFiles(input_zip, output_zip, misc_info, apk_key_map, key_passwords, platform_api_level, - codename_to_api_level_map) + codename_to_api_level_map, + compressed_extension) common.ZipClose(input_zip) common.ZipClose(output_zip) From 21a54abbad6d972c967fa463c04d4e1e1341b2de Mon Sep 17 00:00:00 2001 From: Adam Seaton Date: Mon, 21 Aug 2017 11:15:21 -0700 Subject: [PATCH 064/123] [DO NOT MERGE] Update platform security string to 2017-10-01 in mnc-dev Bug:64896113 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 9be7a58bb2..d3320d5085 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -105,7 +105,7 @@ ifeq "" "$(PLATFORM_SECURITY_PATCH)" # 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 := 2017-09-01 + PLATFORM_SECURITY_PATCH := 2017-10-01 endif ifeq "" "$(PLATFORM_BASE_OS)" From 5d8410b60ae2ecab331ba08fabec6621fa5711a9 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Wed, 23 Aug 2017 13:54:04 -0700 Subject: [PATCH 065/123] O MR1 is API 27 Bug: 64982450 Test: manual Change-Id: I0d59724f1bcb8091488f23cd5d98d2688009b605 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index f0e7f84ec5..1e2611a5dc 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -105,7 +105,7 @@ ifndef PLATFORM_SDK_VERSION # When you increment the PLATFORM_SDK_VERSION please ensure you also # clear out the following text file of all older PLATFORM_VERSION's: # cts/tests/tests/os/assets/platform_versions.txt - PLATFORM_SDK_VERSION := 26 + PLATFORM_SDK_VERSION := 27 endif ifndef PLATFORM_JACK_MIN_SDK_VERSION From 2cf1711b9ecd6e7abe163d40c99980187af1c77a Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Thu, 24 Aug 2017 14:14:25 +0800 Subject: [PATCH 066/123] Reduce the system partition size of 32 bits GSI Bug: 64458958 Test: Build pass for aosp_arm_ab and aosp_x86_ab Change-Id: I16e66b1d1a306d7706051a899bae85441d6535ea --- target/board/treble_common_32.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/board/treble_common_32.mk b/target/board/treble_common_32.mk index fb19d79cf0..2c3447b4cf 100644 --- a/target/board/treble_common_32.mk +++ b/target/board/treble_common_32.mk @@ -16,5 +16,5 @@ include build/make/target/board/treble_common.mk -# Partition size is default 1GB (1024MB) for 32 bits projects -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1073741824 +# Partition size is default 906MB for 32 bits projects +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 950009856 From bbcdc07d126342b7cf509034f8f247029fffbc49 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Tue, 22 Aug 2017 15:47:08 +0100 Subject: [PATCH 067/123] dex_preopt: Use the unstripped jar file for generating profiles. We were previously using LOCAL_BUILT_MODULE, which wouldn't work in the case that "nostripping" wasn't specified (i.e when we stripped). The issue is that the built module has its classes.dex entry stripped, which means that profman can't do anything meaningful with it. In this change, we use the right set of files for JAVA_LIBRARIES as well as prebuilt PACKAGES. Fixing apps built from source is a larger task and has been left for a future change. Depending on ART changes, we might need to disable stripping for all apps and/or align userdebug and user builds with each other. This will be tackled separately. Test: make Bug: 64896089 Change-Id: I4fd256d187b66763f354cc6001953469c2cd8fbb --- core/dex_preopt_odex_install.mk | 8 ++++++-- core/java.mk | 13 +++++++++++++ core/java_library.mk | 1 + core/package_internal.mk | 2 ++ core/prebuilt_internal.mk | 2 ++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index 136def470a..032c5d350b 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -142,16 +142,19 @@ ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE)) ifndef LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING $(call pretty-error,Must have specified class listing (LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING)) endif +ifeq (,$(dex_preopt_profile_src_file)) +$(call pretty-error, Internal error: dex_preopt_profile_src_file must be set) +endif my_built_profile := $(dir $(LOCAL_BUILT_MODULE))/profile.prof my_dex_location := $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE)) $(built_odex): $(my_built_profile) $(built_odex): PRIVATE_PROFILE_PREOPT_FLAGS := --profile-file=$(my_built_profile) -$(my_built_profile): PRIVATE_BUILT_MODULE := $(LOCAL_BUILT_MODULE) +$(my_built_profile): PRIVATE_BUILT_MODULE := $(dex_preopt_profile_src_file) $(my_built_profile): PRIVATE_DEX_LOCATION := $(my_dex_location) $(my_built_profile): PRIVATE_SOURCE_CLASSES := $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING) $(my_built_profile): $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING) $(my_built_profile): $(PROFMAN) -$(my_built_profile): $(LOCAL_BUILT_MODULE) +$(my_built_profile): $(dex_preopt_profile_src_file) $(my_built_profile): $(hide) mkdir -p $(dir $@) ANDROID_LOG_TAGS="*:e" $(PROFMAN) \ @@ -159,6 +162,7 @@ $(my_built_profile): --apk=$(PRIVATE_BUILT_MODULE) \ --dex-location=$(PRIVATE_DEX_LOCATION) \ --reference-profile-file=$@ +dex_preopt_profile_src_file:= my_installed_profile := $(LOCAL_INSTALLED_MODULE).prof $(eval $(call copy-one-file,$(my_built_profile),$(my_installed_profile))) build_installed_profile:=$(my_built_profile):$(my_installed_profile) diff --git a/core/java.mk b/core/java.mk index 8fde7c2c30..3601292fa5 100644 --- a/core/java.mk +++ b/core/java.mk @@ -381,6 +381,19 @@ include $(BUILD_SYSTEM)/java_common.mk $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_HAS_RS_SOURCES := $(if $(renderscript_sources),true) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RS_SOURCE_INTERMEDIATES_DIR := $(intermediates.COMMON)/renderscript +# Set the profile source so that the odex / profile code included from java.mk +# can find it. +# +# TODO: b/64896089, this is broken when called from package_internal.mk, since the file +# we preopt from is a temporary file. This will be addressed in a follow up, possibly +# by disabling stripping for profile guided preopt (which may be desirable for other +# reasons anyway). +# +# Note that we set this only when called from package_internal.mk and not in other cases. +ifneq (,$(called_from_package_internal) +dex_preopt_profile_src_file := $(LOCAL_BUILT_MODULE) +endif + ####################################### # defines built_odex along with rule to install odex include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk diff --git a/core/java_library.mk b/core/java_library.mk index 0aad84c57f..84f4419a69 100644 --- a/core/java_library.mk +++ b/core/java_library.mk @@ -44,6 +44,7 @@ endif # java libraries produce javalib.jar, so we will copy classes.jar there too. intermediates.COMMON := $(call local-intermediates-dir,COMMON) common_javalib.jar := $(intermediates.COMMON)/javalib.jar +dex_preopt_profile_src_file := $(common_javalib.jar) LOCAL_INTERMEDIATE_TARGETS += $(common_javalib.jar) ifeq ($(LOCAL_PROGUARD_ENABLED),disabled) diff --git a/core/package_internal.mk b/core/package_internal.mk index 2eb806c38e..87a15d23fe 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -327,9 +327,11 @@ endif include $(BUILD_SYSTEM)/android_manifest.mk +called_from_package_internal := true ################################# include $(BUILD_SYSTEM)/java.mk ################################# +called_from_package_internal := LOCAL_SDK_RES_VERSION:=$(strip $(LOCAL_SDK_RES_VERSION)) ifeq ($(LOCAL_SDK_RES_VERSION),) diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index 48593a5b47..a9c0bc2bfe 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -283,6 +283,8 @@ my_extracted_apk := my_extract_apk := endif +dex_preopt_profile_src_file := $(my_prebuilt_src_file) + rs_compatibility_jni_libs := include $(BUILD_SYSTEM)/install_jni_libs.mk From 2ab3cf3c1f469b57d140be39f10c018013078712 Mon Sep 17 00:00:00 2001 From: bohu Date: Wed, 23 Aug 2017 23:42:33 -0700 Subject: [PATCH 068/123] emulator: fix selinux issues with cas/camera/drm hals BUG: 64726466 Test: build aosp_x86-eng, boot emulator without cas/camera/drm hals killed by selinux avc denials; camera can take pictures Change-Id: I8a154fdb5d7aa7763aab2b912976eb9e1d329cdb --- target/board/generic/sepolicy/hal_camera_default.te | 3 +++ target/board/generic/sepolicy/hal_cas_default.te | 1 + target/board/generic/sepolicy/hal_drm_default.te | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 target/board/generic/sepolicy/hal_camera_default.te create mode 100644 target/board/generic/sepolicy/hal_cas_default.te create mode 100644 target/board/generic/sepolicy/hal_drm_default.te diff --git a/target/board/generic/sepolicy/hal_camera_default.te b/target/board/generic/sepolicy/hal_camera_default.te new file mode 100644 index 0000000000..eb88c36f0e --- /dev/null +++ b/target/board/generic/sepolicy/hal_camera_default.te @@ -0,0 +1,3 @@ +vndbinder_use(hal_camera_default); +allow hal_camera_default hal_graphics_mapper_hwservice:hwservice_manager find; +hal_client_domain(hal_camera_default, hal_graphics_composer) diff --git a/target/board/generic/sepolicy/hal_cas_default.te b/target/board/generic/sepolicy/hal_cas_default.te new file mode 100644 index 0000000000..3ed3bee869 --- /dev/null +++ b/target/board/generic/sepolicy/hal_cas_default.te @@ -0,0 +1 @@ +vndbinder_use(hal_cas_default); diff --git a/target/board/generic/sepolicy/hal_drm_default.te b/target/board/generic/sepolicy/hal_drm_default.te new file mode 100644 index 0000000000..5a07433c8c --- /dev/null +++ b/target/board/generic/sepolicy/hal_drm_default.te @@ -0,0 +1,2 @@ +vndbinder_use(hal_drm_default); +hal_client_domain(hal_drm_default, hal_graphics_composer) From b260f0d557ee7620c2b8a2373ae5e38d03b54960 Mon Sep 17 00:00:00 2001 From: Hung-ying Tyan Date: Thu, 13 Jul 2017 17:04:10 +0800 Subject: [PATCH 069/123] Fix potential build break When BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED is enabled, the build system may attempt to create a symlink in TARGET_ROOT_OUT before TARGET_ROOT_OUT is created. Also make the symbolic link depend on INSTALLED_DEFAULT_PROP_TARGET so that the symbolic link is properly created when only bootimage is made. Bug: 63645797 Test: on non-A/B device, make installclean && make bootimag and then verify that the symbolic link exists at $(TARGET_ROOT_OUT)/default.prop Change-Id: Ied7b32abd7a5fd5456c4cb5ff68a56debe6254b7 (cherry picked from 58c1b0426f1805f51962ae1b67bb7d0b1f0e5d50) --- core/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index 0c36dc05f4..4a4760f5e3 100644 --- a/core/Makefile +++ b/core/Makefile @@ -81,6 +81,9 @@ endif # prop.default ifdef property_overrides_split_enabled INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_OUT)/etc/prop.default +INSTALLED_DEFAULT_PROP_OLD_TARGET := $(TARGET_ROOT_OUT)/default.prop +ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_OLD_TARGET) +$(INSTALLED_DEFAULT_PROP_OLD_TARGET): $(INSTALLED_DEFAULT_PROP_TARGET) else # legacy path INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_ROOT_OUT)/default.prop @@ -115,7 +118,7 @@ $(INSTALLED_DEFAULT_PROP_TARGET): $(intermediate_system_build_prop) $(hide) build/tools/post_process_props.py $@ ifdef property_overrides_split_enabled $(hide) mkdir -p $(TARGET_ROOT_OUT) - $(hide) ln -sf system/etc/prop.default $(TARGET_ROOT_OUT)/default.prop + $(hide) ln -sf system/etc/prop.default $(INSTALLED_DEFAULT_PROP_OLD_TARGET) endif # ----------------------------------------------------------------- From 49f78ff23166106059a68bb55a3ac37de81f61b4 Mon Sep 17 00:00:00 2001 From: Sundong Ahn Date: Mon, 10 Jul 2017 13:47:04 +0900 Subject: [PATCH 070/123] configstore: remove configstore 1.1 Configstore was up-revisioned from 1.0 to 1.1. However no new APIs were added to 1.1. Therefore configstore in mr1 will be down revisioned to 1.0. Bug: 64999074 Test: build & run Change-Id: Ife60328110c6d6cb3e8024fb4a5caabc4c7c034f --- target/product/embedded.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/product/embedded.mk b/target/product/embedded.mk index aefba439a9..7efa686326 100644 --- a/target/product/embedded.mk +++ b/target/product/embedded.mk @@ -20,7 +20,7 @@ PRODUCT_PACKAGES += \ adb \ adbd \ - android.hardware.configstore@1.1-service \ + android.hardware.configstore@1.0-service \ android.hidl.allocator@1.0-service \ android.hidl.memory@1.0-impl \ atrace \ From 90da258962a770b54133974e65c2100e309cd9ce Mon Sep 17 00:00:00 2001 From: bohu Date: Fri, 25 Aug 2017 11:15:03 -0700 Subject: [PATCH 071/123] emulator: fix widevine drm vndbinder denial [ 86.252399] type=1400 audit(1503684692.153:25): avc: denied { read write } for pid=4160 comm="android.hardwar" name="vndbinder" dev="tmpfs" ino=5163 scontext=u:r:hal_drm_widevine:s0 tcontext=u:object_r:vndbinder_device:s0 tclass=chr_file permissive=0 BUG: 64726466 Test: build sdk_gphone_x86-user target, launch it and the above denial should be fixed. Change-Id: Ied1268878236c42fbb0751a0f33014b332d78c32 --- target/board/generic/sepolicy/hal_drm_widevine.te | 1 + 1 file changed, 1 insertion(+) diff --git a/target/board/generic/sepolicy/hal_drm_widevine.te b/target/board/generic/sepolicy/hal_drm_widevine.te index c1a63ca742..42d462a753 100644 --- a/target/board/generic/sepolicy/hal_drm_widevine.te +++ b/target/board/generic/sepolicy/hal_drm_widevine.te @@ -8,4 +8,5 @@ init_daemon_domain(hal_drm_widevine) allow hal_drm mediacodec:fd use; allow hal_drm { appdomain -isolated_app }:fd use; +vndbinder_use(hal_drm_widevine); hal_client_domain(hal_drm_widevine, hal_graphics_composer); From 0ae807dabb825df76fac5266bb9473a19e440f22 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 24 Aug 2017 15:02:24 -0700 Subject: [PATCH 072/123] fwk comp mat: use a for loop for supported kernel versions Test: m system_compatibility_matrix.xml -j Bug: 64124223 Change-Id: Ife95bfb5b7103239e116df1ae844cc3a643b4c28 --- target/board/Android.mk | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/target/board/Android.mk b/target/board/Android.mk index 331367f598..29ff73b247 100644 --- a/target/board/Android.mk +++ b/target/board/Android.mk @@ -131,12 +131,16 @@ FRAMEWORK_VBMETA_VERSION := 0.0 endif # All kernel versions that the system image works with. -$(GEN): test/vts-testcase/kernel/config/data/android-3.18/android-base.cfg -$(GEN): test/vts-testcase/kernel/config/data/android-4.4/android-base.cfg -$(GEN): test/vts-testcase/kernel/config/data/android-4.9/android-base.cfg -$(GEN): PRIVATE_FLAGS += --kernel=3.18:test/vts-testcase/kernel/config/data/android-3.18/android-base.cfg -$(GEN): PRIVATE_FLAGS += --kernel=4.4:test/vts-testcase/kernel/config/data/android-4.4/android-base.cfg -$(GEN): PRIVATE_FLAGS += --kernel=4.9:test/vts-testcase/kernel/config/data/android-4.9/android-base.cfg +KERNEL_VERSIONS := 3.18 4.4 4.9 +KERNEL_CONFIG_DATA := test/vts-testcase/kernel/config/data + +$(GEN): $(foreach version,$(KERNEL_VERSIONS),\ + $(KERNEL_CONFIG_DATA)/android-$(version)/android-base.cfg) +$(GEN): PRIVATE_FLAGS += $(foreach version,$(KERNEL_VERSIONS),\ + --kernel=$(version):$(KERNEL_CONFIG_DATA)/android-$(version)/android-base.cfg) + +KERNEL_VERSIONS := +KERNEL_CONFIG_DATA := $(GEN): $(FRAMEWORK_COMPATIBILITY_MATRIX_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf # TODO(b/37405869) (b/37715375) inject avb versions as well for devices that have avb enabled. From afbb82b0525d7bd2e7d1b25d0d171d03c43bb80e Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 24 Aug 2017 15:36:02 -0700 Subject: [PATCH 073/123] fwk comp mat: add arch specific kernel requirements Test: m system_compatibility_matrix.xml -j Bug: 64124223 Change-Id: Ieda3ea43e5d3b7d393461bd54b311b58af443f7c --- target/board/Android.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/board/Android.mk b/target/board/Android.mk index 29ff73b247..5504c52b27 100644 --- a/target/board/Android.mk +++ b/target/board/Android.mk @@ -135,9 +135,10 @@ KERNEL_VERSIONS := 3.18 4.4 4.9 KERNEL_CONFIG_DATA := test/vts-testcase/kernel/config/data $(GEN): $(foreach version,$(KERNEL_VERSIONS),\ - $(KERNEL_CONFIG_DATA)/android-$(version)/android-base.cfg) + $(wildcard $(KERNEL_CONFIG_DATA)/android-$(version)/android-base*.cfg)) $(GEN): PRIVATE_FLAGS += $(foreach version,$(KERNEL_VERSIONS),\ - --kernel=$(version):$(KERNEL_CONFIG_DATA)/android-$(version)/android-base.cfg) + --kernel=$(version):$(call normalize-path-list,\ + $(wildcard $(KERNEL_CONFIG_DATA)/android-$(version)/android-base*.cfg))) KERNEL_VERSIONS := KERNEL_CONFIG_DATA := From 56b73bb4be34dd04614fb7d56f07c56958bdd876 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 29 Aug 2017 09:51:00 +0900 Subject: [PATCH 074/123] Make GSI for arm64_ab more generic 2ND CPU variant is set to generic as it already is for its non-AB counterpart. Bug: 65042524 Test: No regression on CTS with arm64_ab GSI Change-Id: I513444178e663b154d6ccfae763c59a1091b163e --- target/board/generic_arm64_ab/BoardConfig.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/board/generic_arm64_ab/BoardConfig.mk b/target/board/generic_arm64_ab/BoardConfig.mk index 1cab844744..e69debe501 100644 --- a/target/board/generic_arm64_ab/BoardConfig.mk +++ b/target/board/generic_arm64_ab/BoardConfig.mk @@ -26,8 +26,7 @@ TARGET_2ND_ARCH := arm TARGET_2ND_ARCH_VARIANT := armv7-a-neon TARGET_2ND_CPU_ABI := armeabi-v7a TARGET_2ND_CPU_ABI2 := armeabi -# TODO(jiyong) can we set krait here? -TARGET_2ND_CPU_VARIANT := cortex-a15 +TARGET_2ND_CPU_VARIANT := generic # Enable A/B update TARGET_NO_RECOVERY := true From 418258cee9d8b97dcff17653de562e465957d360 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Mon, 28 Aug 2017 14:19:35 -0700 Subject: [PATCH 075/123] Allow system server jars for WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY Renamed WITH_DEXPREOPT_BOOT_IMG_ONLY to WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY and changed the behavior accordingly. Preopt system server jars since selinux prevents system server from loading anything from /data. If we don't do this they will need to be extracted which is not favorable for RAM usage or performance. Test: make and flash and look at system server maps Bug: 65122284 Bug: 62356545 Change-Id: I49f2a23337fdd2bc2e628b683d26a0c135b2aabe --- core/dex_preopt.mk | 6 +++--- core/dex_preopt_odex_install.mk | 9 ++++++--- core/product.mk | 2 +- target/board/generic/BoardConfig.mk | 2 +- target/board/generic_arm64/BoardConfig.mk | 2 +- target/board/generic_mips/BoardConfig.mk | 2 +- target/board/generic_mips64/BoardConfig.mk | 2 +- target/board/generic_x86/BoardConfig.mk | 2 +- target/board/generic_x86_64/BoardConfig.mk | 2 +- target/board/generic_x86_arm/BoardConfig.mk | 2 +- 10 files changed, 17 insertions(+), 14 deletions(-) diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk index 0606c83bc9..8e496a78ac 100644 --- a/core/dex_preopt.mk +++ b/core/dex_preopt.mk @@ -30,10 +30,10 @@ install-on-system-other = $(filter-out $(PRODUCT_DEXPREOPT_SPEED_APPS) $(PRODUCT # Conditional to building on linux, as dex2oat currently does not work on darwin. ifeq ($(HOST_OS),linux) WITH_DEXPREOPT ?= true -# For an eng build only pre-opt the boot image. This gives reasonable performance and still -# allows a simple workflow: building in frameworks/base and syncing. +# For an eng build only pre-opt the boot image and system server. This gives reasonable performance +# and still allows a simple workflow: building in frameworks/base and syncing. ifeq (eng,$(TARGET_BUILD_VARIANT)) - WITH_DEXPREOPT_BOOT_IMG_ONLY ?= true + WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= true endif # Add mini-debug-info to the boot classpath unless explicitly asked not to. ifneq (false,$(WITH_DEXPREOPT_DEBUG_INFO)) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index 136def470a..c30ddff425 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -33,9 +33,12 @@ endif ifeq (,$(strip $(built_dex)$(my_prebuilt_src_file))) # contains no java code LOCAL_DEX_PREOPT := endif -# if WITH_DEXPREOPT_BOOT_IMG_ONLY=true and module is not in boot class path skip -ifeq (true,$(WITH_DEXPREOPT_BOOT_IMG_ONLY)) -ifeq ($(filter $(DEXPREOPT_BOOT_JARS_MODULES),$(LOCAL_MODULE)),) +# if WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY=true and module is not in boot class path skip +# Also preopt system server jars since selinux prevents system server from loading anything from +# /data. If we don't do this they will need to be extracted which is not favorable for RAM usage +# or performance. +ifeq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY)) +ifeq ($(filter $(PRODUCT_SYSTEM_SERVER_JARS) $(DEXPREOPT_BOOT_JARS_MODULES),$(LOCAL_MODULE)),) LOCAL_DEX_PREOPT := endif endif diff --git a/core/product.mk b/core/product.mk index 6722526c80..8f7db19efd 100644 --- a/core/product.mk +++ b/core/product.mk @@ -302,7 +302,7 @@ _product_stash_var_list += \ _product_stash_var_list += \ DEFAULT_SYSTEM_DEV_CERTIFICATE \ WITH_DEXPREOPT \ - WITH_DEXPREOPT_BOOT_IMG_ONLY \ + WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY \ WITH_DEXPREOPT_APP_IMAGE # diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 8bb3ed0d90..331f082196 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -34,7 +34,7 @@ USE_CAMERA_STUB := true ifeq ($(HOST_OS),linux) ifeq ($(WITH_DEXPREOPT),) WITH_DEXPREOPT := true - WITH_DEXPREOPT_BOOT_IMG_ONLY := false + WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false endif endif diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index a7a8943efb..46c8865a4f 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -65,7 +65,7 @@ USE_CAMERA_STUB := true ifeq ($(HOST_OS),linux) ifeq ($(WITH_DEXPREOPT),) WITH_DEXPREOPT := true - WITH_DEXPREOPT_BOOT_IMG_ONLY := false + WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false endif endif diff --git a/target/board/generic_mips/BoardConfig.mk b/target/board/generic_mips/BoardConfig.mk index a9e46b42a3..fb66d21f89 100644 --- a/target/board/generic_mips/BoardConfig.mk +++ b/target/board/generic_mips/BoardConfig.mk @@ -42,7 +42,7 @@ USE_CAMERA_STUB := true ifeq ($(HOST_OS),linux) ifeq ($(WITH_DEXPREOPT),) WITH_DEXPREOPT := true - WITH_DEXPREOPT_BOOT_IMG_ONLY := false + WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false endif endif diff --git a/target/board/generic_mips64/BoardConfig.mk b/target/board/generic_mips64/BoardConfig.mk index 6cb6c11a57..67bb51f715 100644 --- a/target/board/generic_mips64/BoardConfig.mk +++ b/target/board/generic_mips64/BoardConfig.mk @@ -57,7 +57,7 @@ USE_CAMERA_STUB := true ifeq ($(HOST_OS),linux) ifeq ($(WITH_DEXPREOPT),) WITH_DEXPREOPT := true - WITH_DEXPREOPT_BOOT_IMG_ONLY := false + WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false endif endif diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index bb2166b536..000a9a310e 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -22,7 +22,7 @@ USE_CAMERA_STUB := true # of an SDK AVD. Note that this operation only works on Linux for now ifeq ($(HOST_OS),linux) WITH_DEXPREOPT ?= true -WITH_DEXPREOPT_BOOT_IMG_ONLY ?= false +WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= false endif TARGET_USES_HWC2 := true diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index b49a10ca01..883dd2e5c4 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -28,7 +28,7 @@ USE_CAMERA_STUB := true # of an SDK AVD. Note that this operation only works on Linux for now ifeq ($(HOST_OS),linux) WITH_DEXPREOPT ?= true -WITH_DEXPREOPT_BOOT_IMG_ONLY ?= false +WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= false endif TARGET_USES_HWC2 := true diff --git a/target/board/generic_x86_arm/BoardConfig.mk b/target/board/generic_x86_arm/BoardConfig.mk index 4555f1f07f..131c0014ff 100644 --- a/target/board/generic_x86_arm/BoardConfig.mk +++ b/target/board/generic_x86_arm/BoardConfig.mk @@ -39,7 +39,7 @@ USE_CAMERA_STUB := true ifeq ($(HOST_OS),linux) ifeq ($(WITH_DEXPREOPT),) WITH_DEXPREOPT := true - WITH_DEXPREOPT_BOOT_IMG_ONLY := false + WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false endif endif From b97fd4e603139b10733668320fd4488f57f89e37 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Mon, 28 Aug 2017 17:50:52 +0800 Subject: [PATCH 076/123] Support TimeZoneRulesManagerService in GSI System Server starts "TimeZoneRulesManagerService" if "config_enableUpdateableTimeZoneRules" is true in config.xml. Some projects would turn on "config_enableUpdateableTimeZoneRules" by resource overlaying in vendor partition. So, GSI needs to include all required modules for TimeZoneRulesManagerService. Bug: 65001751 Test: Build pass and boot with GSI into home screen Change-Id: Ief929b23411c4fb85633696f47aabd0f065aab91 --- target/product/treble_common.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk index 2488653be3..070486dcf6 100644 --- a/target/product/treble_common.mk +++ b/target/product/treble_common.mk @@ -54,6 +54,13 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ netutils-wrapper-1.0 +# A workaround solution for some projects which require +# TimeZoneRulesManagerService by overlaying resource property +# "config_enableUpdateableTimeZoneRules" +PRODUCT_PACKAGES += \ + TimeZoneUpdater \ + TimeZoneData \ + # Android Verified Boot (AVB): # Builds a special vbmeta.img that disables AVB verification. # Otherwise, AVB will prevent the device from booting the generic system.img. From 73c10bed93b7749abb6cc268d0af2abfc35e0dc6 Mon Sep 17 00:00:00 2001 From: Guang Zhu Date: Thu, 24 Aug 2017 16:10:44 -0700 Subject: [PATCH 077/123] add CTS tradefed harness dependencies to PDK fusion config Bug: 38448863 Test: make platform-java, config zip contains added directories Change-Id: I49627ff9eac5effecb577b3d93ee0e24b3b4ab83 --- core/pdk_config.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/pdk_config.mk b/core/pdk_config.mk index 92ba8b781f..e12be29ed6 100644 --- a/core/pdk_config.mk +++ b/core/pdk_config.mk @@ -1,7 +1,10 @@ # This file defines the rule to fuse the platform.zip into the current PDK build. PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR := PDK_PLATFORM_JAVA_ZIP_JAVA_HOST_LIB_DIR := \ - host/common/obj/JAVA_LIBRARIES/bouncycastle-host_intermediates + host/common/obj/JAVA_LIBRARIES/bouncycastle-host_intermediates \ + host/common/obj/JAVA_LIBRARIES/compatibility-host-util_intermediates \ + host/common/obj/JAVA_LIBRARIES/cts-tradefed-harness_intermediates \ + host/common/obj/JAVA_LIBRARIES/hosttestlib_intermediates PDK_PLATFORM_JAVA_ZIP_CONTENTS := ifneq (,$(filter platform-java, $(MAKECMDGOALS))$(PDK_FUSION_PLATFORM_ZIP)) From 5bce7f201ecdce4747042d3cba9f375840ee4e7f Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Tue, 29 Aug 2017 14:41:16 -0700 Subject: [PATCH 078/123] Update compatibility matrix logic. Use c_m..xml for matrices which correspond to released API levels. Test: manual Test: build system complains when files are missing Bug: 63603463 Change-Id: I16bcab9a7548876ec2bedf9c5d70a126ac50b8d5 --- core/config.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/config.mk b/core/config.mk index 232f116974..94277de78b 100644 --- a/core/config.mk +++ b/core/config.mk @@ -762,8 +762,14 @@ endif ifeq ($(strip $(PRODUCT_COMPATIBILITY_MATRIX_LEVEL)),legacy) FRAMEWORK_COMPATIBILITY_MATRIX_FILE := hardware/interfaces/compatibility_matrix.legacy.xml -else ifeq ($(call math_gt_or_eq,$(PRODUCT_COMPATIBILITY_MATRIX_LEVEL),27),) +else ifeq ($(call math_gt_or_eq,$(PRODUCT_COMPATIBILITY_MATRIX_LEVEL),26),) + # All PRODUCT_FULL_TREBLE devices with shipping API levels < 26 get the level 26 manifest + # as that is the first. FRAMEWORK_COMPATIBILITY_MATRIX_FILE := hardware/interfaces/compatibility_matrix.26.xml +else ifeq ($(call math_gt_or_eq,$(PRODUCT_COMPATIBILITY_MATRIX_LEVEL),28),) + # All shipping API levels with released compatibility matrices get the corresponding matrix. + FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \ + hardware/interfaces/compatibility_matrix.$(PRODUCT_COMPATIBILITY_MATRIX_LEVEL).xml else FRAMEWORK_COMPATIBILITY_MATRIX_FILE := hardware/interfaces/compatibility_matrix.current.xml endif From 75edf540e29e901676fcab8f6704b4843026f6c0 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Mon, 28 Aug 2017 18:42:02 -0700 Subject: [PATCH 079/123] Fix boot image profile in make files Update location to framework/base/config instead of frameworks/base Fixed dex2oat dependency to my_out_boot_image_profile_location instead of my_out_profile_location. Bug: 37966211 Test: make and flash Change-Id: I446f11216cf6342861bbbf56ac5c4da2f36fb755 --- core/dex_preopt_libart.mk | 2 +- core/dex_preopt_libart_boot.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk index aa11d1587c..96160367be 100644 --- a/core/dex_preopt_libart.mk +++ b/core/dex_preopt_libart.mk @@ -105,7 +105,7 @@ ifeq (true,$(my_use_profile_for_boot_image)) my_boot_image_profile_location := $(PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION) ifeq (,$(my_boot_image_profile_location)) # If not set, use the default. -my_boot_image_profile_location := frameworks/base/boot-image-profile.txt +my_boot_image_profile_location := frameworks/base/config/boot-image-profile.txt endif # Code to create the boot image profile, not in dex_preopt_libart_boot.mk since the profile is the same for all archs. diff --git a/core/dex_preopt_libart_boot.mk b/core/dex_preopt_libart_boot.mk index d7281185bb..e3eb9efd72 100644 --- a/core/dex_preopt_libart_boot.mk +++ b/core/dex_preopt_libart_boot.mk @@ -68,7 +68,7 @@ endif $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME): PRIVATE_BOOT_IMAGE_FLAGS := $(my_boot_image_flags) $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME): PRIVATE_2ND_ARCH_VAR_PREFIX := $(my_2nd_arch_prefix) # Use dex2oat debug version for better error reporting -$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGET_BOOT_DEX_FILES) $(PRELOADED_CLASSES) $(COMPILED_CLASSES) $(DIRTY_IMAGE_OBJECTS) $(DEX2OAT_DEPENDENCY) $(my_out_profile_location) +$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGET_BOOT_DEX_FILES) $(PRELOADED_CLASSES) $(COMPILED_CLASSES) $(DIRTY_IMAGE_OBJECTS) $(DEX2OAT_DEPENDENCY) $(my_out_boot_image_profile_location) @echo "target dex2oat: $@" @mkdir -p $(dir $@) @mkdir -p $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED)) From 95ddc40d539d34f810b0f7d0709ba7c716851f8c Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Fri, 1 Sep 2017 12:00:09 +0800 Subject: [PATCH 080/123] Disable adb authorization in GSI To support test automation, disable adb authorization in GSI. Applied the patch, and device won't ask for adb authorization after overriding system image with GSI. Bug: 64489353 Test: boot up with GSI, and check by 'adb devices' Change-Id: Ibaa3aaa90a89ae03b8b23abf37f53ede64d15789 --- target/board/treble_system.prop | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/board/treble_system.prop b/target/board/treble_system.prop index bedf10c521..4b54aaf716 100644 --- a/target/board/treble_system.prop +++ b/target/board/treble_system.prop @@ -1,2 +1,5 @@ # GSI always generate dex pre-opt in system image ro.cp_system_other_odex=0 + +# GSI always disables adb authentication +ro.adb.secure=0 From 43e711962ef38ec3de184027d6a94d1df4f474a0 Mon Sep 17 00:00:00 2001 From: Sundong Ahn Date: Mon, 10 Jul 2017 13:47:04 +0900 Subject: [PATCH 081/123] configstore: remove configstore 1.1 Configstore was down-revisioned from 1.1 to 1.0 in oc-dr1-dev, oc-mr1-dev and oc-mr1-dev-plus-aosp. Therefore configstore in oc-dr1-dev-plus-aosp will also be down-revisioned to 1.0. Bug: 65124635 Test: build & boot test on sailfish + walleye Change-Id: Ife60328110c6d6cb3e8024fb4a5caabc4c7c034f Merged-In: I90d30584ad4499d4e20254be2974d9de1d3883c0 --- target/product/embedded.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/product/embedded.mk b/target/product/embedded.mk index 3466d1a866..349abd479d 100644 --- a/target/product/embedded.mk +++ b/target/product/embedded.mk @@ -20,7 +20,7 @@ PRODUCT_PACKAGES += \ adb \ adbd \ - android.hardware.configstore@1.1-service \ + android.hardware.configstore@1.0-service \ android.hidl.allocator@1.0-service \ android.hidl.memory@1.0-impl \ atrace \ From 292b8433cb48ef4ceb2330e57e11b8f644d9d1ee Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Tue, 5 Sep 2017 11:12:29 +0800 Subject: [PATCH 082/123] Remove root folder bt_firmware in GSI Bug: 64905218 Bug: 36764215 Test: Test on 2 different devices with GSI, and check BT Change-Id: I5fca470aece7d4b777540da21af601a7cc8dc83e --- target/board/generic_arm64_ab/BoardConfig.mk | 2 +- target/board/generic_arm64_ab/sepolicy/file.te | 1 - target/board/generic_arm64_ab/sepolicy/file_contexts | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target/board/generic_arm64_ab/BoardConfig.mk b/target/board/generic_arm64_ab/BoardConfig.mk index e69debe501..22b9f429fe 100644 --- a/target/board/generic_arm64_ab/BoardConfig.mk +++ b/target/board/generic_arm64_ab/BoardConfig.mk @@ -33,7 +33,7 @@ TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true # TODO(jiyong) These might be SoC specific. -BOARD_ROOT_EXTRA_FOLDERS += bt_firmware firmware firmware/radio persist +BOARD_ROOT_EXTRA_FOLDERS += firmware firmware/radio persist BOARD_ROOT_EXTRA_SYMLINKS := /vendor/lib/dsp:/dsp # TODO(b/36764215): remove this setting when the generic system image diff --git a/target/board/generic_arm64_ab/sepolicy/file.te b/target/board/generic_arm64_ab/sepolicy/file.te index 46455339a0..7adfdfa4e6 100644 --- a/target/board/generic_arm64_ab/sepolicy/file.te +++ b/target/board/generic_arm64_ab/sepolicy/file.te @@ -1,6 +1,5 @@ # TODO(b/36764215): remove this file when the generic system image # no longer has these directories -type bt_firmware_file, file_type; type persist_file, file_type; # Default type for anything under /firmware. diff --git a/target/board/generic_arm64_ab/sepolicy/file_contexts b/target/board/generic_arm64_ab/sepolicy/file_contexts index 92a4ff8726..0a80559e17 100644 --- a/target/board/generic_arm64_ab/sepolicy/file_contexts +++ b/target/board/generic_arm64_ab/sepolicy/file_contexts @@ -2,7 +2,6 @@ # no longer has these directories. They are specific to QCOM. # / -/bt_firmware(/.*)? u:object_r:bt_firmware_file:s0 /tombstones u:object_r:rootfs:s0 /dsp u:object_r:rootfs:s0 From 6bbb11a6205ef96cd5a90227a38c4c574431cf15 Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Fri, 1 Sep 2017 22:55:44 +0800 Subject: [PATCH 083/123] Include vbmeta.img into -img.zip Bug: 65227202 Test: make dist, checks vbmeta.img is included in -img.zip Change-Id: I3e09f036441bcf7e98d8f76360df1e17466ae38e --- core/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/Makefile b/core/Makefile index 4a4760f5e3..7f0e1cd2ca 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2271,6 +2271,7 @@ $(BUILT_TARGET_FILES_PACKAGE): \ $(INSTALLED_USERDATAIMAGE_TARGET) \ $(INSTALLED_CACHEIMAGE_TARGET) \ $(INSTALLED_VENDORIMAGE_TARGET) \ + $(INSTALLED_VBMETAIMAGE_TARGET) \ $(INSTALLED_DTBOIMAGE_TARGET) \ $(INTERNAL_SYSTEMOTHERIMAGE_FILES) \ $(INSTALLED_ANDROID_INFO_TXT_TARGET) \ @@ -2491,6 +2492,14 @@ ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true) @# If breakpad symbols have been generated, add them to the zip. $(hide) $(ACP) -r $(TARGET_OUT_BREAKPAD) $(zip_root)/BREAKPAD endif +# BOARD_BUILD_DISABLED_VBMETAIMAGE is used to build a special vbmeta.img +# that disables AVB verification. The content is fixed and we can just copy +# it to $(zip_root)/IMAGES without passing some info into misc_info.txt for +# regeneration. +ifeq (true,$(BOARD_BUILD_DISABLED_VBMETAIMAGE)) + $(hide) mkdir -p $(zip_root)/IMAGES + $(hide) cp $(INSTALLED_VBMETAIMAGE_TARGET) $(zip_root)/IMAGES/ +endif ifdef BOARD_PREBUILT_VENDORIMAGE $(hide) mkdir -p $(zip_root)/IMAGES $(hide) cp $(INSTALLED_VENDORIMAGE_TARGET) $(zip_root)/IMAGES/ From 558f3dd79bbc40b85d30499d92c6e5693e4c1a46 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Wed, 6 Sep 2017 16:39:27 +0800 Subject: [PATCH 084/123] Revise GSI to inherit from aosp_base.mk and telephony.mk GSI inherited from aosp_base_telephony.mk, but it included some settings for emulator. So this patch changes to inherit from more pure makefiles to includes AOSP and telephony modules. Bug: 65332895 Test: Test on some Pixel devices with GSI, boot to home screen Change-Id: I98523e864ccf06ddba4422bc8380bc6ff0095d5a --- target/product/aosp_arm64_a.mk | 2 -- target/product/aosp_arm64_ab.mk | 2 -- target/product/aosp_arm_a.mk | 2 -- target/product/aosp_arm_ab.mk | 2 -- target/product/aosp_x86_64_a.mk | 2 -- target/product/aosp_x86_64_ab.mk | 2 -- target/product/aosp_x86_a.mk | 2 -- target/product/aosp_x86_ab.mk | 2 -- target/product/treble_common.mk | 4 ++++ 9 files changed, 4 insertions(+), 16 deletions(-) diff --git a/target/product/aosp_arm64_a.mk b/target/product/aosp_arm64_a.mk index 84d4b4f6ef..3c7af334d9 100644 --- a/target/product/aosp_arm64_a.mk +++ b/target/product/aosp_arm64_a.mk @@ -21,8 +21,6 @@ include build/make/target/product/treble_common_64.mk -$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) - PRODUCT_NAME := aosp_arm64_a PRODUCT_DEVICE := generic_arm64_a PRODUCT_BRAND := Android diff --git a/target/product/aosp_arm64_ab.mk b/target/product/aosp_arm64_ab.mk index 75ded35b67..c96cb91807 100644 --- a/target/product/aosp_arm64_ab.mk +++ b/target/product/aosp_arm64_ab.mk @@ -27,8 +27,6 @@ PRODUCT_PACKAGES += \ update_engine \ update_verifier -$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) - PRODUCT_NAME := aosp_arm64_ab PRODUCT_DEVICE := generic_arm64_ab PRODUCT_BRAND := Android diff --git a/target/product/aosp_arm_a.mk b/target/product/aosp_arm_a.mk index 845d091f6a..3060fa920a 100644 --- a/target/product/aosp_arm_a.mk +++ b/target/product/aosp_arm_a.mk @@ -21,8 +21,6 @@ include build/make/target/product/treble_common_32.mk -$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) - PRODUCT_NAME := aosp_arm_a PRODUCT_DEVICE := generic_arm_a PRODUCT_BRAND := Android diff --git a/target/product/aosp_arm_ab.mk b/target/product/aosp_arm_ab.mk index 3a862eb777..98b2f99331 100644 --- a/target/product/aosp_arm_ab.mk +++ b/target/product/aosp_arm_ab.mk @@ -27,8 +27,6 @@ PRODUCT_PACKAGES += \ update_engine \ update_verifier -$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) - PRODUCT_NAME := aosp_arm_ab PRODUCT_DEVICE := generic_arm_ab PRODUCT_BRAND := Android diff --git a/target/product/aosp_x86_64_a.mk b/target/product/aosp_x86_64_a.mk index 53f8252f9f..a7fb740974 100644 --- a/target/product/aosp_x86_64_a.mk +++ b/target/product/aosp_x86_64_a.mk @@ -21,8 +21,6 @@ include build/make/target/product/treble_common_64.mk -$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) - PRODUCT_NAME := aosp_x86_64_a PRODUCT_DEVICE := generic_x86_64_a PRODUCT_BRAND := Android diff --git a/target/product/aosp_x86_64_ab.mk b/target/product/aosp_x86_64_ab.mk index 6080695eb7..4590dc599b 100644 --- a/target/product/aosp_x86_64_ab.mk +++ b/target/product/aosp_x86_64_ab.mk @@ -27,8 +27,6 @@ PRODUCT_PACKAGES += \ update_engine \ update_verifier -$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) - PRODUCT_NAME := aosp_x86_64_ab PRODUCT_DEVICE := generic_x86_64_ab PRODUCT_BRAND := Android diff --git a/target/product/aosp_x86_a.mk b/target/product/aosp_x86_a.mk index 72d6e1ab00..9ed29955e4 100644 --- a/target/product/aosp_x86_a.mk +++ b/target/product/aosp_x86_a.mk @@ -21,8 +21,6 @@ include build/make/target/product/treble_common_32.mk -$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) - PRODUCT_NAME := aosp_x86_a PRODUCT_DEVICE := generic_x86_a PRODUCT_BRAND := Android diff --git a/target/product/aosp_x86_ab.mk b/target/product/aosp_x86_ab.mk index f3aef958b6..404a4dadd1 100644 --- a/target/product/aosp_x86_ab.mk +++ b/target/product/aosp_x86_ab.mk @@ -27,8 +27,6 @@ PRODUCT_PACKAGES += \ update_engine \ update_verifier -$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) - PRODUCT_NAME := aosp_x86_ab PRODUCT_DEVICE := generic_x86_ab PRODUCT_BRAND := Android diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk index 070486dcf6..1c38b02a68 100644 --- a/target/product/treble_common.mk +++ b/target/product/treble_common.mk @@ -19,6 +19,10 @@ # on the generic system image, place them in build/make/target/board/ # treble_system.prop. +# Generic system image inherits from AOSP with telephony +$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony.mk) + # Split selinux policy PRODUCT_FULL_TREBLE_OVERRIDE := true From 62a835d0ef89e51f4a97fecf8576224551b545a5 Mon Sep 17 00:00:00 2001 From: Ian Pedowitz Date: Wed, 23 Aug 2017 18:23:31 -0700 Subject: [PATCH 085/123] DO NOT MERGE OC-MR1 is REL Bug: 64982450 Test: manual Change-Id: I054e3ecff49803e61e7741753fe6764a567d72c4 --- core/version_defaults.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 1e2611a5dc..8a3eef85f0 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -78,7 +78,7 @@ PLATFORM_VERSION.OPM1 := 8.1.0 # 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.OPM1 := OMR1 +PLATFORM_VERSION_CODENAME.OPM1 := REL ifndef PLATFORM_VERSION PLATFORM_VERSION := $(PLATFORM_VERSION.$(TARGET_PLATFORM_VERSION)) @@ -158,7 +158,7 @@ else # assuming the device can only support APIs as of the previous official # public release. # This value will always be 0 for release builds. - PLATFORM_PREVIEW_SDK_VERSION := 1 + PLATFORM_PREVIEW_SDK_VERSION := 0 endif endif From 686aff5b91207ff68b114a6a61840a48ad27fccb Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 22 Aug 2017 10:23:59 +0900 Subject: [PATCH 086/123] add llndk|vndksp.libraries.txt to vndk_package Bug: 64882323 Test: build 2017 pixel devices. check the files are under /system/etc. Change-Id: I488427f796b770bb2d151cfa49f73d323cafbc9f --- target/product/vndk/Android.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/product/vndk/Android.mk b/target/product/vndk/Android.mk index 20e8436697..c8ed8736a0 100644 --- a/target/product/vndk/Android.mk +++ b/target/product/vndk/Android.mk @@ -6,6 +6,8 @@ LOCAL_MODULE := vndk_package LOCAL_REQUIRED_MODULES := \ $(addsuffix .vendor,$(VNDK_CORE_LIBRARIES)) \ $(addsuffix .vendor,$(VNDK_SAMEPROCESS_LIBRARIES)) \ - $(LLNDK_LIBRARIES) + $(LLNDK_LIBRARIES) \ + llndk.libraries.txt \ + vndksp.libraries.txt include $(BUILD_PHONY_PACKAGE) From d861714097da3915493277a7ea39704a2b3f12ba Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 30 Aug 2017 15:54:59 -0700 Subject: [PATCH 087/123] Skip checking files that have less blocks in block map. When creating ext4 images with mke2fs, it may skip allocating some blocks if they contain all zeros. As a result, there could be less blocks listed in the block map than the actual file length. For example, for a file with a length of 112200-byte (27+ blocks), the listed blocks in block.map could be '43665-43688' (24 blocks). Because some all-zero blocks are not taking actual space. The generated ext4 images are perfectly valid - kernel will figure out that data block is not allocated and writes all zeros into user buffer. However, we can't fully reconstruct a file from its block list in our Python script. Ideally this can be avoided by mounting or parsing an ext4 image directly, which is yet to be supported in our script. This CL skips checking for such files to avoid failing validate_target_files.py. Bug: 65213616 Test: validate_target_files.py passes on targets with mke2fs generated images (e.g. marlin). Change-Id: Id9cc59e345b9283844044ef94ceb5702f0ca0526 (cherry picked from commit b418c30e3a2a1cfc07bc17577fad29bdbc3301a5) --- tools/releasetools/validate_target_files.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py index 1dd31591bd..0ad079841e 100755 --- a/tools/releasetools/validate_target_files.py +++ b/tools/releasetools/validate_target_files.py @@ -71,8 +71,20 @@ def ValidateFileConsistency(input_zip, input_tmp): file_size = len(file_data) file_size_rounded_up = RoundUpTo4K(file_size) file_data += '\0' * (file_size_rounded_up - file_size) - file_sha1 = common.File(entry, file_data).sha1 + unpacked_file = common.File(entry, file_data) + file_size = unpacked_file.size + # block.map may contain less blocks, because mke2fs may skip allocating + # blocks if they contain all zeros. We can't reconstruct such a file from + # its block list. (Bug: 65213616) + if file_size > ranges.size() * 4096: + logging.warning( + 'Skipping %s that has less blocks: file size %d-byte,' + ' ranges %s (%d-byte)', entry, file_size, ranges, + ranges.size() * 4096) + continue + + file_sha1 = unpacked_file.sha1 assert blocks_sha1 == file_sha1, \ 'file: %s, range: %s, blocks_sha1: %s, file_sha1: %s' % ( entry, ranges, blocks_sha1, file_sha1) From 106fa4f771c7317eb6a25ee1d8e643081cdb2989 Mon Sep 17 00:00:00 2001 From: Jaekyun Seok Date: Fri, 1 Sep 2017 17:23:25 +0900 Subject: [PATCH 088/123] Support excluding overlays when enforcing RRO PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS will be used to specify overlays to be excluded from enforcing RRO. The excluded overlays will be applied into the original package. Bug: 63600240 Bug: 65001751 Test: succeeded building with PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS := \ vendor/google/google_overlay/static_only \ vendor/google/nexus_overlay/common/static_only and confirmed that config_webview_packages existed in framework-res.apk with the overlayed value, but not in framework-res__auto_generated_rro.apk. Merged-In: I0bfb44fc7726710bb78d9100404bc6dd29d06a73 Change-Id: I0bfb44fc7726710bb78d9100404bc6dd29d06a73 (cherry picked from commit ccee95e6ec94196bfca775e526e27276a09856ae) --- core/package_internal.mk | 13 ++++++++++++- core/product.mk | 1 + core/product_config.mk | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/core/package_internal.mk b/core/package_internal.mk index 87a15d23fe..5c4ad28661 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -122,7 +122,18 @@ ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),) endif endif -ifndef enforce_rro_enabled +ifdef enforce_rro_enabled + ifneq ($(PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS),) + static_only_resource_overlays := $(filter $(addsuffix %,$(PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS)),$(package_resource_overlays)) + ifneq ($(static_only_resource_overlays),) + package_resource_overlays := $(filter-out $(static_only_resource_overlays),$(package_resource_overlays)) + LOCAL_RESOURCE_DIR := $(static_only_resource_overlays) $(LOCAL_RESOURCE_DIR) + ifeq ($(package_resource_overlays),) + enforce_rro_enabled := + endif + endif + endif +else LOCAL_RESOURCE_DIR := $(package_resource_overlays) $(LOCAL_RESOURCE_DIR) endif diff --git a/core/product.mk b/core/product.mk index 8f7db19efd..c955ccc061 100644 --- a/core/product.mk +++ b/core/product.mk @@ -94,6 +94,7 @@ _product_var_list := \ PRODUCT_EXTRA_RECOVERY_KEYS \ PRODUCT_PACKAGE_OVERLAYS \ DEVICE_PACKAGE_OVERLAYS \ + PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS \ PRODUCT_ENFORCE_RRO_TARGETS \ PRODUCT_SDK_ATREE_FILES \ PRODUCT_SDK_ADDON_NAME \ diff --git a/core/product_config.mk b/core/product_config.mk index 6812b05d48..cd62fb2e41 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -434,6 +434,10 @@ PRODUCT_ART_USE_READ_BARRIER := \ PRODUCT_IOT := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_IOT)) +# Resource overlay list which must be excluded from enforcing RRO. +PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS := \ + $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS)) + # Package list to apply enforcing RRO. PRODUCT_ENFORCE_RRO_TARGETS := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ENFORCE_RRO_TARGETS)) From afee8f30365795a732566b783468e662cbae0003 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 30 Aug 2017 15:54:59 -0700 Subject: [PATCH 089/123] Skip checking files that have less blocks in block map. When creating ext4 images with mke2fs, it may skip allocating some blocks if they contain all zeros. As a result, there could be less blocks listed in the block map than the actual file length. For example, for a file with a length of 112200-byte (27+ blocks), the listed blocks in block.map could be '43665-43688' (24 blocks). Because some all-zero blocks are not taking actual space. The generated ext4 images are perfectly valid - kernel will figure out that data block is not allocated and writes all zeros into user buffer. However, we can't fully reconstruct a file from its block list in our Python script. Ideally this can be avoided by mounting or parsing an ext4 image directly, which is yet to be supported in our script. This CL skips checking for such files to avoid failing validate_target_files.py. Bug: 65213616 Test: validate_target_files.py passes on targets with mke2fs generated images (e.g. marlin). Change-Id: Id9cc59e345b9283844044ef94ceb5702f0ca0526 (cherry picked from commit b418c30e3a2a1cfc07bc17577fad29bdbc3301a5) --- tools/releasetools/validate_target_files.py | 22 ++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py index 8ac3322c63..4b34820c89 100755 --- a/tools/releasetools/validate_target_files.py +++ b/tools/releasetools/validate_target_files.py @@ -44,8 +44,8 @@ def _GetImage(which, tmpdir): return sparse_img.SparseImage(path, mappath, clobbered_blocks) -def _CalculateFileSha1(file_name, unpacked_name, round_up=False): - """Calculate the SHA-1 for a given file. Round up its size to 4K if needed.""" +def _ReadFile(file_name, unpacked_name, round_up=False): + """Constructs and returns a File object. Rounds up its size if needed.""" def RoundUpTo4K(value): rounded_up = value + 4095 @@ -58,7 +58,7 @@ def _CalculateFileSha1(file_name, unpacked_name, round_up=False): if round_up: file_size_rounded_up = RoundUpTo4K(file_size) file_data += '\0' * (file_size_rounded_up - file_size) - return common.File(file_name, file_data).sha1 + return common.File(file_name, file_data) def ValidateFileAgainstSha1(input_tmp, file_name, file_path, expected_sha1): @@ -67,7 +67,7 @@ def ValidateFileAgainstSha1(input_tmp, file_name, file_path, expected_sha1): logging.info('Validating the SHA-1 of {}'.format(file_name)) unpacked_name = os.path.join(input_tmp, file_path) assert os.path.exists(unpacked_name) - actual_sha1 = _CalculateFileSha1(file_name, unpacked_name, False) + actual_sha1 = _ReadFile(file_name, unpacked_name, False).sha1 assert actual_sha1 == expected_sha1, \ 'SHA-1 mismatches for {}. actual {}, expected {}'.format( file_name, actual_sha1, expected_sha1) @@ -92,8 +92,20 @@ def ValidateFileConsistency(input_zip, input_tmp): # The filename under unpacked directory, such as SYSTEM/bin/sh. unpacked_name = os.path.join( input_tmp, which.upper(), entry[(len(prefix) + 1):]) - file_sha1 = _CalculateFileSha1(entry, unpacked_name, True) + unpacked_file = _ReadFile(entry, unpacked_name, True) + file_size = unpacked_file.size + # block.map may contain less blocks, because mke2fs may skip allocating + # blocks if they contain all zeros. We can't reconstruct such a file from + # its block list. (Bug: 65213616) + if file_size > ranges.size() * 4096: + logging.warning( + 'Skipping %s that has less blocks: file size %d-byte,' + ' ranges %s (%d-byte)', entry, file_size, ranges, + ranges.size() * 4096) + continue + + file_sha1 = unpacked_file.sha1 assert blocks_sha1 == file_sha1, \ 'file: %s, range: %s, blocks_sha1: %s, file_sha1: %s' % ( entry, ranges, blocks_sha1, file_sha1) From f89dc8488d5e673360c730f2932cddbd4b86f7fb Mon Sep 17 00:00:00 2001 From: Jaekyun Seok Date: Fri, 8 Sep 2017 22:08:37 +0000 Subject: [PATCH 090/123] Revert "Support TimeZoneRulesManagerService in GSI" This reverts commit b97fd4e603139b10733668320fd4488f57f89e37. Bug: 65001751 Test: no tests Change-Id: Ia48de712dff393671cd9ce4a9e040ebc16407aa9 --- target/product/treble_common.mk | 7 ------- 1 file changed, 7 deletions(-) diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk index 070486dcf6..2488653be3 100644 --- a/target/product/treble_common.mk +++ b/target/product/treble_common.mk @@ -54,13 +54,6 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ netutils-wrapper-1.0 -# A workaround solution for some projects which require -# TimeZoneRulesManagerService by overlaying resource property -# "config_enableUpdateableTimeZoneRules" -PRODUCT_PACKAGES += \ - TimeZoneUpdater \ - TimeZoneData \ - # Android Verified Boot (AVB): # Builds a special vbmeta.img that disables AVB verification. # Otherwise, AVB will prevent the device from booting the generic system.img. From 0f99033b7147ca8d3e4e7a078e6f89b6fe3924e6 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 8 Sep 2017 19:02:54 -0700 Subject: [PATCH 091/123] Fix the detection for compressed APKs. We pack _all_ the APK certs info into META/apkcerts.txt at build time, including the ones that are not installed for the target. When detecting for compressed APKs, we should only count the ones that are actually installed. Bug: 65498015 Test: `check_target_files_signatures.py bullhead-target_files.zip` Change-Id: I2f32d4667be0efbfd5f9365dde819f009572533d --- tools/releasetools/common.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 9d58954d2d..34c334e40f 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -772,6 +772,14 @@ def ReadApkCerts(tf_zip): certmap = {} compressed_extension = None + # META/apkcerts.txt contains the info for _all_ the packages known at build + # time. Filter out the ones that are not installed. + installed_files = set() + for name in tf_zip.namelist(): + basename = os.path.basename(name) + if basename: + installed_files.add(basename) + for line in tf_zip.read("META/apkcerts.txt").split("\n"): line = line.strip() if not line: @@ -796,6 +804,10 @@ def ReadApkCerts(tf_zip): else: raise ValueError("failed to parse line from apkcerts.txt:\n" + line) if this_compressed_extension: + # Only count the installed files. + filename = name + '.' + this_compressed_extension + if filename not in installed_files: + continue # Make sure that all the values in the compression map have the same # extension. We don't support multiple compression methods in the same # system image. From e90604b4b94c1f86cfe42d129f1aa0105a183134 Mon Sep 17 00:00:00 2001 From: Adam Seaton Date: Wed, 13 Sep 2017 10:26:51 -0700 Subject: [PATCH 092/123] [Do Not Merge] Update Security String to 2017-11-01 on lmp-dev bug:65631379 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 6ba045486e..92c0918fe7 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -75,7 +75,7 @@ ifeq "" "$(PLATFORM_SECURITY_PATCH)" # 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 := 2017-10-01 + PLATFORM_SECURITY_PATCH := 2017-11-01 endif ifeq "" "$(PLATFORM_BASE_OS)" From 0c93452c646fe256a7e93e83c6f5f681eafd0230 Mon Sep 17 00:00:00 2001 From: Adam Seaton Date: Wed, 13 Sep 2017 10:31:56 -0700 Subject: [PATCH 093/123] [Do Not Merge] Update Security String to 2017-11-01 on mnc-dev bug:65631379 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index d3320d5085..8dfe85abbe 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -105,7 +105,7 @@ ifeq "" "$(PLATFORM_SECURITY_PATCH)" # 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 := 2017-10-01 + PLATFORM_SECURITY_PATCH := 2017-11-01 endif ifeq "" "$(PLATFORM_BASE_OS)" From 6f224a7615915e67d22b327d5d6bd5bb6bef1d98 Mon Sep 17 00:00:00 2001 From: Adam Seaton Date: Wed, 13 Sep 2017 10:35:29 -0700 Subject: [PATCH 094/123] [Do Not Merge] Update Security String to 2017-11-01 on nyc-dev bug:65631379 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 2b44d3bd47..462f0204ca 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -114,7 +114,7 @@ ifeq "" "$(PLATFORM_SECURITY_PATCH)" # 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 := 2017-10-05 + PLATFORM_SECURITY_PATCH := 2017-11-01 endif ifeq "" "$(PLATFORM_BASE_OS)" From 8f4a4c213118ce088245abc4f31204393bab62a5 Mon Sep 17 00:00:00 2001 From: Adam Seaton Date: Wed, 13 Sep 2017 10:46:41 -0700 Subject: [PATCH 095/123] Update Security String to 2017-11-01 on oc-dev bug:65631379 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index a44ce774a5..29929a1688 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -165,7 +165,7 @@ ifndef PLATFORM_SECURITY_PATCH # 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 := 2017-10-05 + PLATFORM_SECURITY_PATCH := 2017-11-01 endif ifndef PLATFORM_BASE_OS From d24487a2f2f215e5de8aad8117e58f81eaf1529c Mon Sep 17 00:00:00 2001 From: Adam Seaton Date: Wed, 13 Sep 2017 10:51:18 -0700 Subject: [PATCH 096/123] Update Security String to 2017-11-05 on oc-dev bug:65631379 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 29929a1688..996900ba99 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -165,7 +165,7 @@ ifndef PLATFORM_SECURITY_PATCH # 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 := 2017-11-01 + PLATFORM_SECURITY_PATCH := 2017-11-05 endif ifndef PLATFORM_BASE_OS From 2a2dbcd4b5f19751f2f2ccb3ffad84ffda96aae2 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 12 Sep 2017 12:39:09 -0700 Subject: [PATCH 097/123] Consider prebuilt vendor.img as having vendor partition. vendor.img could be built from the source - in which case we have unpacked files under VENDOR/ - or dropped in as a prebuilt binary blob. We should consider either of them as target having a vendor partition. Because we need to add its AVB hashtree info into vbmeta.img if target is using AVB. Otherwise libfs_mgr would refuse to mount this "AVB-enabled" vendor.img. For targets not using AVB, this change is no-op. Bug: 65462819 Test: Having vendor.img as prebuilt, `make dist`. Check that the generated vbmeta.img contains the info from vendor.img. Test: Build, flash and boot the above image.zip. Change-Id: Iaeb30e2059cb33fb39f23e5ffd28f338d00ccbfc Merged-In: Iaeb30e2059cb33fb39f23e5ffd28f338d00ccbfc (cherry picked from commit b22afea0f0ea3880f9386a837850b13bcffc295c) --- tools/releasetools/add_img_to_target_files.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py index cf78d5ee61..a203fe095d 100755 --- a/tools/releasetools/add_img_to_target_files.py +++ b/tools/releasetools/add_img_to_target_files.py @@ -502,7 +502,13 @@ def AddImagesToTargetFiles(filename): print("target_files appears to already contain images.") sys.exit(1) - has_vendor = os.path.isdir(os.path.join(OPTIONS.input_tmp, "VENDOR")) + # vendor.img is unlike system.img or system_other.img. Because it could be + # built from source, or dropped into target_files.zip as a prebuilt blob. We + # consider either of them as vendor.img being available, which could be used + # when generating vbmeta.img for AVB. + has_vendor = (os.path.isdir(os.path.join(OPTIONS.input_tmp, "VENDOR")) or + os.path.exists(os.path.join(OPTIONS.input_tmp, "IMAGES", + "vendor.img"))) has_system_other = os.path.isdir(os.path.join(OPTIONS.input_tmp, "SYSTEM_OTHER")) From f23bbf19d4e8cffd63706aa9a384022e0b37e7a6 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 12 Sep 2017 12:39:09 -0700 Subject: [PATCH 098/123] Consider prebuilt vendor.img as having vendor partition. vendor.img could be built from the source - in which case we have unpacked files under VENDOR/ - or dropped in as a prebuilt binary blob. We should consider either of them as target having a vendor partition. Because we need to add its AVB hashtree info into vbmeta.img if target is using AVB. Otherwise libfs_mgr would refuse to mount this "AVB-enabled" vendor.img. For targets not using AVB, this change is no-op. Bug: 65462819 Test: Having vendor.img as prebuilt, `make dist`. Check that the generated vbmeta.img contains the info from vendor.img. Test: Build, flash and boot the above image.zip. Change-Id: Iaeb30e2059cb33fb39f23e5ffd28f338d00ccbfc Merged-In: Iaeb30e2059cb33fb39f23e5ffd28f338d00ccbfc (cherry picked from commit b22afea0f0ea3880f9386a837850b13bcffc295c) --- tools/releasetools/add_img_to_target_files.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py index 1ce22e7ea3..52d3918926 100755 --- a/tools/releasetools/add_img_to_target_files.py +++ b/tools/releasetools/add_img_to_target_files.py @@ -505,7 +505,13 @@ def AddImagesToTargetFiles(filename): print("target_files appears to already contain images.") sys.exit(1) - has_vendor = os.path.isdir(os.path.join(OPTIONS.input_tmp, "VENDOR")) + # vendor.img is unlike system.img or system_other.img. Because it could be + # built from source, or dropped into target_files.zip as a prebuilt blob. We + # consider either of them as vendor.img being available, which could be used + # when generating vbmeta.img for AVB. + has_vendor = (os.path.isdir(os.path.join(OPTIONS.input_tmp, "VENDOR")) or + os.path.exists(os.path.join(OPTIONS.input_tmp, "IMAGES", + "vendor.img"))) has_system_other = os.path.isdir(os.path.join(OPTIONS.input_tmp, "SYSTEM_OTHER")) From 09d0d5b8c50fc55ae3af6c30a42e7912976c3f65 Mon Sep 17 00:00:00 2001 From: Isaac Chen Date: Thu, 14 Sep 2017 17:56:56 +0800 Subject: [PATCH 099/123] Set default size for 32-bit GSI to 1 GB The previous size for 32-bit GSI (906 MB) is not enough for x86 GSI. Increase it to 1 GB (1024 MB). If some other arch, say arm, wants to use a smaller size, it can overwrite the default in its BoardConfig.mk. Bug: 65437122 Test: lunch aosp_x86_a; make -j; lunch aosp_arm_a; make -j Change-Id: I092966f0a0a327b1080ee10782960c6ccf44d8ee --- target/board/generic_arm_a/BoardConfig.mk | 3 +++ target/board/treble_common_32.mk | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/target/board/generic_arm_a/BoardConfig.mk b/target/board/generic_arm_a/BoardConfig.mk index 57a5196a96..e3a670784d 100644 --- a/target/board/generic_arm_a/BoardConfig.mk +++ b/target/board/generic_arm_a/BoardConfig.mk @@ -16,6 +16,9 @@ include build/make/target/board/treble_common_32.mk +# Overwrite the setting in treble_common_32.mk for non-A/B arm GSI +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 950009856 + TARGET_ARCH := arm TARGET_ARCH_VARIANT := armv7-a-neon TARGET_CPU_ABI := armeabi-v7a diff --git a/target/board/treble_common_32.mk b/target/board/treble_common_32.mk index 2c3447b4cf..dbe0899488 100644 --- a/target/board/treble_common_32.mk +++ b/target/board/treble_common_32.mk @@ -16,5 +16,6 @@ include build/make/target/board/treble_common.mk -# Partition size is default 906MB for 32 bits projects -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 950009856 +# Partition size defaults to 1 GB (1024 MB) for 32-bit products. It can +# be overwritten in specific BoardConfig.mk, if so desired. +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1073741824 From c09b693857fceb6ed8610c8e6804dc71ce4a3ef6 Mon Sep 17 00:00:00 2001 From: Jeff Gaston Date: Wed, 13 Sep 2017 15:21:50 -0700 Subject: [PATCH 100/123] Fix sdk-addon for absolute OUT_DIR Bug: 65286453 Test: m -j OUT_DIR=/tmp/abs PRODUCT-sdk_gphone_x86-sdk_addon /tmp/abs/host/linux-x86/sdk_addon/google_phone_x86-eng.jeffrygaston-linux-x86.zip Change-Id: Id2d18fe41de5d533baf1f082292d70d946386249 --- core/tasks/sdk-addon.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk index e26773ce80..2725f950cb 100644 --- a/core/tasks/sdk-addon.mk +++ b/core/tasks/sdk-addon.mk @@ -112,14 +112,14 @@ $(full_target): $(sdk_addon_deps) | $(ACP) $(ACP) -r $$d $(PRIVATE_STAGING_DIR)/docs ;\ done $(hide) mkdir -p $(dir $@) - $(hide) ( F=$$(pwd)/$@ ; cd $(PRIVATE_STAGING_DIR)/.. && zip -rqX $$F $(notdir $(PRIVATE_STAGING_DIR)) ) + $(hide) soong_zip -o $@ -C $(dir $(PRIVATE_STAGING_DIR)) -D $(PRIVATE_STAGING_DIR) $(full_target_img): PRIVATE_STAGING_DIR := $(call append-path,$(staging),$(addon_dir_img))/images/$(TARGET_CPU_ABI) $(full_target_img): $(full_target) $(addon_img_source_prop) | $(ACP) @echo Packaging SDK Addon System-Image: $@ $(hide) mkdir -p $(dir $@) $(ACP) -r $(PRODUCT_OUT)/data $(PRIVATE_STAGING_DIR)/data - $(hide) ( F=$$(pwd)/$@ ; cd $(PRIVATE_STAGING_DIR)/.. && zip -rqX $$F $(notdir $(PRIVATE_STAGING_DIR)) ) + $(hide) soong_zip -o $@ -C $(dir $(PRIVATE_STAGING_DIR)) -D $(PRIVATE_STAGING_DIR) .PHONY: sdk_addon From 062191956f1027b303fb4f03781c4023c6838c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Davidsson?= Date: Mon, 14 Aug 2017 13:19:28 +0200 Subject: [PATCH 101/123] DO NOT MERGE: Fix incorrect TARGET_2ND_CPU_VARIANT for non-A/B devices The BoardConfig.mk for arm64 non-A/B devices sets TARGET_2ND_CPU_VARIANT to generic. This causes the generic C implementation of memmove to be included instead of the optimized NEON assembler implementation. This implementation is significantly slower, in some cases enough to cause CTS failures. The BoardConfig.mk for arm64 A/B correctly sets TARGET_2ND_CPU_VARIANT to cortex-a15, and the comments in build/target/board/generic_arm64/BoardConfig.mk make it quite clear that this is the correct setting. Bug: 65042524 Test: build with aosp_arm64_a Change-Id: I3aa7beddc1039b9fe3178740dfdb90858c93dff7 --- target/board/generic_arm64_a/BoardConfig.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/board/generic_arm64_a/BoardConfig.mk b/target/board/generic_arm64_a/BoardConfig.mk index 4729744736..8f4043f162 100644 --- a/target/board/generic_arm64_a/BoardConfig.mk +++ b/target/board/generic_arm64_a/BoardConfig.mk @@ -26,4 +26,4 @@ TARGET_2ND_ARCH := arm TARGET_2ND_ARCH_VARIANT := armv7-a-neon TARGET_2ND_CPU_ABI := armeabi-v7a TARGET_2ND_CPU_ABI2 := armeabi -TARGET_2ND_CPU_VARIANT := generic +TARGET_2ND_CPU_VARIANT := cortex-a15 From 0fbb836cf624de91ba02bbb15c0d70668002b326 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 15 Sep 2017 13:40:48 -0700 Subject: [PATCH 102/123] Add product property for preopting extracted APKs The property is PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK. If specified, this preopts the APK with the default compile filter (quicken). This will be used to quicken preopt of gmscore dynamite modules when preopting is disabled. This fixes a possible RAM regression caused by running out of the APK. Bug: 65601274 Test: make and flash Change-Id: Ibf0fa73ee7fafd9735e587baf19c4950a7da817a --- core/dex_preopt_odex_install.mk | 6 +++++- core/prebuilt_internal.mk | 6 ++++++ core/product.mk | 1 + core/product_config.mk | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index cfcfca5021..4ff6c8d965 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -36,12 +36,16 @@ endif # if WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY=true and module is not in boot class path skip # Also preopt system server jars since selinux prevents system server from loading anything from # /data. If we don't do this they will need to be extracted which is not favorable for RAM usage -# or performance. +# or performance. If my_preopt_for_extracted_apk is true, we ignore the only preopt boot image +# options. +ifneq (true,$(my_preopt_for_extracted_apk)) ifeq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY)) ifeq ($(filter $(PRODUCT_SYSTEM_SERVER_JARS) $(DEXPREOPT_BOOT_JARS_MODULES),$(LOCAL_MODULE)),) LOCAL_DEX_PREOPT := endif endif +endif + # if installing into system, and odex are being installed into system_other, don't strip ifeq ($(BOARD_USES_SYSTEM_OTHER_ODEX),true) ifeq ($(LOCAL_DEX_PREOPT),true) diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index a9c0bc2bfe..620c22cf5f 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -281,6 +281,11 @@ $(my_extracted_apk): $(my_prebuilt_src_file) my_prebuilt_src_file := $(my_extracted_apk) my_extracted_apk := my_extract_apk := +ifeq ($(PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK),true) +# If the product property is set, always preopt for extracted modules to prevent executing out of +# the APK. +my_preopt_for_extracted_apk := true +endif endif dex_preopt_profile_src_file := $(my_prebuilt_src_file) @@ -641,3 +646,4 @@ endif # JAVA_LIBRARIES $(built_module) : $(LOCAL_ADDITIONAL_DEPENDENCIES) my_prebuilt_src_file := +my_preopt_for_extracted_apk := diff --git a/core/product.mk b/core/product.mk index c955ccc061..4682dac992 100644 --- a/core/product.mk +++ b/core/product.mk @@ -115,6 +115,7 @@ _product_var_list := \ PRODUCT_SYSTEM_PROPERTY_BLACKLIST \ PRODUCT_SYSTEM_SERVER_APPS \ PRODUCT_SYSTEM_SERVER_JARS \ + PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK \ PRODUCT_DEXPREOPT_SPEED_APPS \ PRODUCT_VBOOT_SIGNING_KEY \ PRODUCT_VBOOT_SIGNING_SUBKEY \ diff --git a/core/product_config.mk b/core/product_config.mk index cd62fb2e41..f7ae834fbc 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -260,6 +260,9 @@ PRODUCT_SYSTEM_SERVER_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYS PRODUCT_SYSTEM_SERVER_APPS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_APPS)) PRODUCT_DEXPREOPT_SPEED_APPS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEXPREOPT_SPEED_APPS)) +# All of the apps that we force preopt, this overrides WITH_DEXPREOPT. +PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK)) + # Find the device that this product maps to. TARGET_DEVICE := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEVICE) From 3fdb549931488d066aa606844127879eb7b13820 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Mon, 18 Sep 2017 13:05:24 -0700 Subject: [PATCH 103/123] Set the default value of pm.dexopt.shared to speed By default, we should compile all shared apks with the speed filter. Bug: 65591595 Test: build & boot Change-Id: I8781ca47090321a32641ec4c7a4ed3c722bab475 --- target/product/runtime_libart.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk index ed68c7838f..8aedee79cd 100644 --- a/target/product/runtime_libart.mk +++ b/target/product/runtime_libart.mk @@ -83,4 +83,5 @@ PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ pm.dexopt.install=quicken \ pm.dexopt.bg-dexopt=speed-profile \ pm.dexopt.ab-ota=speed-profile \ - pm.dexopt.inactive=verify + pm.dexopt.inactive=verify \ + pm.dexopt.shared=speed From 710a41358af7b0638570a644f08b80a2725fbe94 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 8 Sep 2017 13:29:54 -0700 Subject: [PATCH 104/123] Upgrade to ManifestMerger2 Switch to using ManifestMerger2 from prebuilts/gradle-plugin/com/android/tools/build/manifest-merger/26.0.0-beta2/manifest-merger-26.0.0-beta2.jar Bug: 36005379 Test: m -j checkbuild Change-Id: I83bd3f95778e93796d06f063aa7c61d2a63b117b Merged-In: I83bd3f95778e93796d06f063aa7c61d2a63b117b (cherry picked from commit e76e8021ebaca486aee8e82d6a3ce25a10bc3974) --- core/android_manifest.mk | 4 +++- core/config.mk | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/android_manifest.mk b/core/android_manifest.mk index 0093e02087..7d573d3fc3 100644 --- a/core/android_manifest.mk +++ b/core/android_manifest.mk @@ -34,10 +34,12 @@ ifdef my_full_libs_manifest_files main_android_manifest := $(full_android_manifest) full_android_manifest := $(intermediates.COMMON)/AndroidManifest.xml $(full_android_manifest): PRIVATE_LIBS_MANIFESTS := $(my_full_libs_manifest_files) +$(full_android_manifest): $(ANDROID_MANIFEST_MERGER_CLASSPATH) $(full_android_manifest) : $(main_android_manifest) $(my_full_libs_manifest_deps) @echo "Merge android manifest files: $@ <-- $< $(PRIVATE_LIBS_MANIFESTS)" @mkdir -p $(dir $@) - $(hide) $(ANDROID_MANIFEST_MERGER) --main $< --libs $(PRIVATE_LIBS_MANIFESTS) \ + $(hide) $(ANDROID_MANIFEST_MERGER) --main $< \ + --libs $(call normalize-path-list,$(PRIVATE_LIBS_MANIFESTS)) \ --out $@ endif diff --git a/core/config.mk b/core/config.mk index 868c356857..1ab263a72d 100644 --- a/core/config.mk +++ b/core/config.mk @@ -675,7 +675,14 @@ FINDBUGS := $(FINDBUGS_DIR)/findbugs JACOCO_CLI_JAR := $(HOST_OUT_JAVA_LIBRARIES)/jacoco-cli$(COMMON_JAVA_PACKAGE_SUFFIX) # Tool to merge AndroidManifest.xmls -ANDROID_MANIFEST_MERGER := $(JAVA) -classpath prebuilts/devtools/tools/lib/manifest-merger.jar com.android.manifmerger.Main merge +ANDROID_MANIFEST_MERGER_CLASSPATH := \ + prebuilts/gradle-plugin/com/android/tools/build/manifest-merger/26.0.0-beta2/manifest-merger-26.0.0-beta2.jar \ + prebuilts/gradle-plugin/com/android/tools/sdk-common/26.0.0-beta2/sdk-common-26.0.0-beta2.jar \ + prebuilts/gradle-plugin/com/android/tools/common/26.0.0-beta2/common-26.0.0-beta2.jar \ + prebuilts/misc/common/guava/guava-21.0.jar +ANDROID_MANIFEST_MERGER := $(JAVA) \ + -classpath $(subst $(space),:,$(strip $(ANDROID_MANIFEST_MERGER_CLASSPATH))) \ + com.android.manifmerger.Merger COLUMN:= column From 2fa3fe114625692410a00dbdf4f49f99cf198bda Mon Sep 17 00:00:00 2001 From: Jeff Gaston Date: Fri, 15 Sep 2017 12:34:29 -0700 Subject: [PATCH 105/123] Fix sdk-addon build on build servers they don't source envsetup.sh Bug: 65286453 Test: m -j OUT_DIR=/tmp/abs PRODUCT-sdk_gphone_x86-sdk_addon /tmp/abs/host/linux-x86/sdk_addon/google_phone_x86-eng.$(whoami)-linux-x86.zip Change-Id: Id396203b500e70cfa2b1e1eb5241d88fae88fc36 Merged-In: Id396203b500e70cfa2b1e1eb5241d88fae88fc36 (cherry picked from commit 25210ce70b483b2ae7328fe34d675c374166280d) --- core/tasks/sdk-addon.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk index 2725f950cb..197d41a78e 100644 --- a/core/tasks/sdk-addon.mk +++ b/core/tasks/sdk-addon.mk @@ -105,21 +105,21 @@ $(full_target): PRIVATE_DOCS_DIRS := $(addprefix $(OUT_DOCS)/, $(doc_modules)) $(full_target): PRIVATE_STAGING_DIR := $(call append-path,$(staging),$(addon_dir_leaf)) -$(full_target): $(sdk_addon_deps) | $(ACP) +$(full_target): $(sdk_addon_deps) | $(ACP) $(SOONG_ZIP) @echo Packaging SDK Addon: $@ $(hide) mkdir -p $(PRIVATE_STAGING_DIR)/docs $(hide) for d in $(PRIVATE_DOCS_DIRS); do \ $(ACP) -r $$d $(PRIVATE_STAGING_DIR)/docs ;\ done $(hide) mkdir -p $(dir $@) - $(hide) soong_zip -o $@ -C $(dir $(PRIVATE_STAGING_DIR)) -D $(PRIVATE_STAGING_DIR) + $(hide) $(SOONG_ZIP) -o $@ -C $(dir $(PRIVATE_STAGING_DIR)) -D $(PRIVATE_STAGING_DIR) $(full_target_img): PRIVATE_STAGING_DIR := $(call append-path,$(staging),$(addon_dir_img))/images/$(TARGET_CPU_ABI) -$(full_target_img): $(full_target) $(addon_img_source_prop) | $(ACP) +$(full_target_img): $(full_target) $(addon_img_source_prop) | $(ACP) $(SOONG_ZIP) @echo Packaging SDK Addon System-Image: $@ $(hide) mkdir -p $(dir $@) $(ACP) -r $(PRODUCT_OUT)/data $(PRIVATE_STAGING_DIR)/data - $(hide) soong_zip -o $@ -C $(dir $(PRIVATE_STAGING_DIR)) -D $(PRIVATE_STAGING_DIR) + $(hide) $(SOONG_ZIP) -o $@ -C $(dir $(PRIVATE_STAGING_DIR)) -D $(PRIVATE_STAGING_DIR) .PHONY: sdk_addon From 4876229afdf9d36312c5c6d93e9b57977df76427 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 13 Sep 2017 22:08:45 -0700 Subject: [PATCH 106/123] Add support for profiles without preopt Add and push profiles for apps that are not preopted. This will be used to enable speed-profile during first boot if required. Also add missing handling to have profiles properly named for compressed APKs. Test: make and flash Bug: 38032017 Bug: 64503246 Change-Id: Ie1fbb5ed5a5d7e1e0be05f62aff1f4881a3bd1be --- core/dex_preopt_odex_install.mk | 91 ++++++++++++++++++--------------- 1 file changed, 51 insertions(+), 40 deletions(-) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index 4ff6c8d965..235f4bc4f1 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -65,17 +65,10 @@ built_installed_odex := built_installed_vdex := built_installed_art := -ifdef LOCAL_DEX_PREOPT - ifeq (false,$(WITH_DEX_PREOPT_GENERATE_PROFILE)) LOCAL_DEX_PREOPT_GENERATE_PROFILE := false endif -ifdef LOCAL_VENDOR_MODULE -ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE)) -$(error profiles are not supported for vendor modules) -endif -else ifndef LOCAL_DEX_PREOPT_GENERATE_PROFILE # If LOCAL_DEX_PREOPT_GENERATE_PROFILE is not defined, default it based on the existence of the # profile class listing. TODO: Use product specific directory here. @@ -83,14 +76,54 @@ my_classes_directory := $(PRODUCT_DEX_PREOPT_PROFILE_DIR) LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING := $(my_classes_directory)/$(LOCAL_MODULE).prof.txt ifneq (,$(wildcard $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING))) # Profile listing exists, use it to generate the profile. -ifeq ($(LOCAL_DEX_PREOPT_APP_IMAGE),) -LOCAL_DEX_PREOPT_APP_IMAGE := true -endif LOCAL_DEX_PREOPT_GENERATE_PROFILE := true endif endif + +ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE)) + +ifdef LOCAL_VENDOR_MODULE +$(call pretty-error, Internal error: profiles are not supported for vendor modules) +else +LOCAL_DEX_PREOPT_APP_IMAGE := true endif +ifndef LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING +$(call pretty-error,Must have specified class listing (LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING)) +endif +ifeq (,$(dex_preopt_profile_src_file)) +$(call pretty-error, Internal error: dex_preopt_profile_src_file must be set) +endif +my_built_profile := $(dir $(LOCAL_BUILT_MODULE))/profile.prof +my_dex_location := $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE)) +# Remove compressed APK extension. +my_dex_location := $(patsubst %.gz,%,$(my_dex_location)) +$(my_built_profile): PRIVATE_BUILT_MODULE := $(dex_preopt_profile_src_file) +$(my_built_profile): PRIVATE_DEX_LOCATION := $(my_dex_location) +$(my_built_profile): PRIVATE_SOURCE_CLASSES := $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING) +$(my_built_profile): $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING) +$(my_built_profile): $(PROFMAN) +$(my_built_profile): $(dex_preopt_profile_src_file) +$(my_built_profile): + $(hide) mkdir -p $(dir $@) + ANDROID_LOG_TAGS="*:e" $(PROFMAN) \ + --create-profile-from=$(PRIVATE_SOURCE_CLASSES) \ + --apk=$(PRIVATE_BUILT_MODULE) \ + --dex-location=$(PRIVATE_DEX_LOCATION) \ + --reference-profile-file=$@ +dex_preopt_profile_src_file:= +# Remove compressed APK extension. +my_installed_profile := $(patsubst %.gz,%,$(LOCAL_INSTALLED_MODULE)).prof +# my_installed_profile := $(LOCAL_INSTALLED_MODULE).prof +$(eval $(call copy-one-file,$(my_built_profile),$(my_installed_profile))) +build_installed_profile:=$(my_built_profile):$(my_installed_profile) +else +build_installed_profile:= +my_installed_profile := +endif + +ifdef LOCAL_DEX_PREOPT + dexpreopt_boot_jar_module := $(filter $(DEXPREOPT_BOOT_JARS_MODULES),$(LOCAL_MODULE)) ifdef dexpreopt_boot_jar_module # For libart, the boot jars' odex files are replaced by $(DEFAULT_DEX_PREOPT_INSTALLED_IMAGE). @@ -146,36 +179,9 @@ installed_art := $(strip $(installed_art)) ifdef built_odex ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE)) -ifndef LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING -$(call pretty-error,Must have specified class listing (LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING)) -endif -ifeq (,$(dex_preopt_profile_src_file)) -$(call pretty-error, Internal error: dex_preopt_profile_src_file must be set) -endif -my_built_profile := $(dir $(LOCAL_BUILT_MODULE))/profile.prof -my_dex_location := $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE)) $(built_odex): $(my_built_profile) $(built_odex): PRIVATE_PROFILE_PREOPT_FLAGS := --profile-file=$(my_built_profile) -$(my_built_profile): PRIVATE_BUILT_MODULE := $(dex_preopt_profile_src_file) -$(my_built_profile): PRIVATE_DEX_LOCATION := $(my_dex_location) -$(my_built_profile): PRIVATE_SOURCE_CLASSES := $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING) -$(my_built_profile): $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING) -$(my_built_profile): $(PROFMAN) -$(my_built_profile): $(dex_preopt_profile_src_file) -$(my_built_profile): - $(hide) mkdir -p $(dir $@) - ANDROID_LOG_TAGS="*:e" $(PROFMAN) \ - --create-profile-from=$(PRIVATE_SOURCE_CLASSES) \ - --apk=$(PRIVATE_BUILT_MODULE) \ - --dex-location=$(PRIVATE_DEX_LOCATION) \ - --reference-profile-file=$@ -dex_preopt_profile_src_file:= -my_installed_profile := $(LOCAL_INSTALLED_MODULE).prof -$(eval $(call copy-one-file,$(my_built_profile),$(my_installed_profile))) -build_installed_profile:=$(my_built_profile):$(my_installed_profile) else -build_installed_profile:= -my_installed_profile := $(built_odex): PRIVATE_PROFILE_PREOPT_FLAGS := endif @@ -236,11 +242,10 @@ endif ALL_MODULES.$(my_register_name).INSTALLED += $(installed_odex) ALL_MODULES.$(my_register_name).INSTALLED += $(installed_vdex) ALL_MODULES.$(my_register_name).INSTALLED += $(installed_art) -ALL_MODULES.$(my_register_name).INSTALLED += $(my_installed_profile) + ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(built_installed_odex) ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(built_installed_vdex) ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(built_installed_art) -ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(build_installed_profile) # Record dex-preopt config. DEXPREOPT.$(LOCAL_MODULE).DEX_PREOPT := $(LOCAL_DEX_PREOPT) @@ -256,6 +261,12 @@ DEXPREOPT.MODULES.$(LOCAL_MODULE_CLASS) := $(sort \ # Make sure to install the .odex and .vdex when you run "make " -$(my_all_targets): $(installed_odex) $(installed_vdex) $(installed_art) $(my_installed_profile) +$(my_all_targets): $(installed_odex) $(installed_vdex) $(installed_art) endif # LOCAL_DEX_PREOPT + +# Profile doesn't depend on LOCAL_DEX_PREOPT. +ALL_MODULES.$(my_register_name).INSTALLED += $(my_installed_profile) +ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(build_installed_profile) + +$(my_all_targets): $(my_installed_profile) From 04f6ff5adb926728404e096f244d54e31f23dbff Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Mon, 4 Sep 2017 18:04:40 +0800 Subject: [PATCH 107/123] Disable VNDK runtime checking GSI enabled the VNDK, but devices need to fix the depedency of libraries. Before that, disable the VNDK runtime checking temporary. Bug: 65190702 Test: Test on a device which doesn't fix VNDK dependency with GSI Change-Id: Ib942a7efdc75beca93c60d1e0484835342efcfd2 --- target/board/treble_common.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/board/treble_common.mk b/target/board/treble_common.mk index 8637235a03..ec711c256a 100644 --- a/target/board/treble_common.mk +++ b/target/board/treble_common.mk @@ -19,6 +19,7 @@ # VNDK BOARD_VNDK_VERSION := current +BOARD_VNDK_RUNTIME_DISABLE := true # Properties TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop From 8f7bc0e6bdb300d9d71be225a00cfb4c9a3fb591 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Thu, 21 Sep 2017 19:40:42 +0900 Subject: [PATCH 108/123] DO NOT MERGE: Fix incorrect TARGET_2ND_CPU_VARIANT for A/B devices TARGET_2ND_CPU_VARIANT for non A/B devices has been changed to cortex-a15 for better performance. Do the same for A/B devices. Bug: 65042524 Test: build with aosp_arm64_ab Change-Id: Id67c2779d2170f29b278c1c8a9ac513aa76a620d --- target/board/generic_arm64_ab/BoardConfig.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/board/generic_arm64_ab/BoardConfig.mk b/target/board/generic_arm64_ab/BoardConfig.mk index 22b9f429fe..6744289e64 100644 --- a/target/board/generic_arm64_ab/BoardConfig.mk +++ b/target/board/generic_arm64_ab/BoardConfig.mk @@ -26,7 +26,7 @@ TARGET_2ND_ARCH := arm TARGET_2ND_ARCH_VARIANT := armv7-a-neon TARGET_2ND_CPU_ABI := armeabi-v7a TARGET_2ND_CPU_ABI2 := armeabi -TARGET_2ND_CPU_VARIANT := generic +TARGET_2ND_CPU_VARIANT := cortex-a15 # Enable A/B update TARGET_NO_RECOVERY := true From 98ef408b834f9ef28b8e4259298ad9407bb314bf Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Tue, 26 Sep 2017 16:41:37 +0800 Subject: [PATCH 109/123] Change aosp_arm_(a|ab) to 768MB Bug: 64733959 Bug: 66880884 Test: Build pass with these 2 projects Change-Id: Ic8dc39d861b7fe80bd805e0d73e2b5438f98a31b --- target/board/generic_arm_a/BoardConfig.mk | 2 +- target/board/generic_arm_ab/BoardConfig.mk | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/target/board/generic_arm_a/BoardConfig.mk b/target/board/generic_arm_a/BoardConfig.mk index e3a670784d..d930749241 100644 --- a/target/board/generic_arm_a/BoardConfig.mk +++ b/target/board/generic_arm_a/BoardConfig.mk @@ -17,7 +17,7 @@ include build/make/target/board/treble_common_32.mk # Overwrite the setting in treble_common_32.mk for non-A/B arm GSI -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 950009856 +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 805306368 # 768MB TARGET_ARCH := arm TARGET_ARCH_VARIANT := armv7-a-neon diff --git a/target/board/generic_arm_ab/BoardConfig.mk b/target/board/generic_arm_ab/BoardConfig.mk index ae8de14681..011bcdf60c 100644 --- a/target/board/generic_arm_ab/BoardConfig.mk +++ b/target/board/generic_arm_ab/BoardConfig.mk @@ -16,6 +16,9 @@ include build/make/target/board/treble_common_32.mk +# Overwrite the setting in treble_common_32.mk for non-A/B arm GSI +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 805306368 # 768MB + TARGET_ARCH := arm TARGET_ARCH_VARIANT := armv7-a-neon TARGET_CPU_ABI := armeabi-v7a From 87153c64fc4e1282215a1e742fcc19a11e570243 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 22 Sep 2017 15:45:33 -0700 Subject: [PATCH 110/123] Build repeatable system images with mke2fs. We have added support in mkuserimg_mke2fs.sh that allows specifying filesystem UUID and hash seed UUID. This CL generates and passes the UUIDs based on the image name and build fingerprint. This way we can rebuild and get identical images. Note that this only applies to images generated with `m dist` and with signing tools (sign_target_files_apks.py and add_img_to_target_files.py). Images under $OUT (built with `make`) are not affected. Bug: 64994964 Test: lunch marlin-userdebug; run `m dist` twice (after deleting the intermediate files under $OUT/obj/PACKAGING), and compare the generated images. Change-Id: I41cf4e5869582bb930af2f35a8e9c79bff43b2a2 (cherry picked from commit 3aa21e6bb9f46b5c16c4b42757d64e738e506031) --- tools/releasetools/add_img_to_target_files.py | 14 ++++++++++++++ tools/releasetools/build_image.py | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py index 52d3918926..02f2000a07 100755 --- a/tools/releasetools/add_img_to_target_files.py +++ b/tools/releasetools/add_img_to_target_files.py @@ -58,6 +58,7 @@ import shlex import shutil import subprocess import tempfile +import uuid import zipfile import build_image @@ -257,6 +258,19 @@ def CreateImage(input_dir, info_dict, what, output_file, block_list=None): if block_list: image_props["block_list"] = block_list.name + # Use repeatable ext4 FS UUID and hash_seed UUID (based on partition name and + # build fingerprint). + uuid_seed = what + "-" + if "build.prop" in info_dict: + build_prop = info_dict["build.prop"] + if "ro.build.fingerprint" in build_prop: + uuid_seed += build_prop["ro.build.fingerprint"] + elif "ro.build.thumbprint" in build_prop: + uuid_seed += build_prop["ro.build.thumbprint"] + image_props["uuid"] = str(uuid.uuid5(uuid.NAMESPACE_URL, uuid_seed)) + hash_seed = "hash_seed-" + uuid_seed + image_props["hash_seed"] = str(uuid.uuid5(uuid.NAMESPACE_URL, hash_seed)) + succ = build_image.BuildImage(os.path.join(temp_dir, what), image_props, output_file.name) assert succ, "build " + what + ".img image failed" diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py index 6de97633af..1b9bb04f1f 100755 --- a/tools/releasetools/build_image.py +++ b/tools/releasetools/build_image.py @@ -467,6 +467,12 @@ def BuildImage(in_dir, prop_dict, out_file, target_out=None): build_command.extend(["-e", prop_dict["flash_erase_block_size"]]) if "flash_logical_block_size" in prop_dict: build_command.extend(["-o", prop_dict["flash_logical_block_size"]]) + # Specify UUID and hash_seed if using mke2fs. + if prop_dict["ext_mkuserimg"] == "mkuserimg_mke2fs.sh": + if "uuid" in prop_dict: + build_command.extend(["-U", prop_dict["uuid"]]) + if "hash_seed" in prop_dict: + build_command.extend(["-S", prop_dict["hash_seed"]]) if "selinux_fc" in prop_dict: build_command.append(prop_dict["selinux_fc"]) elif fs_type.startswith("squash"): From a4a944b7178856a7ced8fd807f5e6c7facc578fd Mon Sep 17 00:00:00 2001 From: Hung-ying Tyan Date: Thu, 28 Sep 2017 12:03:41 +0800 Subject: [PATCH 111/123] GSI: add the messaging app in order to pass android.telecom.cts.ExtendedInCallServiceTest#testOnCannedTextResponsesLoaded on GSI. Bug: 66983288 Test: boot marlin-user with GSI (aosp_arm64_ab-userdebug) and pass the test. Change-Id: I77a2d59e5525c0e93806312a9cf79be5093523bc --- target/product/treble_common.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk index f885646adc..13b7769f8c 100644 --- a/target/product/treble_common.mk +++ b/target/product/treble_common.mk @@ -26,6 +26,11 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony.mk) # Split selinux policy PRODUCT_FULL_TREBLE_OVERRIDE := true +# The Messaging app: +# Needed for android.telecom.cts.ExtendedInCallServiceTest#testOnCannedTextResponsesLoaded +PRODUCT_PACKAGES += \ + messaging + # All VNDK libraries (HAL interfaces, VNDK, VNDK-SP, LL-NDK) PRODUCT_PACKAGES += vndk_package From 16cda2fbffc4b98dd000d6532e7e145893a45066 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 27 Sep 2017 17:17:43 -0700 Subject: [PATCH 112/123] Use computed salt for AVB-signed images. We want the generated images being identical for the same source files. Currently the generated ext4 image (either from make_ext4fs or mke2fs) is reproducible, but the AVB footer added by avbtool contain changes because of the random salt being used. This CL changes the avbtool invocation to specify "--salt " (already supported by avbtool) to use reproducible salt that's computed based on fingerprints (or thumbprints if applicable). Bug: 67023482 Test: Regenerate images from the same source as follows: Use a target_files.zip from an AVB-enabled target. $ zip -d target_files.zip IMAGES/\* $ ./build/make/tools/releasetools/add_img_to_target_files.py \ -v target_files.zip Repeat the above commands and compare the generated images. Change-Id: Id9db17ae0132ca3a820b4be5a5ef06ca3fef71ed Merged-In: Id9db17ae0132ca3a820b4be5a5ef06ca3fef71ed (cherry picked from commit 8f05cca1d9989ecb2e5a5d12f1410b6eca8c75b6) --- tools/releasetools/add_img_to_target_files.py | 12 ++++++++++++ tools/releasetools/build_image.py | 13 +++++++++---- tools/releasetools/common.py | 4 ++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py index 02f2000a07..1a08cb6fa7 100755 --- a/tools/releasetools/add_img_to_target_files.py +++ b/tools/releasetools/add_img_to_target_files.py @@ -53,6 +53,7 @@ if sys.hexversion < 0x02070000: import datetime import errno +import hashlib import os import shlex import shutil @@ -546,6 +547,17 @@ def AddImagesToTargetFiles(filename): has_recovery = (OPTIONS.info_dict.get("no_recovery") != "true") + if OPTIONS.info_dict.get("avb_enable") == "true": + fp = None + if "build.prop" in OPTIONS.info_dict: + build_prop = OPTIONS.info_dict["build.prop"] + if "ro.build.fingerprint" in build_prop: + fp = build_prop["ro.build.fingerprint"] + elif "ro.build.thumbprint" in build_prop: + fp = build_prop["ro.build.thumbprint"] + if fp: + OPTIONS.info_dict["avb_salt"] = hashlib.sha256(fp).hexdigest() + def banner(s): print("\n\n++++ " + s + " ++++\n\n") diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py index 1b9bb04f1f..ccfa35fc10 100755 --- a/tools/releasetools/build_image.py +++ b/tools/releasetools/build_image.py @@ -120,7 +120,7 @@ def AVBCalcMaxImageSize(avbtool, footer_type, partition_size, additional_args): return int(output) def AVBAddFooter(image_path, avbtool, footer_type, partition_size, - partition_name, key_path, algorithm, + partition_name, key_path, algorithm, salt, additional_args): """Adds dm-verity hashtree and AVB metadata to an image. @@ -132,6 +132,7 @@ def AVBAddFooter(image_path, avbtool, footer_type, partition_size, partition_name: The name of the partition - will be embedded in metadata. key_path: Path to key to use or None. algorithm: Name of algorithm to use or None. + salt: The salt to use (a hexadecimal string) or None. additional_args: Additional arguments to pass to 'avbtool add_hashtree_image'. Returns: @@ -144,6 +145,8 @@ def AVBAddFooter(image_path, avbtool, footer_type, partition_size, if key_path and algorithm: cmd.extend(["--key", key_path, "--algorithm", algorithm]) + if salt: + cmd.extend(["--salt", salt]) cmd.extend(shlex.split(additional_args)) @@ -590,10 +593,11 @@ def BuildImage(in_dir, prop_dict, out_file, target_out=None): # key_path and algorithm are only available when chain partition is used. key_path = prop_dict.get("avb_key_path") algorithm = prop_dict.get("avb_algorithm") + salt = prop_dict.get("avb_salt") # avb_add_hash_footer_args or avb_add_hashtree_footer_args additional_args = prop_dict["avb_add_" + avb_footer_type + "_footer_args"] if not AVBAddFooter(out_file, avbtool, avb_footer_type, original_partition_size, - partition_name, key_path, algorithm, additional_args): + partition_name, key_path, algorithm, salt, additional_args): return False if run_fsck and prop_dict.get("skip_fsck") != "true": @@ -639,8 +643,9 @@ def ImagePropFromGlobalDict(glob_dict, mount_point): "verity_signer_cmd", "verity_fec", "avb_enable", - "avb_avbtool" - ) + "avb_avbtool", + "avb_salt", + ) for p in common_props: copy_prop(p, p) diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 34c334e40f..f3096c924b 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -353,6 +353,10 @@ def AppendAVBSigningArgs(cmd, partition): algorithm = OPTIONS.info_dict.get("avb_" + partition + "_algorithm") if key_path and algorithm: cmd.extend(["--key", key_path, "--algorithm", algorithm]) + avb_salt = OPTIONS.info_dict.get("avb_salt") + # make_vbmeta_image doesn't like "--salt" (and it's not needed). + if avb_salt and partition != "vbmeta": + cmd.extend(["--salt", avb_salt]) def _BuildBootableImage(sourcedir, fs_config_file, info_dict=None, From e49ee7095fd8e6c2e45a404856ff584938fd7fac Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Fri, 29 Sep 2017 15:32:22 -0700 Subject: [PATCH 113/123] Enforce TARGET_USES_MKE2FS := true for new devices Bug: 62434479 Test: verify failure on 27 device w/o TARGET_USES_MKE2FS Test: verify success on 27 device w/ TARGET_USES_MKE2FS Test: `build/test/build_test.sh -only-config` on oc-mr1-dev and master Change-Id: Ib7e8dad404a1eaf70f47ee1d46528be4aabd6e80 --- core/config.mk | 8 ++++++++ target/product/product_launched_with_o_mr1.mk | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 target/product/product_launched_with_o_mr1.mk diff --git a/core/config.mk b/core/config.mk index 94277de78b..cc2b2af12b 100644 --- a/core/config.mk +++ b/core/config.mk @@ -727,6 +727,14 @@ else ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),26),) PRODUCT_FULL_TREBLE := true endif +ifdef PRODUCT_SHIPPING_API_LEVEL + ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),27),) + ifneq ($(TARGET_USES_MKE2FS),true) + $(error When PRODUCT_SHIPPING_API_LEVEL >= 27, TARGET_USES_MKE2FS must be true) + endif + endif +endif + # The default key if not set as LOCAL_CERTIFICATE ifdef PRODUCT_DEFAULT_DEV_CERTIFICATE DEFAULT_SYSTEM_DEV_CERTIFICATE := $(PRODUCT_DEFAULT_DEV_CERTIFICATE) diff --git a/target/product/product_launched_with_o_mr1.mk b/target/product/product_launched_with_o_mr1.mk new file mode 100644 index 0000000000..25620aa14c --- /dev/null +++ b/target/product/product_launched_with_o_mr1.mk @@ -0,0 +1,2 @@ +#PRODUCT_SHIPPING_API_LEVEL indicates the first api level, device has been commercially launced on. +PRODUCT_SHIPPING_API_LEVEL := 27 From e13a588aa6a1bcf2858a3206b1716cafee5e7cbc Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 2 Oct 2017 17:54:01 -0700 Subject: [PATCH 114/123] Add P back to oc-mr1-dev-plus-aosp Specialzing O MR1 shouldn't have removed P from oc-mr1-dev-plus-aosp. Test: none Change-Id: Ida774a3bc6fa7884e328eb70abb6b2cca7c32028 Merged-In: I2d9019af8c4e24e34c743be85d4e0ff224de9d17 --- core/version_defaults.mk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 22eea8de01..a3bbda07d5 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -38,9 +38,9 @@ ifdef INTERNAL_BUILD_ID_MAKEFILE include $(INTERNAL_BUILD_ID_MAKEFILE) endif -DEFAULT_PLATFORM_VERSION := OPM1 -MIN_PLATFORM_VERSION := OPM1 -MAX_PLATFORM_VERSION := OPM1 +DEFAULT_PLATFORM_VERSION := PPR1 +MIN_PLATFORM_VERSION := PPR1 +MAX_PLATFORM_VERSION := PPR1 ALLOWED_VERSIONS := $(call allowed-platform-versions,\ $(MIN_PLATFORM_VERSION),\ @@ -74,11 +74,11 @@ endif # please add that PLATFORM_VERSION as well as clean up obsolete PLATFORM_VERSION's # in the following text file: # cts/tests/tests/os/assets/platform_versions.txt -PLATFORM_VERSION.OPM1 := 8.1.0 +PLATFORM_VERSION.PPR1 := P # 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.OPM1 := REL +PLATFORM_VERSION_CODENAME.PPR1 := P ifndef PLATFORM_VERSION PLATFORM_VERSION := $(PLATFORM_VERSION.$(TARGET_PLATFORM_VERSION)) From 905b2e00f1d14501f3bbb9b63eef2523ddbf018d Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 3 Oct 2017 12:56:09 -0700 Subject: [PATCH 115/123] Ignore zip comments in dump-package-stats Use -q to silence zip comments, which also silences the first line. Bug: 67345114 Test: find vendor -name '*.apk' | xargs build/tools/dump-package-stats Change-Id: Icb319c603de7c29644c58520213940179f67b7e4 --- tools/dump-package-stats | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tools/dump-package-stats b/tools/dump-package-stats index d11e727461..7814368cd4 100755 --- a/tools/dump-package-stats +++ b/tools/dump-package-stats @@ -77,7 +77,7 @@ do then fail "$file doesn't exist or isn't a file" fi - unzip -lv "$file" | awk ' + unzip -lvq "$file" | awk ' BEGIN { total_compressed = 0; total_uncompressed = 0; @@ -88,16 +88,6 @@ do # Make sure the output of unzip -lv looks like something we expect. # NR == "1" { - if ($1 != "Archive:") { - print "'$PROGNAME': ERROR: Unexpected zip listing format" > \ - "/dev/stderr"; - print "'$PROGNAME': ERROR: Line 1 is \"" $0 "\"" > \ - "/dev/stderr"; - failed = 1; - exit 1; - } - } - NR == "2" { if (NF != "8" || $1 != "Length" || $2 != "Method" || From 0a0e5ea5338db8103eec54ae7bdf9b58f8f7a93f Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Tue, 3 Oct 2017 13:05:20 -0700 Subject: [PATCH 116/123] Add Android Go defaults make file Go devices should inherit this file to provide good default settings for providing the best experience on Android Go devices. Bug: 67374015 Test: make and flash Change-Id: I55f22735c70f69309ec77e5c3055e6747546c79a --- target/product/go_defaults.mk | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 target/product/go_defaults.mk diff --git a/target/product/go_defaults.mk b/target/product/go_defaults.mk new file mode 100644 index 0000000000..fbb95677fb --- /dev/null +++ b/target/product/go_defaults.mk @@ -0,0 +1,57 @@ +# +# Copyright (C) 2017 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. +# + +# Sets Android Go recommended default values for propreties. + +# Set lowram options +PRODUCT_PROPERTY_OVERRIDES += \ + ro.config.low_ram=true \ + ro.lmk.critical_upgrade=true \ + ro.lmk.upgrade_pressure=40 + +# set threshold to filter unused apps +PRODUCT_PROPERTY_OVERRIDES += \ + pm.dexopt.downgrade_after_inactive_days=10 + + +# Speed profile services and wifi-service to reduce RAM and storage. +PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := speed-profile + +# Always preopt extracted APKs to prevent extracting out of the APK for gms +# modules. +PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK := true + +# Use a profile based boot image for this device. Note that this is currently a +# generic profile and not Android Go optimized. +PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE := true +PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION := frameworks/base/config/boot-image-profile.txt + +# set the compiler filter for shared apks to quicken. +# Rationale: speed has a lot of dex code expansion, it uses more ram and space +# compared to quicken. Using quicken for shared APKs on Go devices may save RAM. +# Note that this is a trade-off: here we trade clean pages for dirty pages, +# extra cpu and battery. That's because the quicken files will be jit-ed in all +# the processes that load of shared apk and the code cache is not shared. +# Some notable apps that will be affected by this are gms and chrome. +# b/65591595. +PRODUCT_PROPERTY_OVERRIDES += \ + pm.dexopt.shared=quicken + +# Default heap sizes. Allow up to 256m for large heaps to make sure a single app +# doesn't take all of the RAM. +PRODUCT_PROPERTY_OVERRIDES += dalvik.vm.heapgrowthlimit=128m +PRODUCT_PROPERTY_OVERRIDES += dalvik.vm.heapsize=256m + From 4b61a94f70f028092531e5853d127508cf3a1c1f Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 4 Oct 2017 21:00:13 +0900 Subject: [PATCH 117/123] Don't reserve size for bad blocks when checking image size When checking *.img size with the partition size, the build system reserves additional bits for spare bits and spare bad blocks. However, for emmc and ufs, the space bits and blocks are entirely managed by the underlying controller and thus not visible from outside of the controller. In fact the check routine was made for legacy MTD storages where raw flash blocks are directly exposed. This makes the size checking a little bit conservative in modern devices. Builds were failed even though the *.img can actually fit into the partition. To handle this problem, the additional size is no longer reserved when checking *.img size with the partition size. This change also removes following build flags that are meaningful only for devices having MTD storages: BOARD_NAND_PAGE_SIZE BOARD_NAND_SPARE_SIZE Further use of them breaks the build Bug: 35790399 Bug: 66399382 Test: build Merged-In: I954bf261441b53844e75d05788866f1692a2ad43 Change-Id: I954bf261441b53844e75d05788866f1692a2ad43 --- core/Makefile | 8 +++---- core/definitions.mk | 42 ++++------------------------------- target/board/treble_common.mk | 2 -- 3 files changed, 8 insertions(+), 44 deletions(-) diff --git a/core/Makefile b/core/Makefile index 335c068ba8..578f9df122 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1310,12 +1310,12 @@ endif .PHONY: recoveryimage recoveryimage: $(INSTALLED_RECOVERYIMAGE_TARGET) $(RECOVERY_RESOURCE_ZIP) -ifeq ($(BOARD_NAND_PAGE_SIZE),) -BOARD_NAND_PAGE_SIZE := 2048 +ifneq ($(BOARD_NAND_PAGE_SIZE),) +$(error MTD device is no longer supported and thus BOARD_NAND_PAGE_SIZE is deprecated.) endif -ifeq ($(BOARD_NAND_SPARE_SIZE),) -BOARD_NAND_SPARE_SIZE := 64 +ifneq ($(BOARD_NAND_SPARE_SIZE),) +$(error MTD device is no longer supported and thus BOARD_NAND_SPARE_SIZE is deprecated.) endif # ----------------------------------------------------------------- diff --git a/core/definitions.mk b/core/definitions.mk index 101d3d7396..af25d1771d 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2754,39 +2754,16 @@ ifndef get-file-size $(error HOST_OS must define get-file-size) endif -# Convert a partition data size (eg, as reported in /proc/mtd) to the -# size of the image used to flash that partition (which includes a -# spare area for each page). -# $(1): the partition data size -define image-size-from-data-size -$(strip $(eval _isfds_value := $$(shell echo $$$$(($(1) / $(BOARD_NAND_PAGE_SIZE) * \ - ($(BOARD_NAND_PAGE_SIZE)+$(BOARD_NAND_SPARE_SIZE))))))\ -$(if $(filter 0, $(_isfds_value)),$(shell echo $$(($(BOARD_NAND_PAGE_SIZE)+$(BOARD_NAND_SPARE_SIZE)))),$(_isfds_value))\ -$(eval _isfds_value :=)) -endef - # $(1): The file(s) to check (often $@) -# $(2): The maximum total image size, in decimal bytes. -# Make sure to take into account any reserved space needed for the FS. -# -# If $(2) is empty, evaluates to "true" -# -# Reserve bad blocks. Make sure that MAX(1% of partition size, 2 blocks) -# is left over after the image has been flashed. Round the 1% up to the -# next whole flash block size. -define assert-max-file-size +# $(2): The partition size. +define assert-max-image-size $(if $(2), \ size=$$(for i in $(1); do $(call get-file-size,$$i); echo +; done; echo 0); \ total=$$(( $$( echo "$$size" ) )); \ printname=$$(echo -n "$(1)" | tr " " +); \ - img_blocksize=$(call image-size-from-data-size,$(BOARD_FLASH_BLOCK_SIZE)); \ - twoblocks=$$((img_blocksize * 2)); \ - onepct=$$((((($(2) / 100) - 1) / img_blocksize + 1) * img_blocksize)); \ - reserve=$$((twoblocks > onepct ? twoblocks : onepct)); \ - maxsize=$$(($(2) - reserve)); \ - echo "$$printname maxsize=$$maxsize blocksize=$$img_blocksize total=$$total reserve=$$reserve"; \ + maxsize=$(2); \ if [ "$$total" -gt "$$maxsize" ]; then \ - echo "error: $$printname too large ($$total > [$(2) - $$reserve])"; \ + echo "error: $$printname too large ($$total > $$maxsize)"; \ false; \ elif [ "$$total" -gt $$((maxsize - 32768)) ]; then \ echo "WARNING: $$printname approaching size limit ($$total now; limit $$maxsize)"; \ @@ -2796,17 +2773,6 @@ $(if $(2), \ ) endef -# Like assert-max-file-size, but the second argument is a partition -# size, which we'll convert to a max image size before checking it -# against the files. -# -# $(1): The file(s) to check (often $@) -# $(2): The partition size. -define assert-max-image-size -$(if $(2), \ - $(call assert-max-file-size,$(1),$(call image-size-from-data-size,$(2)))) -endef - ########################################################### ## Define device-specific radio files diff --git a/target/board/treble_common.mk b/target/board/treble_common.mk index ec711c256a..253d8ef8c4 100644 --- a/target/board/treble_common.mk +++ b/target/board/treble_common.mk @@ -54,8 +54,6 @@ TARGET_USES_HWC2 := true # Set emulator framebuffer display device buffer count to 3 NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 -# TODO(b/35790399): remove when b/35790399 is fixed. -BOARD_NAND_SPARE_SIZE := 0 BOARD_FLASH_BLOCK_SIZE := 512 # b/64700195: add minimum support for odm.img From bb7ece439ba4d2a2c8b361e893561ab0ddb6f8ac Mon Sep 17 00:00:00 2001 From: Jeff Vander Stoep Date: Thu, 5 Oct 2017 14:50:17 -0700 Subject: [PATCH 118/123] Remove world writable sysfs files Test: build Change-Id: I9d18d31a9a65f785cf4bc69f011990e9f8182228 --- target/board/generic/sepolicy/domain.te | 3 --- target/board/generic/sepolicy/file.te | 1 - target/board/generic/sepolicy/file_contexts | 1 - 3 files changed, 5 deletions(-) delete mode 100644 target/board/generic/sepolicy/file.te diff --git a/target/board/generic/sepolicy/domain.te b/target/board/generic/sepolicy/domain.te index 5d5e4ac36f..3706dbaa09 100644 --- a/target/board/generic/sepolicy/domain.te +++ b/target/board/generic/sepolicy/domain.te @@ -1,6 +1,3 @@ -# For /sys/qemu_trace files in the emulator. -allow domain sysfs_writable:dir search; -allow domain sysfs_writable:file rw_file_perms; allow domain qemu_device:chr_file rw_file_perms; get_prop(domain, qemu_prop) diff --git a/target/board/generic/sepolicy/file.te b/target/board/generic/sepolicy/file.te deleted file mode 100644 index f4ae9e43b3..0000000000 --- a/target/board/generic/sepolicy/file.te +++ /dev/null @@ -1 +0,0 @@ -type sysfs_writable, fs_type, sysfs_type, mlstrustedobject; diff --git a/target/board/generic/sepolicy/file_contexts b/target/board/generic/sepolicy/file_contexts index f550f4db2e..a9b1472040 100644 --- a/target/board/generic/sepolicy/file_contexts +++ b/target/board/generic/sepolicy/file_contexts @@ -15,7 +15,6 @@ /dev/qemu_.* u:object_r:qemu_device:s0 /dev/ttyGF[0-9]* u:object_r:serial_device:s0 /dev/ttyS2 u:object_r:console_device:s0 -/sys/qemu_trace(/.*)? u:object_r:sysfs_writable:s0 /vendor/bin/init\.ranchu-core\.sh u:object_r:goldfish_setup_exec:s0 /vendor/bin/init\.ranchu-net\.sh u:object_r:goldfish_setup_exec:s0 /vendor/bin/qemu-props u:object_r:qemu_props_exec:s0 From 47ac5ac8aa19eb927125f384c7eb5b7a5430530f Mon Sep 17 00:00:00 2001 From: Adam Seaton Date: Fri, 13 Oct 2017 11:15:30 -0700 Subject: [PATCH 119/123] Update Security String to 2017-12-01 For December Security Bug: 67774760 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 996900ba99..420d8b16cd 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -165,7 +165,7 @@ ifndef PLATFORM_SECURITY_PATCH # 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 := 2017-11-05 + PLATFORM_SECURITY_PATCH := 2017-12-01 endif ifndef PLATFORM_BASE_OS From aea0f92ff37ce91f29bd23cbeb5fe65da1f617fc Mon Sep 17 00:00:00 2001 From: Ryan Campbell Date: Mon, 2 Oct 2017 12:29:41 -0700 Subject: [PATCH 120/123] Create product sysprops on vendor partition. Duplicate essential product sysprops for manufacturer, model, brand, name, and device from system on vendor so that mixed builds (vendor.img + GSI system.img) have correct product information in their CTS/VTS reports. Test: make Bug: 64458205 Change-Id: Ib63b37772be493b9e035d9b7e8c5e2cf66f2fa8c --- core/Makefile | 14 ++++++++++++-- tools/vendor_buildinfo.sh | 6 ++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/core/Makefile b/core/Makefile index 7f0e1cd2ca..cc16497a9d 100644 --- a/core/Makefile +++ b/core/Makefile @@ -299,7 +299,12 @@ endif TARGET_AAPT_CHARACTERISTICS="$(TARGET_AAPT_CHARACTERISTICS)" \ bash $(BUILDINFO_SH) >> $@ ifndef property_overrides_split_enabled - $(hide) TARGET_BOOTLOADER_BOARD_NAME="$(TARGET_BOOTLOADER_BOARD_NAME)" \ + $(hide) TARGET_DEVICE="$(TARGET_DEVICE)" \ + PRODUCT_NAME="$(TARGET_PRODUCT)" \ + PRODUCT_BRAND="$(PRODUCT_BRAND)" \ + PRODUCT_MODEL="$(PRODUCT_MODEL)" \ + PRODUCT_MANUFACTURER="$(PRODUCT_MANUFACTURER)" \ + TARGET_BOOTLOADER_BOARD_NAME="$(TARGET_BOOTLOADER_BOARD_NAME)" \ TARGET_BOARD_PLATFORM="$(TARGET_BOARD_PLATFORM)" \ bash $(VENDOR_BUILDINFO_SH) >> $@ endif @@ -359,7 +364,12 @@ $(INSTALLED_VENDOR_BUILD_PROP_TARGET): $(VENDOR_BUILDINFO_SH) $(hide) echo ro.vendor.build.date.utc=`$(DATE_FROM_FILE) +%s`>>$@ $(hide) echo ro.vendor.build.fingerprint="$(BUILD_FINGERPRINT_FROM_FILE)">>$@ ifdef property_overrides_split_enabled - $(hide) TARGET_BOOTLOADER_BOARD_NAME="$(TARGET_BOOTLOADER_BOARD_NAME)" \ + $(hide) TARGET_DEVICE="$(TARGET_DEVICE)" \ + PRODUCT_NAME="$(TARGET_PRODUCT)" \ + PRODUCT_BRAND="$(PRODUCT_BRAND)" \ + PRODUCT_MODEL="$(PRODUCT_MODEL)" \ + PRODUCT_MANUFACTURER="$(PRODUCT_MANUFACTURER)" \ + TARGET_BOOTLOADER_BOARD_NAME="$(TARGET_BOOTLOADER_BOARD_NAME)" \ TARGET_BOARD_PLATFORM="$(TARGET_BOARD_PLATFORM)" \ bash $(VENDOR_BUILDINFO_SH) >> $@ $(hide) echo "#" >> $@; \ diff --git a/tools/vendor_buildinfo.sh b/tools/vendor_buildinfo.sh index 2854fa84da..485ada30a3 100755 --- a/tools/vendor_buildinfo.sh +++ b/tools/vendor_buildinfo.sh @@ -6,4 +6,10 @@ echo "# autogenerated by vendor_buildinfo.sh" echo "ro.product.board=$TARGET_BOOTLOADER_BOARD_NAME" echo "ro.board.platform=$TARGET_BOARD_PLATFORM" +echo "ro.vendor.product.manufacturer=$PRODUCT_MANUFACTURER" +echo "ro.vendor.product.model=$PRODUCT_MODEL" +echo "ro.vendor.product.brand=$PRODUCT_BRAND" +echo "ro.vendor.product.name=$PRODUCT_NAME" +echo "ro.vendor.product.device=$TARGET_DEVICE" + echo "# end build properties" From 726767625879fcedbd984d6a76c6a26aa0254d8a Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Sun, 15 Oct 2017 20:07:19 -0700 Subject: [PATCH 121/123] Split go_defaults into a 512 version and a normal version Added go_defauls_common.mk for settings common to both 512 and other Go devices. Added go_defaults_512 for 512MB RAM devices. Bug: 67374015 Test: make, flash, look at properties Change-Id: I160118e397a2f53d64df4a6d8e77aec3553fa401 --- target/product/go_defaults.mk | 42 +------------------- target/product/go_defaults_512.mk | 21 ++++++++++ target/product/go_defaults_common.mk | 57 ++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 40 deletions(-) create mode 100644 target/product/go_defaults_512.mk create mode 100644 target/product/go_defaults_common.mk diff --git a/target/product/go_defaults.mk b/target/product/go_defaults.mk index fbb95677fb..faa1852b41 100644 --- a/target/product/go_defaults.mk +++ b/target/product/go_defaults.mk @@ -14,44 +14,6 @@ # limitations under the License. # -# Sets Android Go recommended default values for propreties. - -# Set lowram options -PRODUCT_PROPERTY_OVERRIDES += \ - ro.config.low_ram=true \ - ro.lmk.critical_upgrade=true \ - ro.lmk.upgrade_pressure=40 - -# set threshold to filter unused apps -PRODUCT_PROPERTY_OVERRIDES += \ - pm.dexopt.downgrade_after_inactive_days=10 - - -# Speed profile services and wifi-service to reduce RAM and storage. -PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := speed-profile - -# Always preopt extracted APKs to prevent extracting out of the APK for gms -# modules. -PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK := true - -# Use a profile based boot image for this device. Note that this is currently a -# generic profile and not Android Go optimized. -PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE := true -PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION := frameworks/base/config/boot-image-profile.txt - -# set the compiler filter for shared apks to quicken. -# Rationale: speed has a lot of dex code expansion, it uses more ram and space -# compared to quicken. Using quicken for shared APKs on Go devices may save RAM. -# Note that this is a trade-off: here we trade clean pages for dirty pages, -# extra cpu and battery. That's because the quicken files will be jit-ed in all -# the processes that load of shared apk and the code cache is not shared. -# Some notable apps that will be affected by this are gms and chrome. -# b/65591595. -PRODUCT_PROPERTY_OVERRIDES += \ - pm.dexopt.shared=quicken - -# Default heap sizes. Allow up to 256m for large heaps to make sure a single app -# doesn't take all of the RAM. -PRODUCT_PROPERTY_OVERRIDES += dalvik.vm.heapgrowthlimit=128m -PRODUCT_PROPERTY_OVERRIDES += dalvik.vm.heapsize=256m +# Inherit common Android Go defaults. +$(call inherit-product, build/target/product/go_defaults_common.mk) diff --git a/target/product/go_defaults_512.mk b/target/product/go_defaults_512.mk new file mode 100644 index 0000000000..22bfbf0dde --- /dev/null +++ b/target/product/go_defaults_512.mk @@ -0,0 +1,21 @@ +# +# Copyright (C) 2017 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. +# + +# Inherit common Android Go defaults. +$(call inherit-product, build/target/product/go_defaults_common.mk) + +# Insert 512MB specific properties here. + diff --git a/target/product/go_defaults_common.mk b/target/product/go_defaults_common.mk new file mode 100644 index 0000000000..fbb95677fb --- /dev/null +++ b/target/product/go_defaults_common.mk @@ -0,0 +1,57 @@ +# +# Copyright (C) 2017 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. +# + +# Sets Android Go recommended default values for propreties. + +# Set lowram options +PRODUCT_PROPERTY_OVERRIDES += \ + ro.config.low_ram=true \ + ro.lmk.critical_upgrade=true \ + ro.lmk.upgrade_pressure=40 + +# set threshold to filter unused apps +PRODUCT_PROPERTY_OVERRIDES += \ + pm.dexopt.downgrade_after_inactive_days=10 + + +# Speed profile services and wifi-service to reduce RAM and storage. +PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := speed-profile + +# Always preopt extracted APKs to prevent extracting out of the APK for gms +# modules. +PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK := true + +# Use a profile based boot image for this device. Note that this is currently a +# generic profile and not Android Go optimized. +PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE := true +PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION := frameworks/base/config/boot-image-profile.txt + +# set the compiler filter for shared apks to quicken. +# Rationale: speed has a lot of dex code expansion, it uses more ram and space +# compared to quicken. Using quicken for shared APKs on Go devices may save RAM. +# Note that this is a trade-off: here we trade clean pages for dirty pages, +# extra cpu and battery. That's because the quicken files will be jit-ed in all +# the processes that load of shared apk and the code cache is not shared. +# Some notable apps that will be affected by this are gms and chrome. +# b/65591595. +PRODUCT_PROPERTY_OVERRIDES += \ + pm.dexopt.shared=quicken + +# Default heap sizes. Allow up to 256m for large heaps to make sure a single app +# doesn't take all of the RAM. +PRODUCT_PROPERTY_OVERRIDES += dalvik.vm.heapgrowthlimit=128m +PRODUCT_PROPERTY_OVERRIDES += dalvik.vm.heapsize=256m + From 120a1bdad1ed6ca98ff5d76c4a978b3edfaad723 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Sun, 15 Oct 2017 20:21:10 -0700 Subject: [PATCH 122/123] Add some properties to go_defaults_512.mk Add lmkd tuning and madvise random hints. Bug: 67374015 Test: make, flash, look at properties Change-Id: Id5dfcc28ac9ea1b84f761f1b75ace45f12c47918 --- target/product/go_defaults_512.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/target/product/go_defaults_512.mk b/target/product/go_defaults_512.mk index 22bfbf0dde..56ab29b4b2 100644 --- a/target/product/go_defaults_512.mk +++ b/target/product/go_defaults_512.mk @@ -17,5 +17,12 @@ # Inherit common Android Go defaults. $(call inherit-product, build/target/product/go_defaults_common.mk) -# Insert 512MB specific properties here. +# 512MB specific properties. +# lmkd can kill more now. +PRODUCT_PROPERTY_OVERRIDES += \ + ro.lmk.medium=700 \ + +# madvise random in ART to reduce page cache thrashing. +PRODUCT_PROPERTY_OVERRIDES += \ + dalvik.vm.madvise-random=true From a4560bb0cb23210b64f08276d16eaabbc57852d0 Mon Sep 17 00:00:00 2001 From: Badash Date: Wed, 4 Oct 2017 07:45:40 -0700 Subject: [PATCH 123/123] DO NOT MERGE initial add sts to build Bug: 67456333 Change-Id: Ieea499fc22b6dff87dfb19fb8b9446fa449152ea --- core/main.mk | 2 ++ core/tasks/sts.mk | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 core/tasks/sts.mk diff --git a/core/main.mk b/core/main.mk index 651ba98de4..e361b32541 100644 --- a/core/main.mk +++ b/core/main.mk @@ -134,6 +134,8 @@ endif -include cts/build/config.mk # VTS-specific config. -include test/vts/tools/vts-tradefed/build/config.mk +# STS-specific config. +-include test/sts/tools/sts-tradefed/build/config.mk # This allows us to force a clean build - included after the config.mk # environment setup is done, but before we generate any dependencies. This diff --git a/core/tasks/sts.mk b/core/tasks/sts.mk new file mode 100644 index 0000000000..b3c3baa462 --- /dev/null +++ b/core/tasks/sts.mk @@ -0,0 +1,23 @@ +# Copyright (C) 2016 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. + +test_suite_name := sts +test_suite_tradefed := sts-tradefed +test_suite_readme := test/sts/README.md + +include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk + +.PHONY: sts +sts: $(compatibility_zip) +$(call dist-for-goals, sts, $(compatibility_zip))