diff options
37 files changed, 525 insertions, 328 deletions
diff --git a/core/Makefile b/core/Makefile index 7980c3f6f8..e099a72c7e 100644 --- a/core/Makefile +++ b/core/Makefile @@ -688,6 +688,14 @@ else BUILT_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img endif +# $1: boot image target +# returns the kernel used to make the bootimage +define bootimage-to-kernel + $(if $(BOARD_KERNEL_BINARIES),\ + $(PRODUCT_OUT)/$(subst .img,,$(subst boot,kernel,$(notdir $(1)))),\ + $(INSTALLED_KERNEL_TARGET)) +endef + ifdef BOARD_BOOTIMAGE_PARTITION_SIZE BOARD_KERNEL_BOOTIMAGE_PARTITION_SIZE := $(BOARD_BOOTIMAGE_PARTITION_SIZE) endif @@ -700,8 +708,7 @@ endef ifneq ($(strip $(TARGET_NO_KERNEL)),true) INTERNAL_BOOTIMAGE_ARGS := \ - $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \ - --kernel $(INSTALLED_KERNEL_TARGET) + $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) INTERNAL_BOOTIMAGE_ARGS += --ramdisk $(INSTALLED_RAMDISK_TARGET) @@ -754,69 +761,78 @@ $(error TARGET_BOOTIMAGE_USE_EXT2 is not supported anymore) else ifeq (true,$(BOARD_AVB_ENABLE)) # TARGET_BOOTIMAGE_USE_EXT2 != true -$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(AVBTOOL) $(INTERNAL_BOOTIMAGE_FILES) $(BOARD_AVB_BOOT_KEY_PATH) +# $1: boot image target +define build_boot_board_avb_enabled + $(MKBOOTIMG) --kernel $(call bootimage-to-kernel,$(1)) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1) + $(call assert-max-image-size,$(1),$(call get-hash-image-max-size,$(BOARD_BOOTIMAGE_PARTITION_SIZE))) + $(AVBTOOL) add_hash_footer \ + --image $(1) \ + --partition_size $(BOARD_BOOTIMAGE_PARTITION_SIZE) \ + --partition_name boot $(INTERNAL_AVB_BOOT_SIGNING_ARGS) \ + $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS) +endef + +$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(AVBTOOL) $(INTERNAL_BOOTIMAGE_FILES) $(BOARD_AVB_BOOT_KEY_PATH) $(call bootimage-to-kernel,$@) $(call pretty,"Target boot image: $@") - $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ - $(hide) $(call assert-max-image-size,$@,$(call get-hash-image-max-size,$(BOARD_BOOTIMAGE_PARTITION_SIZE))) - $(hide) $(AVBTOOL) add_hash_footer \ - --image $@ \ - --partition_size $(BOARD_BOOTIMAGE_PARTITION_SIZE) \ - --partition_name boot $(INTERNAL_AVB_BOOT_SIGNING_ARGS) \ - $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS) + $(call build_boot_board_avb_enabled,$@) .PHONY: bootimage-nodeps bootimage-nodeps: $(MKBOOTIMG) $(AVBTOOL) $(BOARD_AVB_BOOT_KEY_PATH) @echo "make $@: ignoring dependencies" - $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_BOOTIMAGE_TARGET) - $(hide) $(call assert-max-image-size,$(INSTALLED_BOOTIMAGE_TARGET),$(call get-hash-image-max-size,$(BOARD_BOOTIMAGE_PARTITION_SIZE))) - $(hide) $(AVBTOOL) add_hash_footer \ - --image $(INSTALLED_BOOTIMAGE_TARGET) \ - --partition_size $(BOARD_BOOTIMAGE_PARTITION_SIZE) \ - --partition_name boot $(INTERNAL_AVB_BOOT_SIGNING_ARGS) \ - $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS) + $(foreach b,$(INSTALLED_BOOTIMAGE_TARGET),$(call build_boot_board_avb_enabled,$(b))) else ifeq (true,$(PRODUCT_SUPPORTS_BOOT_SIGNER)) # BOARD_AVB_ENABLE != true -$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(BOOT_SIGNER) +# $1: boot image target +define build_boot_supports_boot_signer + $(MKBOOTIMG) --kernel $(call bootimage-to-kernel,$(1)) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1) + $(BOOT_SIGNER) /boot $@ $(PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCT_VERITY_SIGNING_KEY).x509.pem $(1) + $(call assert-max-image-size,$(1),$(BOARD_BOOTIMAGE_PARTITION_SIZE)) +endef + +$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(BOOT_SIGNER) $(call bootimage-to-kernel,$@) $(call pretty,"Target boot image: $@") - $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ - $(BOOT_SIGNER) /boot $@ $(PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCT_VERITY_SIGNING_KEY).x509.pem $@ - $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE)) + $(call build_boot_supports_boot_signer,$@) .PHONY: bootimage-nodeps bootimage-nodeps: $(MKBOOTIMG) $(BOOT_SIGNER) @echo "make $@: ignoring dependencies" - $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_BOOTIMAGE_TARGET) - $(BOOT_SIGNER) /boot $(INSTALLED_BOOTIMAGE_TARGET) $(PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCT_VERITY_SIGNING_KEY).x509.pem $(INSTALLED_BOOTIMAGE_TARGET) - $(hide) $(call assert-max-image-size,$(INSTALLED_BOOTIMAGE_TARGET),$(BOARD_BOOTIMAGE_PARTITION_SIZE)) + $(foreach b,$(INSTALLED_BOOTIMAGE_TARGET),$(call build_boot_supports_boot_signer,$(b))) else ifeq (true,$(PRODUCT_SUPPORTS_VBOOT)) # PRODUCT_SUPPORTS_BOOT_SIGNER != true -$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(VBOOT_SIGNER) $(FUTILITY) +# $1: boot image target +define build_boot_supports_vboot + $(MKBOOTIMG) --kernel $(call bootimage-to-kernel,$(1)) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1).unsigned + $(VBOOT_SIGNER) $(FUTILITY) $(1).unsigned $(PRODUCT_VBOOT_SIGNING_KEY).vbpubk $(PRODUCT_VBOOT_SIGNING_KEY).vbprivk $(PRODUCT_VBOOT_SIGNING_SUBKEY).vbprivk $(1).keyblock $(1) + $(call assert-max-image-size,$(1),$(BOARD_BOOTIMAGE_PARTITION_SIZE)) +endef + +$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(VBOOT_SIGNER) $(FUTILITY) $(call bootimage-to-kernel,$@) $(call pretty,"Target boot image: $@") - $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@.unsigned - $(VBOOT_SIGNER) $(FUTILITY) $@.unsigned $(PRODUCT_VBOOT_SIGNING_KEY).vbpubk $(PRODUCT_VBOOT_SIGNING_KEY).vbprivk $(PRODUCT_VBOOT_SIGNING_SUBKEY).vbprivk $@.keyblock $@ - $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE)) + $(call build_boot_supports_vboot,$@) .PHONY: bootimage-nodeps bootimage-nodeps: $(MKBOOTIMG) $(VBOOT_SIGNER) $(FUTILITY) @echo "make $@: ignoring dependencies" - $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_BOOTIMAGE_TARGET).unsigned - $(VBOOT_SIGNER) $(FUTILITY) $(INSTALLED_BOOTIMAGE_TARGET).unsigned $(PRODUCT_VBOOT_SIGNING_KEY).vbpubk $(PRODUCT_VBOOT_SIGNING_KEY).vbprivk $(PRODUCT_VBOOT_SIGNING_SUBKEY).vbprivk $(INSTALLED_BOOTIMAGE_TARGET).keyblock $(INSTALLED_BOOTIMAGE_TARGET) - $(hide) $(call assert-max-image-size,$(INSTALLED_BOOTIMAGE_TARGET),$(BOARD_BOOTIMAGE_PARTITION_SIZE)) + $(foreach b,$(INSTALLED_BOOTIMAGE_TARGET),$(call build_boot_supports_vboot,$(b))) else # PRODUCT_SUPPORTS_VBOOT != true -$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) +# $1: boot image target +define build_boot_novboot + $(MKBOOTIMG) --kernel $(call bootimage-to-kernel,$(1)) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1) + $(call assert-max-image-size,$1,$(BOARD_BOOTIMAGE_PARTITION_SIZE)) +endef + +$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(call bootimage-to-kernel,$@) $(call pretty,"Target boot image: $@") - $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ - $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE)) + $(call build_boot_novboot,$@) .PHONY: bootimage-nodeps bootimage-nodeps: $(MKBOOTIMG) @echo "make $@: ignoring dependencies" - $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_BOOTIMAGE_TARGET) - $(hide) $(call assert-max-image-size,$(INSTALLED_BOOTIMAGE_TARGET),$(BOARD_BOOTIMAGE_PARTITION_SIZE)) + $(foreach b,$(INSTALLED_BOOTIMAGE_TARGET),$(call build_boot_novboot,$(b))) endif # TARGET_BOOTIMAGE_USE_EXT2 endif # BUILDING_BOOT_IMAGE @@ -1582,7 +1598,9 @@ recovery_sepolicy := \ # SELinux files IGNORE_RECOVERY_SEPOLICY := $(patsubst $(TARGET_RECOVERY_OUT)/%,--exclude=/%,$(recovery_sepolicy)) -recovery_kernel := $(INSTALLED_KERNEL_TARGET) # same as a non-recovery system +# if building multiple boot images from multiple kernels, use the first kernel listed +# for the recovery image +recovery_kernel := $(firstword $(INSTALLED_KERNEL_TARGET)) recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img recovery_resources_common := bootable/recovery/res @@ -1951,7 +1969,7 @@ endif .PHONY: recoveryimage-nodeps recoveryimage-nodeps: @echo "make $@: ignoring dependencies" - $(call build-recoveryimage-target, $(INSTALLED_RECOVERYIMAGE_TARGET)) + $(call build-recoveryimage-target, $(INSTALLED_RECOVERYIMAGE_TARGET), $(recovery_kernel)) else # BUILDING_RECOVERY_IMAGE RECOVERY_RESOURCE_ZIP := @@ -2407,11 +2425,11 @@ RECOVERY_FROM_BOOT_PATCH := $(intermediates)/recovery_from_boot.p $(RECOVERY_FROM_BOOT_PATCH): PRIVATE_DIFF_TOOL := $(diff_tool) $(RECOVERY_FROM_BOOT_PATCH): \ $(INSTALLED_RECOVERYIMAGE_TARGET) \ - $(INSTALLED_BOOTIMAGE_TARGET) \ + $(firstword $(INSTALLED_BOOTIMAGE_TARGET)) \ $(diff_tool) @echo "Construct recovery from boot" mkdir -p $(dir $@) - $(PRIVATE_DIFF_TOOL) $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_RECOVERYIMAGE_TARGET) $@ + $(PRIVATE_DIFF_TOOL) $(firstword $(INSTALLED_BOOTIMAGE_TARGET)) $(INSTALLED_RECOVERYIMAGE_TARGET) $@ else # $(BOARD_USES_FULL_RECOVERY_IMAGE) == true RECOVERY_FROM_BOOT_PATCH := $(INSTALLED_RECOVERYIMAGE_TARGET) endif # BOARD_USES_FULL_RECOVERY_IMAGE @@ -4355,7 +4373,11 @@ ifneq (,$(INSTALLED_RECOVERYIMAGE_TARGET)$(filter true,$(BOARD_USES_RECOVERY_AS_ $(hide) $(call package_files-copy-root, \ $(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/$(PRIVATE_RECOVERY_OUT)/RAMDISK) ifdef INSTALLED_KERNEL_TARGET +ifneq (,$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT))) cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/ +else # BOARD_USES_RECOVERY_AS_BOOT not true + cp $(firstword $(INSTALLED_KERNEL_TARGET)) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/kernel +endif endif ifeq (truetrue,$(strip $(BUILDING_VENDOR_BOOT_IMAGE))$(strip $(AB_OTA_UPDATER))) echo "$(GENERIC_KERNEL_CMDLINE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/cmdline @@ -4399,7 +4421,7 @@ ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) $(TARGET_RAMDISK_OUT),$(zip_root)/BOOT/RAMDISK) endif ifdef INSTALLED_KERNEL_TARGET - $(hide) cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/BOOT/kernel + $(hide) cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/BOOT/ endif ifndef INSTALLED_VENDOR_BOOTIMAGE_TARGET ifdef INSTALLED_2NDBOOTLOADER_TARGET diff --git a/core/board_config.mk b/core/board_config.mk index b7d0178c0e..12b26c666a 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -289,7 +289,7 @@ endif ########################################### # Now we can substitute with the real value of TARGET_COPY_OUT_DEBUG_RAMDISK -ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) +ifneq (,$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT) $(BOARD_GKI_NONAB_COMPAT))) TARGET_COPY_OUT_DEBUG_RAMDISK := debug_ramdisk/first_stage_ramdisk TARGET_COPY_OUT_VENDOR_DEBUG_RAMDISK := vendor_debug_ramdisk/first_stage_ramdisk TARGET_COPY_OUT_TEST_HARNESS_RAMDISK := test_harness_ramdisk/first_stage_ramdisk diff --git a/core/build-system.html b/core/build-system.html index 9cd7b0bc7e..b872909c07 100644 --- a/core/build-system.html +++ b/core/build-system.html @@ -440,6 +440,33 @@ $(GEN): $(intermediates)/<font color=red>%.lut.h</font> : $(LOCAL_PATH)/<font co LOCAL_GENERATED_SOURCES += $(GEN) </pre> +<h3><a name="unbundled-build"/>Unbundled build</h3> +<p>Unbundled build has several meanings by the context. +Let me explain the meaning by the flags related to "unbundled build"</p> +<h4>TARGET_BUILD_UNBUNDLED</h4> +<p>The source tree might not have the full platform sources. It is always set if +<code>TARGET_BUILD_APPS</code> or <code>TARGET_BUILD_UNBUNDLED_IMAGE</code> is set.</p> +<h4>TARGET_BUILD_USE_PREBUILT_SDKS</h4> +<p>It is an internal flag. If it is set, prebuilt SDKs are used, even if a module's +<code>LOCAL_SDK_VERSION</code> is <code>current</code> (including <code>system_current</code>, +<code>core_current</code>, and so on). If it is unset, build current SDKs, +and use them as usual.</p> +<h4>DISABLE_PREOPT</h4> +<p>It is an internal flag as well. If it is set, dexpreopt is disabled. +It is always set if <code>TARGET_BUILD_APPS</code> or <code>TARGET_BUILD_UNBUNDLED_IMAGE</code> is set, +because dexpreopt tightly depends on the platform.</p> +<h4>TARGET_BUILD_APPS</h4> +<p>Build the apps that can be distributed outside the platform, so it turns on +<code>TARGET_BUILD_UNBUNDLED</code> and <code>DISABLE_PREOPT</code>. +Also, it turns on <code>TARGET_BUILD_USE_PREBUILT_SDKS</code>, unless +<code>UNBUNDLED_BUILD_SDKS_FROM_SOURCE</code> is set.</p> +<h4>TARGET_BUILD_UNBUNDLED_IMAGE</h4> +<p>It is similar to <code>TARGET_BUILD_APPS</code>, but its target is an unbundled partition +(such as the vendor partition). Accordingly, it sets <code>TARGET_BUILD_UNBUNDLED</code> and <code>DISABLE_PREOPT</code>. +We can call the partition unbundled, because the partition can be distributed outside the platform. +And also, it turns on <code>TARGET_BUILD_USE_PREBUILT_SDKS</code>, unless +<code>UNBUNDLED_BUILD_SDKS_FROM_SOURCE</code> is set.</p> + <h3><a name="platform-specific"/>Platform specific conditionals</h3> <p>Sometimes you need to set flags specifically for different platforms. Here is a list of which values the different build-system defined variables will be diff --git a/core/main.mk b/core/main.mk index 897483a2e2..bf07b496ca 100644 --- a/core/main.mk +++ b/core/main.mk @@ -697,10 +697,23 @@ $(call select-bitness-of-target-host-required-modules,TARGET,HOST) $(call select-bitness-of-target-host-required-modules,HOST,TARGET) _nonexistent_required := $(sort $(_nonexistent_required)) +check_missing_required_modules := true +ifneq (,$(filter true,$(ALLOW_MISSING_DEPENDENCIES) $(BUILD_BROKEN_MISSING_REQUIRED_MODULES))) + check_missing_required_modules := +endif # ALLOW_MISSING_DEPENDENCIES == true || BUILD_BROKEN_MISSING_REQUIRED_MODULES == true + +# Some executables are skipped in ASAN SANITIZE_TARGET build, thus breaking their dependencies. +ifneq (,$(filter address,$(SANITIZE_TARGET))) + check_missing_required_modules := +endif # SANITIZE_TARGET has ASAN + # HOST OS darwin build is broken, disable this check for darwin for now. -# TODO(b/162102724): Remove this -ifeq (,$(filter $(HOST_OS),darwin)) -ifeq (,$(filter true,$(ALLOW_MISSING_DEPENDENCIES) $(BUILD_BROKEN_MISSING_REQUIRED_MODULES))) +# TODO(b/162102724): Remove this when darwin host has no broken dependency. +ifneq (,$(filter $(HOST_OS),darwin)) + check_missing_required_modules := +endif # HOST_OS == darwin + +ifeq (true,$(check_missing_required_modules)) ifneq (,$(_nonexistent_required)) $(warning Missing required dependencies:) $(foreach r_i,$(_nonexistent_required), \ @@ -710,8 +723,7 @@ ifneq (,$(_nonexistent_required)) $(warning Set BUILD_BROKEN_MISSING_REQUIRED_MODULES := true to bypass this check if this is intentional) $(error Build failed) endif # _nonexistent_required != empty -endif # ALLOW_MISSING_DEPENDENCIES != true && BUILD_BROKEN_MISSING_REQUIRED_MODULES != true -endif # HOST_OS != darwin +endif # check_missing_required_modules == true define add-required-deps $(1): | $(2) diff --git a/core/rbe.mk b/core/rbe.mk index f4f7f5e920..5e55cfba87 100644 --- a/core/rbe.mk +++ b/core/rbe.mk @@ -19,7 +19,7 @@ ifneq ($(filter-out false,$(USE_RBE)),) ifdef RBE_DIR rbe_dir := $(RBE_DIR) else - rbe_dir := $(HOME)/rbe + rbe_dir := prebuilts/remoteexecution-client/live/ endif ifdef RBE_CXX_EXEC_STRATEGY @@ -37,19 +37,19 @@ ifneq ($(filter-out false,$(USE_RBE)),) ifdef RBE_JAVAC_EXEC_STRATEGY javac_exec_strategy := $(RBE_JAVAC_EXEC_STRATEGY) else - javac_exec_strategy := local + javac_exec_strategy := remote_local_fallback endif ifdef RBE_R8_EXEC_STRATEGY r8_exec_strategy := $(RBE_R8_EXEC_STRATEGY) else - r8_exec_strategy := local + r8_exec_strategy := remote_local_fallback endif ifdef RBE_D8_EXEC_STRATEGY d8_exec_strategy := $(RBE_D8_EXEC_STRATEGY) else - d8_exec_strategy := local + d8_exec_strategy := remote_local_fallback endif platform := container-image=docker://gcr.io/androidbuild-re-dockerimage/android-build-remoteexec-image@sha256:582efb38f0c229ea39952fff9e132ccbe183e14869b39888010dacf56b360d62 diff --git a/core/sysprop.mk b/core/sysprop.mk index d01255faef..73dbec792a 100644 --- a/core/sysprop.mk +++ b/core/sysprop.mk @@ -300,7 +300,8 @@ _prop_vars_ += \ ifndef property_overrides_split_enabled _prop_vars_ += \ - ADDITIONAL_VENDOR_PROPERTIES + ADDITIONAL_VENDOR_PROPERTIES \ + PRODUCT_VENDOR_PROPERTIES endif _blacklist_names_ := \ diff --git a/rbesetup.sh b/rbesetup.sh index f9317a324f..adcf081313 100644 --- a/rbesetup.sh +++ b/rbesetup.sh @@ -33,4 +33,15 @@ function _export_metrics_uploader() { fi } +# This function sets RBE specific environment variables needed for the build to +# executed by RBE. This file should be sourced once per checkout of Android code. +function _set_rbe_vars() { + export USE_RBE="true" + export RBE_CXX_EXEC_STRATEGY="remote_local_fallback" + export RBE_JAVAC=1 + export RBE_R8=1 + export RBE_D8=1 +} + _export_metrics_uploader +_set_rbe_vars diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index 22108fab7f..f0210271d5 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -59,19 +59,26 @@ TARGET_NO_VENDOR_BOOT := true BOARD_USES_RECOVERY_AS_BOOT := true BOARD_KERNEL-5.4_BOOTIMAGE_PARTITION_SIZE := 67108864 +BOARD_KERNEL-5.4-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 67108864 BOARD_KERNEL-5.4-GZ_BOOTIMAGE_PARTITION_SIZE := 47185920 +BOARD_KERNEL-5.4-GZ-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 47185920 BOARD_KERNEL-5.4-LZ4_BOOTIMAGE_PARTITION_SIZE := 53477376 +BOARD_KERNEL-5.4-LZ4-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 53477376 BOARD_KERNEL-MAINLINE_BOOTIMAGE_PARTITION_SIZE := 67108864 BOARD_KERNEL-MAINLINE-GZ_BOOTIMAGE_PARTITION_SIZE := 47185920 BOARD_KERNEL-MAINLINE-LZ4_BOOTIMAGE_PARTITION_SIZE := 53477376 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 +BOARD_RAMDISK_USE_LZ4 := true BOARD_BOOT_HEADER_VERSION := 3 BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION) BOARD_KERNEL_BINARIES := kernel-5.4 kernel-5.4-gz kernel-5.4-lz4 \ kernel-mainline kernel-mainline-gz kernel-mainline-lz4 +ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) +BOARD_KERNEL_BINARIES += kernel-5.4-allsyms kernel-5.4-gz-allsyms kernel-5.4-lz4-allsyms +endif # Some vendors still haven't cleaned up all device specific directories under # root! diff --git a/target/board/generic_arm64/device.mk b/target/board/generic_arm64/device.mk index d8d06cd30a..dfa146ac3b 100644 --- a/target/board/generic_arm64/device.mk +++ b/target/board/generic_arm64/device.mk @@ -21,3 +21,10 @@ PRODUCT_COPY_FILES += \ kernel/prebuilts/mainline/arm64/kernel-mainline:kernel-mainline \ kernel/prebuilts/mainline/arm64/kernel-mainline-gz:kernel-mainline-gz \ kernel/prebuilts/mainline/arm64/kernel-mainline-lz4:kernel-mainline-lz4 + +ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) +PRODUCT_COPY_FILES += \ + device/google/cuttlefish_kernel/5.4-arm64/kernel-5.4:kernel-5.4-allsyms \ + device/google/cuttlefish_kernel/5.4-arm64/kernel-5.4-gz:kernel-5.4-gz-allsyms \ + device/google/cuttlefish_kernel/5.4-arm64/kernel-5.4-lz4:kernel-5.4-lz4-allsyms +endif diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk index 3949737d16..8c069ba36c 100644 --- a/target/product/AndroidProducts.mk +++ b/target/product/AndroidProducts.mk @@ -55,12 +55,16 @@ PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/full.mk \ $(LOCAL_DIR)/full_x86.mk \ $(LOCAL_DIR)/generic.mk \ + $(LOCAL_DIR)/generic_system_arm64.mk \ + $(LOCAL_DIR)/generic_system_x86.mk \ + $(LOCAL_DIR)/generic_system_x86_64.mk \ + $(LOCAL_DIR)/generic_system_x86_arm.mk \ $(LOCAL_DIR)/generic_x86.mk \ $(LOCAL_DIR)/gsi_arm64.mk \ $(LOCAL_DIR)/mainline_system_arm64.mk \ $(LOCAL_DIR)/mainline_system_x86.mk \ - $(LOCAL_DIR)/mainline_system_x86_arm.mk \ $(LOCAL_DIR)/mainline_system_x86_64.mk \ + $(LOCAL_DIR)/mainline_system_x86_arm.mk \ $(LOCAL_DIR)/sdk_arm64.mk \ $(LOCAL_DIR)/sdk.mk \ $(LOCAL_DIR)/sdk_phone_arm64.mk \ diff --git a/target/product/aosp_arm.mk b/target/product/aosp_arm.mk index 0cec14b176..90acc17fee 100644 --- a/target/product/aosp_arm.mk +++ b/target/product/aosp_arm.mk @@ -26,7 +26,7 @@ PRODUCT_USE_DYNAMIC_PARTITIONS := true # # All components inherited here go to system image # -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable mainline checking for excat this product name ifeq (aosp_arm,$(TARGET_PRODUCT)) diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk index 3254ccf061..38f82a2d60 100644 --- a/target/product/aosp_arm64.mk +++ b/target/product/aosp_arm64.mk @@ -30,7 +30,7 @@ # All components inherited here go to system image # $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable mainline checking for excat this product name ifeq (aosp_arm64,$(TARGET_PRODUCT)) diff --git a/target/product/aosp_arm64_ab.mk b/target/product/aosp_arm64_ab.mk index 0b2ae09d45..5510e1b78c 100644 --- a/target/product/aosp_arm64_ab.mk +++ b/target/product/aosp_arm64_ab.mk @@ -29,7 +29,7 @@ # (The system image of Legacy GSI is not CSI) # $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable mainline checking for excat this product name ifeq (aosp_arm64_ab,$(TARGET_PRODUCT)) diff --git a/target/product/aosp_arm_ab.mk b/target/product/aosp_arm_ab.mk index ec2e5d7fce..7e06044050 100644 --- a/target/product/aosp_arm_ab.mk +++ b/target/product/aosp_arm_ab.mk @@ -28,7 +28,7 @@ # All components inherited here go to system image # (The system image of Legacy GSI is not CSI) # -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable mainline checking for excat this product name ifeq (aosp_arm_ab,$(TARGET_PRODUCT)) diff --git a/target/product/aosp_x86.mk b/target/product/aosp_x86.mk index 51b5dafb0f..7db2c0ff0c 100644 --- a/target/product/aosp_x86.mk +++ b/target/product/aosp_x86.mk @@ -26,7 +26,7 @@ PRODUCT_USE_DYNAMIC_PARTITIONS := true # # All components inherited here go to system image # -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable mainline checking for excat this product name ifeq (aosp_x86,$(TARGET_PRODUCT)) diff --git a/target/product/aosp_x86_64.mk b/target/product/aosp_x86_64.mk index 9b26716beb..5d782644dc 100644 --- a/target/product/aosp_x86_64.mk +++ b/target/product/aosp_x86_64.mk @@ -32,7 +32,7 @@ PRODUCT_USE_DYNAMIC_PARTITIONS := true # All components inherited here go to system image # $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable mainline checking for excat this product name ifeq (aosp_x86_64,$(TARGET_PRODUCT)) diff --git a/target/product/aosp_x86_64_ab.mk b/target/product/aosp_x86_64_ab.mk index 578a2548fc..c31545ddf6 100644 --- a/target/product/aosp_x86_64_ab.mk +++ b/target/product/aosp_x86_64_ab.mk @@ -29,7 +29,7 @@ # (The system image of Legacy GSI is not CSI) # $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable mainline checking for excat this product name ifeq (aosp_x86_64_ab,$(TARGET_PRODUCT)) diff --git a/target/product/aosp_x86_ab.mk b/target/product/aosp_x86_ab.mk index 40c1d83250..2f02dd1bc2 100644 --- a/target/product/aosp_x86_ab.mk +++ b/target/product/aosp_x86_ab.mk @@ -29,7 +29,7 @@ # (The system image of Legacy GSI is not CSI) # $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable mainline checking for excat this product name ifeq (aosp_x86_ab,$(TARGET_PRODUCT)) diff --git a/target/product/aosp_x86_arm.mk b/target/product/aosp_x86_arm.mk index deba3d98dd..f96e068b56 100644 --- a/target/product/aosp_x86_arm.mk +++ b/target/product/aosp_x86_arm.mk @@ -19,7 +19,7 @@ PRODUCT_USE_DYNAMIC_PARTITIONS := true # # All components inherited here go to system image # -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable mainline checking ifeq (aosp_x86_arm,$(TARGET_PRODUCT)) diff --git a/target/product/base_vendor.mk b/target/product/base_vendor.mk index b3368d694d..47c4e230bb 100644 --- a/target/product/base_vendor.mk +++ b/target/product/base_vendor.mk @@ -66,11 +66,11 @@ PRODUCT_PACKAGES += \ passwd_vendor \ selinux_policy_nonsystem \ shell_and_utilities_vendor \ - vndservice \ # Base module when shipping api level is less than or equal to 29 PRODUCT_PACKAGES_SHIPPING_API_LEVEL_29 += \ android.hardware.configstore@1.1-service \ + vndservice \ vndservicemanager \ # VINTF data for vendor image diff --git a/target/product/generic_system.mk b/target/product/generic_system.mk new file mode 100644 index 0000000000..bf74c4a908 --- /dev/null +++ b/target/product/generic_system.mk @@ -0,0 +1,156 @@ +# +# Copyright (C) 2018 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# This makefile is the basis of a generic system image for a handheld device. +$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_default.mk) +# Add adb keys to debuggable AOSP builds (if they exist) +$(call inherit-product-if-exists, vendor/google/security/adb/vendor_key.mk) + +# Enable updating of APEXes +$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk) + +# Shared java libs +PRODUCT_PACKAGES += \ + com.android.nfc_extras \ + +# Applications +PRODUCT_PACKAGES += \ + LiveWallpapersPicker \ + PartnerBookmarksProvider \ + PresencePolling \ + RcsService \ + SafetyRegulatoryInfo \ + Stk \ + Tag \ + TimeZoneUpdater \ + +# Binaries +PRODUCT_PACKAGES += llkd + +# OTA support +PRODUCT_PACKAGES += \ + recovery-refresh \ + update_engine \ + update_verifier \ + +# Wrapped net utils for /vendor access. +PRODUCT_PACKAGES += netutils-wrapper-1.0 + +# Charger images +PRODUCT_PACKAGES += charger_res_images + +# system_other support +PRODUCT_PACKAGES += \ + cppreopts.sh \ + otapreopt_script \ + +# Bluetooth libraries +PRODUCT_PACKAGES += \ + audio.a2dp.default \ + audio.hearing_aid.default \ + +# For ringtones that rely on forward lock encryption +PRODUCT_PACKAGES += libfwdlockengine + +# System libraries commonly depended on by things on the system_ext or product partitions. +# These lists will be pruned periodically. +PRODUCT_PACKAGES += \ + android.hardware.biometrics.fingerprint@2.1 \ + android.hardware.radio@1.0 \ + android.hardware.radio@1.1 \ + android.hardware.radio@1.2 \ + android.hardware.radio@1.3 \ + android.hardware.radio@1.4 \ + android.hardware.radio.config@1.0 \ + android.hardware.radio.deprecated@1.0 \ + android.hardware.secure_element@1.0 \ + android.hardware.wifi@1.0 \ + libaudio-resampler \ + libaudiohal \ + libdrm \ + liblogwrap \ + liblz4 \ + libminui \ + libnl \ + libprotobuf-cpp-full \ + +# These libraries are empty and have been combined into libhidlbase, but are still depended +# on by things off /system. +# TODO(b/135686713): remove these +PRODUCT_PACKAGES += \ + libhidltransport \ + libhwbinder \ + +# Camera service uses 'libdepthphoto' for adding dynamic depth +# metadata inside depth jpegs. +PRODUCT_PACKAGES += \ + libdepthphoto \ + +PRODUCT_PACKAGES_DEBUG += \ + avbctl \ + bootctl \ + tinycap \ + tinyhostless \ + tinymix \ + tinypcminfo \ + tinyplay \ + update_engine_client \ + +PRODUCT_HOST_PACKAGES += \ + tinyplay + +# Enable configurable audio policy +PRODUCT_PACKAGES += \ + libaudiopolicyengineconfigurable \ + libpolicy-subsystem + +# Include all zygote init scripts. "ro.zygote" will select one of them. +PRODUCT_COPY_FILES += \ + system/core/rootdir/init.zygote32.rc:system/etc/init/hw/init.zygote32.rc \ + system/core/rootdir/init.zygote64.rc:system/etc/init/hw/init.zygote64.rc \ + system/core/rootdir/init.zygote64_32.rc:system/etc/init/hw/init.zygote64_32.rc \ + +# Enable dynamic partition size +PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true + +PRODUCT_ENFORCE_RRO_TARGETS := * + +# TODO(b/150820813) Settings depends on static overlay, remove this after eliminating the dependency. +PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS := Settings + +PRODUCT_NAME := generic_system +PRODUCT_BRAND := generic + +# Define /system partition-specific product properties to identify that /system +# partition is generic_system. +PRODUCT_SYSTEM_NAME := mainline +PRODUCT_SYSTEM_BRAND := Android +PRODUCT_SYSTEM_MANUFACTURER := Android +PRODUCT_SYSTEM_MODEL := mainline +PRODUCT_SYSTEM_DEVICE := generic + +_base_mk_allowed_list := + +_my_allowed_list := $(_base_mk_allowed_list) + +# For mainline, system.img should be mounted at /, so we include ROOT here. +_my_paths := \ + $(TARGET_COPY_OUT_ROOT)/ \ + $(TARGET_COPY_OUT_SYSTEM)/ \ + +$(call require-artifacts-in-path, $(_my_paths), $(_my_allowed_list)) diff --git a/target/product/generic_system_arm64.mk b/target/product/generic_system_arm64.mk new file mode 100644 index 0000000000..b8b12c3214 --- /dev/null +++ b/target/product/generic_system_arm64.mk @@ -0,0 +1,46 @@ +# +# Copyright (C) 2018 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# All components inherited here go to system image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) +$(call enforce-product-packages-exist,) + +# Enable mainline checking +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true + +PRODUCT_BUILD_CACHE_IMAGE := false +PRODUCT_BUILD_ODM_IMAGE := false +PRODUCT_BUILD_VENDOR_DLKM_IMAGE := false +PRODUCT_BUILD_ODM_DLKM_IMAGE := false +PRODUCT_BUILD_PRODUCT_IMAGE := false +PRODUCT_BUILD_RAMDISK_IMAGE := false +PRODUCT_BUILD_SYSTEM_IMAGE := true +PRODUCT_BUILD_SYSTEM_EXT_IMAGE := false +PRODUCT_BUILD_SYSTEM_OTHER_IMAGE := false +PRODUCT_BUILD_USERDATA_IMAGE := false +PRODUCT_BUILD_VENDOR_IMAGE := false + +PRODUCT_SHIPPING_API_LEVEL := 29 + +# TODO(b/137033385): change this back to "all" +PRODUCT_RESTRICT_VENDOR_FILES := owner + +PRODUCT_NAME := generic_system_arm64 +PRODUCT_DEVICE := mainline_arm64 +PRODUCT_BRAND := generic diff --git a/target/product/generic_system_x86.mk b/target/product/generic_system_x86.mk new file mode 100644 index 0000000000..dddcb7e2ed --- /dev/null +++ b/target/product/generic_system_x86.mk @@ -0,0 +1,45 @@ +# +# Copyright (C) 2019 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# All components inherited here go to system image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) +$(call enforce-product-packages-exist,) + +# Enable mainline checking +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true + +PRODUCT_BUILD_CACHE_IMAGE := false +PRODUCT_BUILD_ODM_IMAGE := false +PRODUCT_BUILD_VENDOR_DLKM_IMAGE := false +PRODUCT_BUILD_ODM_DLKM_IMAGE := false +PRODUCT_BUILD_PRODUCT_IMAGE := false +PRODUCT_BUILD_RAMDISK_IMAGE := false +PRODUCT_BUILD_SYSTEM_IMAGE := true +PRODUCT_BUILD_SYSTEM_EXT_IMAGE := false +PRODUCT_BUILD_SYSTEM_OTHER_IMAGE := false +PRODUCT_BUILD_USERDATA_IMAGE := false +PRODUCT_BUILD_VENDOR_IMAGE := false + +PRODUCT_SHIPPING_API_LEVEL := 29 + +# TODO(b/137033385): change this back to "all" +PRODUCT_RESTRICT_VENDOR_FILES := owner + +PRODUCT_NAME := generic_system_x86 +PRODUCT_DEVICE := mainline_x86 +PRODUCT_BRAND := generic diff --git a/target/product/generic_system_x86_64.mk b/target/product/generic_system_x86_64.mk new file mode 100644 index 0000000000..1ca967835a --- /dev/null +++ b/target/product/generic_system_x86_64.mk @@ -0,0 +1,45 @@ +# +# Copyright (C) 2019 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# All components inherited here go to system image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) +$(call enforce-product-packages-exist,) + +# Enable mainline checking +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true + +PRODUCT_BUILD_CACHE_IMAGE := false +PRODUCT_BUILD_ODM_IMAGE := false +PRODUCT_BUILD_VENDOR_DLKM_IMAGE := false +PRODUCT_BUILD_ODM_DLKM_IMAGE := false +PRODUCT_BUILD_PRODUCT_IMAGE := false +PRODUCT_BUILD_RAMDISK_IMAGE := false +PRODUCT_BUILD_SYSTEM_IMAGE := true +PRODUCT_BUILD_SYSTEM_EXT_IMAGE := false +PRODUCT_BUILD_SYSTEM_OTHER_IMAGE := false +PRODUCT_BUILD_USERDATA_IMAGE := false +PRODUCT_BUILD_VENDOR_IMAGE := false + +PRODUCT_SHIPPING_API_LEVEL := 29 + +PRODUCT_RESTRICT_VENDOR_FILES := all + +PRODUCT_NAME := generic_system_x86_64 +PRODUCT_DEVICE := mainline_x86_64 +PRODUCT_BRAND := generic diff --git a/target/product/generic_system_x86_arm.mk b/target/product/generic_system_x86_arm.mk new file mode 100644 index 0000000000..a62fb9b8ad --- /dev/null +++ b/target/product/generic_system_x86_arm.mk @@ -0,0 +1,45 @@ +# +# Copyright (C) 2019 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# All components inherited here go to system image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) +$(call enforce-product-packages-exist,) + +# Enable mainline checking +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true + +PRODUCT_BUILD_CACHE_IMAGE := false +PRODUCT_BUILD_ODM_IMAGE := false +PRODUCT_BUILD_VENDOR_DLKM_IMAGE := false +PRODUCT_BUILD_ODM_DLKM_IMAGE := false +PRODUCT_BUILD_PRODUCT_IMAGE := false +PRODUCT_BUILD_RAMDISK_IMAGE := false +PRODUCT_BUILD_SYSTEM_IMAGE := true +PRODUCT_BUILD_SYSTEM_EXT_IMAGE := false +PRODUCT_BUILD_SYSTEM_OTHER_IMAGE := false +PRODUCT_BUILD_USERDATA_IMAGE := false +PRODUCT_BUILD_VENDOR_IMAGE := false + +PRODUCT_SHIPPING_API_LEVEL := 29 + +# TODO(b/137033385): change this back to "all" +PRODUCT_RESTRICT_VENDOR_FILES := owner + +PRODUCT_NAME := generic_system_x86_arm +PRODUCT_DEVICE := mainline_x86_arm +PRODUCT_BRAND := generic diff --git a/target/product/gsi_arm64.mk b/target/product/gsi_arm64.mk index adf7ca541c..1043a85e03 100644 --- a/target/product/gsi_arm64.mk +++ b/target/product/gsi_arm64.mk @@ -18,7 +18,7 @@ # All components inherited here go to system image # $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable mainline checking PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed diff --git a/target/product/mainline_system.mk b/target/product/mainline_system.mk index e3b3e7d650..0b6eaf02dc 100644..120000 --- a/target/product/mainline_system.mk +++ b/target/product/mainline_system.mk @@ -1,151 +1 @@ -# -# Copyright (C) 2018 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# This makefile is the basis of a generic system image for a handheld device. -$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_default.mk) -# Add adb keys to debuggable AOSP builds (if they exist) -$(call inherit-product-if-exists, vendor/google/security/adb/vendor_key.mk) - -# Enable updating of APEXes -$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk) - -# Shared java libs -PRODUCT_PACKAGES += \ - com.android.nfc_extras \ - -# Applications -PRODUCT_PACKAGES += \ - LiveWallpapersPicker \ - PartnerBookmarksProvider \ - PresencePolling \ - RcsService \ - SafetyRegulatoryInfo \ - Stk \ - Tag \ - TimeZoneUpdater \ - -# Binaries -PRODUCT_PACKAGES += llkd - -# OTA support -PRODUCT_PACKAGES += \ - recovery-refresh \ - update_engine \ - update_verifier \ - -# Wrapped net utils for /vendor access. -PRODUCT_PACKAGES += netutils-wrapper-1.0 - -# Charger images -PRODUCT_PACKAGES += charger_res_images - -# system_other support -PRODUCT_PACKAGES += \ - cppreopts.sh \ - otapreopt_script \ - -# Bluetooth libraries -PRODUCT_PACKAGES += \ - audio.a2dp.default \ - audio.hearing_aid.default \ - -# For ringtones that rely on forward lock encryption -PRODUCT_PACKAGES += libfwdlockengine - -# System libraries commonly depended on by things on the system_ext or product partitions. -# These lists will be pruned periodically. -PRODUCT_PACKAGES += \ - android.hardware.biometrics.fingerprint@2.1 \ - android.hardware.radio@1.0 \ - android.hardware.radio@1.1 \ - android.hardware.radio@1.2 \ - android.hardware.radio@1.3 \ - android.hardware.radio@1.4 \ - android.hardware.radio.config@1.0 \ - android.hardware.radio.deprecated@1.0 \ - android.hardware.secure_element@1.0 \ - android.hardware.wifi@1.0 \ - libaudio-resampler \ - libaudiohal \ - libdrm \ - liblogwrap \ - liblz4 \ - libminui \ - libnl \ - libprotobuf-cpp-full \ - -# These libraries are empty and have been combined into libhidlbase, but are still depended -# on by things off /system. -# TODO(b/135686713): remove these -PRODUCT_PACKAGES += \ - libhidltransport \ - libhwbinder \ - -# Camera service uses 'libdepthphoto' for adding dynamic depth -# metadata inside depth jpegs. -PRODUCT_PACKAGES += \ - libdepthphoto \ - -PRODUCT_PACKAGES_DEBUG += \ - avbctl \ - bootctl \ - tinycap \ - tinyhostless \ - tinymix \ - tinypcminfo \ - tinyplay \ - update_engine_client \ - -PRODUCT_HOST_PACKAGES += \ - tinyplay - -# Include all zygote init scripts. "ro.zygote" will select one of them. -PRODUCT_COPY_FILES += \ - system/core/rootdir/init.zygote32.rc:system/etc/init/hw/init.zygote32.rc \ - system/core/rootdir/init.zygote64.rc:system/etc/init/hw/init.zygote64.rc \ - system/core/rootdir/init.zygote64_32.rc:system/etc/init/hw/init.zygote64_32.rc \ - -# Enable dynamic partition size -PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true - -PRODUCT_ENFORCE_RRO_TARGETS := * - -# TODO(b/150820813) Settings depends on static overlay, remove this after eliminating the dependency. -PRODUCT_ENFORCE_RRO_EXEMPTED_TARGETS := Settings - -PRODUCT_NAME := mainline_system -PRODUCT_BRAND := generic - -# Define /system partition-specific product properties to identify that /system -# partition is mainline_system. -PRODUCT_SYSTEM_NAME := mainline -PRODUCT_SYSTEM_BRAND := Android -PRODUCT_SYSTEM_MANUFACTURER := Android -PRODUCT_SYSTEM_MODEL := mainline -PRODUCT_SYSTEM_DEVICE := generic - -_base_mk_allowed_list := - -_my_allowed_list := $(_base_mk_allowed_list) - -# For mainline, system.img should be mounted at /, so we include ROOT here. -_my_paths := \ - $(TARGET_COPY_OUT_ROOT)/ \ - $(TARGET_COPY_OUT_SYSTEM)/ \ - -$(call require-artifacts-in-path, $(_my_paths), $(_my_allowed_list)) +generic_system.mk
\ No newline at end of file diff --git a/target/product/mainline_system_arm64.mk b/target/product/mainline_system_arm64.mk index a0c3e6ddd4..5fa13ce6c0 100644 --- a/target/product/mainline_system_arm64.mk +++ b/target/product/mainline_system_arm64.mk @@ -14,33 +14,10 @@ # limitations under the License. # -# -# All components inherited here go to system image -# -$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) -$(call enforce-product-packages-exist,) - -# Enable mainline checking -PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true - -PRODUCT_BUILD_CACHE_IMAGE := false -PRODUCT_BUILD_ODM_IMAGE := false -PRODUCT_BUILD_VENDOR_DLKM_IMAGE := false -PRODUCT_BUILD_ODM_DLKM_IMAGE := false -PRODUCT_BUILD_PRODUCT_IMAGE := false -PRODUCT_BUILD_RAMDISK_IMAGE := false -PRODUCT_BUILD_SYSTEM_IMAGE := true -PRODUCT_BUILD_SYSTEM_EXT_IMAGE := false -PRODUCT_BUILD_SYSTEM_OTHER_IMAGE := false -PRODUCT_BUILD_USERDATA_IMAGE := false -PRODUCT_BUILD_VENDOR_IMAGE := false - -PRODUCT_SHIPPING_API_LEVEL := 29 +# Do not modify this file. It's just alias of generic_system_arm64.mk +# Will be removed when renaming from mainline_system to generic_system +# complete -# TODO(b/137033385): change this back to "all" -PRODUCT_RESTRICT_VENDOR_FILES := owner +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system_arm64.mk) PRODUCT_NAME := mainline_system_arm64 -PRODUCT_DEVICE := mainline_arm64 -PRODUCT_BRAND := generic diff --git a/target/product/mainline_system_x86.mk b/target/product/mainline_system_x86.mk index 3c4a867f4a..3fb1963e98 100644 --- a/target/product/mainline_system_x86.mk +++ b/target/product/mainline_system_x86.mk @@ -14,32 +14,10 @@ # limitations under the License. # -# -# All components inherited here go to system image -# -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) -$(call enforce-product-packages-exist,) - -# Enable mainline checking -PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true - -PRODUCT_BUILD_CACHE_IMAGE := false -PRODUCT_BUILD_ODM_IMAGE := false -PRODUCT_BUILD_VENDOR_DLKM_IMAGE := false -PRODUCT_BUILD_ODM_DLKM_IMAGE := false -PRODUCT_BUILD_PRODUCT_IMAGE := false -PRODUCT_BUILD_RAMDISK_IMAGE := false -PRODUCT_BUILD_SYSTEM_IMAGE := true -PRODUCT_BUILD_SYSTEM_EXT_IMAGE := false -PRODUCT_BUILD_SYSTEM_OTHER_IMAGE := false -PRODUCT_BUILD_USERDATA_IMAGE := false -PRODUCT_BUILD_VENDOR_IMAGE := false - -PRODUCT_SHIPPING_API_LEVEL := 29 +# Do not modify this file. It's just alias of generic_system_x86.mk +# Will be removed when renaming from mainline_system to generic_system +# complete -# TODO(b/137033385): change this back to "all" -PRODUCT_RESTRICT_VENDOR_FILES := owner +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system_x86.mk) PRODUCT_NAME := mainline_system_x86 -PRODUCT_DEVICE := mainline_x86 -PRODUCT_BRAND := generic diff --git a/target/product/mainline_system_x86_64.mk b/target/product/mainline_system_x86_64.mk index 410c998302..eab99c55e6 100644 --- a/target/product/mainline_system_x86_64.mk +++ b/target/product/mainline_system_x86_64.mk @@ -14,32 +14,10 @@ # limitations under the License. # -# -# All components inherited here go to system image -# -$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) -$(call enforce-product-packages-exist,) - -# Enable mainline checking -PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true - -PRODUCT_BUILD_CACHE_IMAGE := false -PRODUCT_BUILD_ODM_IMAGE := false -PRODUCT_BUILD_VENDOR_DLKM_IMAGE := false -PRODUCT_BUILD_ODM_DLKM_IMAGE := false -PRODUCT_BUILD_PRODUCT_IMAGE := false -PRODUCT_BUILD_RAMDISK_IMAGE := false -PRODUCT_BUILD_SYSTEM_IMAGE := true -PRODUCT_BUILD_SYSTEM_EXT_IMAGE := false -PRODUCT_BUILD_SYSTEM_OTHER_IMAGE := false -PRODUCT_BUILD_USERDATA_IMAGE := false -PRODUCT_BUILD_VENDOR_IMAGE := false - -PRODUCT_SHIPPING_API_LEVEL := 29 +# Do not modify this file. It's just alias of generic_system_x86_64.mk +# Will be removed when renaming from mainline_system to generic_system +# complete -PRODUCT_RESTRICT_VENDOR_FILES := all +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system_x86_64.mk) PRODUCT_NAME := mainline_system_x86_64 -PRODUCT_DEVICE := mainline_x86_64 -PRODUCT_BRAND := generic diff --git a/target/product/mainline_system_x86_arm.mk b/target/product/mainline_system_x86_arm.mk index 8c6611e8e6..483fb58dac 100644 --- a/target/product/mainline_system_x86_arm.mk +++ b/target/product/mainline_system_x86_arm.mk @@ -14,32 +14,10 @@ # limitations under the License. # -# -# All components inherited here go to system image -# -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) -$(call enforce-product-packages-exist,) - -# Enable mainline checking -PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true - -PRODUCT_BUILD_CACHE_IMAGE := false -PRODUCT_BUILD_ODM_IMAGE := false -PRODUCT_BUILD_VENDOR_DLKM_IMAGE := false -PRODUCT_BUILD_ODM_DLKM_IMAGE := false -PRODUCT_BUILD_PRODUCT_IMAGE := false -PRODUCT_BUILD_RAMDISK_IMAGE := false -PRODUCT_BUILD_SYSTEM_IMAGE := true -PRODUCT_BUILD_SYSTEM_EXT_IMAGE := false -PRODUCT_BUILD_SYSTEM_OTHER_IMAGE := false -PRODUCT_BUILD_USERDATA_IMAGE := false -PRODUCT_BUILD_VENDOR_IMAGE := false - -PRODUCT_SHIPPING_API_LEVEL := 29 +# Do not modify this file. It's just alias of generic_system_x86_arm.mk +# Will be removed when renaming from mainline_system to generic_system +# complete -# TODO(b/137033385): change this back to "all" -PRODUCT_RESTRICT_VENDOR_FILES := owner +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system_x86_arm.mk) PRODUCT_NAME := mainline_system_x86_arm -PRODUCT_DEVICE := mainline_x86_arm -PRODUCT_BRAND := generic diff --git a/target/product/sdk_phone_arm64.mk b/target/product/sdk_phone_arm64.mk index cefa288a90..761de05d4c 100644 --- a/target/product/sdk_phone_arm64.mk +++ b/target/product/sdk_phone_arm64.mk @@ -30,7 +30,7 @@ endif # All components inherited here go to system image # $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # # All components inherited here go to system_ext image diff --git a/target/product/sdk_phone_armv7.mk b/target/product/sdk_phone_armv7.mk index c4c5a38757..5081a87b5f 100644 --- a/target/product/sdk_phone_armv7.mk +++ b/target/product/sdk_phone_armv7.mk @@ -29,7 +29,7 @@ endif # # All components inherited here go to system image # -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # # All components inherited here go to system_ext image diff --git a/target/product/sdk_phone_x86.mk b/target/product/sdk_phone_x86.mk index bcee0663ec..63671dcd31 100644 --- a/target/product/sdk_phone_x86.mk +++ b/target/product/sdk_phone_x86.mk @@ -24,7 +24,7 @@ PRODUCT_USE_DYNAMIC_PARTITIONS := true # # All components inherited here go to system image # -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable mainline checking for exact this product name ifeq (sdk_phone_x86,$(TARGET_PRODUCT)) diff --git a/target/product/sdk_phone_x86_64.mk b/target/product/sdk_phone_x86_64.mk index 82bbee5157..c5a6245aed 100644 --- a/target/product/sdk_phone_x86_64.mk +++ b/target/product/sdk_phone_x86_64.mk @@ -25,7 +25,7 @@ PRODUCT_USE_DYNAMIC_PARTITIONS := true # All components inherited here go to system image # $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable mainline checking for exact this product name ifeq (sdk_phone_x86_64,$(TARGET_PRODUCT)) diff --git a/tools/releasetools/apex_utils.py b/tools/releasetools/apex_utils.py index afebc40f1b..3d24310039 100644 --- a/tools/releasetools/apex_utils.py +++ b/tools/releasetools/apex_utils.py @@ -61,7 +61,14 @@ class ApexApkSigner(object): Returns: The repacked apex file containing the signed apk files. """ - list_cmd = ['deapexer', 'list', self.apex_path] + debugfs_path = os.path.join(OPTIONS.search_path, "bin", "debugfs_static") + if not os.path.exists(debugfs_path): + raise ApexSigningError( + "Couldn't find location of debugfs_static: " + + "Path {} does not exist. ".format(debugfs_path) + + "Make sure bin/debugfs_static can be found in -p <path>") + list_cmd = ['deapexer', '--debugfs_path', + debugfs_path, 'list', self.apex_path] entries_names = common.RunAndCheckOutput(list_cmd).split() apk_entries = [name for name in entries_names if name.endswith('.apk')] @@ -149,7 +156,8 @@ class ApexApkSigner(object): # Add quote to the signing_args as we will pass # --signing_args "--signing_helper_with_files=%path" to apexer if signing_args: - generate_image_cmd.extend(['--signing_args', '"{}"'.format(signing_args)]) + generate_image_cmd.extend( + ['--signing_args', '"{}"'.format(signing_args)]) # optional arguments for apex repacking manifest_json = os.path.join(apex_dir, 'apex_manifest.json') diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 89900d3eea..56785d64c0 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -3176,8 +3176,8 @@ fi 'recovery_sha1': recovery_img.sha1, 'boot_type': boot_type, 'boot_device': boot_device + '$(getprop ro.boot.slot_suffix)', - 'recovery_type': recovery_type + '$(getprop ro.boot.slot_suffix)', - 'recovery_device': recovery_device, + 'recovery_type': recovery_type, + 'recovery_device': recovery_device + '$(getprop ro.boot.slot_suffix)', 'bonus_args': bonus_args} # The install script location moved from /system/etc to /system/bin in the L |