2019-02-26 13:34:03 +01:00
#
# Copyright (C) 2019 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ###############################################################
# This file includes BoardConfig.mk for the device being built,
2020-07-30 23:23:31 +02:00
# and checks the variable defined therein.
2019-02-26 13:34:03 +01:00
# ###############################################################
2020-12-14 16:17:13 +01:00
_board_strip_readonly_list :=
_board_strip_readonly_list += BOARD_BOOTLOADER_IN_UPDATE_PACKAGE
_board_strip_readonly_list += BOARD_EGL_CFG
_board_strip_readonly_list += BOARD_HAVE_BLUETOOTH
_board_strip_readonly_list += BOARD_INSTALLER_CMDLINE
_board_strip_readonly_list += BOARD_KERNEL_CMDLINE
2021-04-04 10:03:10 +02:00
_board_strip_readonly_list += BOARD_BOOT_HEADER_VERSION
2021-01-13 19:45:04 +01:00
_board_strip_readonly_list += BOARD_BOOTCONFIG
2020-12-14 16:17:13 +01:00
_board_strip_readonly_list += BOARD_KERNEL_BASE
_board_strip_readonly_list += BOARD_USES_GENERIC_AUDIO
_board_strip_readonly_list += BOARD_USES_RECOVERY_AS_BOOT
_board_strip_readonly_list += BOARD_VENDOR_USE_AKMD
_board_strip_readonly_list += BOARD_WPA_SUPPLICANT_DRIVER
_board_strip_readonly_list += BOARD_WLAN_DEVICE
_board_strip_readonly_list += TARGET_BOARD_PLATFORM
_board_strip_readonly_list += TARGET_BOARD_PLATFORM_GPU
_board_strip_readonly_list += TARGET_BOOTLOADER_BOARD_NAME
_board_strip_readonly_list += TARGET_FS_CONFIG_GEN
_board_strip_readonly_list += TARGET_NO_BOOTLOADER
_board_strip_readonly_list += TARGET_NO_KERNEL
_board_strip_readonly_list += TARGET_NO_RECOVERY
_board_strip_readonly_list += TARGET_NO_RADIOIMAGE
_board_strip_readonly_list += TARGET_HARDWARE_3D
_board_strip_readonly_list += WITH_DEXPREOPT
# Arch variables
_board_strip_readonly_list += TARGET_ARCH
_board_strip_readonly_list += TARGET_ARCH_VARIANT
_board_strip_readonly_list += TARGET_CPU_ABI
_board_strip_readonly_list += TARGET_CPU_ABI2
_board_strip_readonly_list += TARGET_CPU_VARIANT
_board_strip_readonly_list += TARGET_CPU_VARIANT_RUNTIME
_board_strip_readonly_list += TARGET_2ND_ARCH
_board_strip_readonly_list += TARGET_2ND_ARCH_VARIANT
_board_strip_readonly_list += TARGET_2ND_CPU_ABI
_board_strip_readonly_list += TARGET_2ND_CPU_ABI2
_board_strip_readonly_list += TARGET_2ND_CPU_VARIANT
_board_strip_readonly_list += TARGET_2ND_CPU_VARIANT_RUNTIME
2020-11-27 11:35:17 +01:00
# TARGET_ARCH_SUITE is an alternative arch configuration to TARGET_ARCH (and related variables),
# that can be used for soong-only builds to build for several architectures at once.
# Allowed values currently are "ndk" and "mainline_sdk".
_board_strip_readonly_list += TARGET_ARCH_SUITE
2019-02-26 16:49:25 +01:00
# File system variables
2020-12-14 16:17:13 +01:00
_board_strip_readonly_list += BOARD_FLASH_BLOCK_SIZE
_board_strip_readonly_list += BOARD_BOOTIMAGE_PARTITION_SIZE
2021-11-04 20:01:19 +01:00
_board_strip_readonly_list += BOARD_INIT_BOOT_IMAGE_PARTITION_SIZE
2020-12-14 16:17:13 +01:00
_board_strip_readonly_list += BOARD_RECOVERYIMAGE_PARTITION_SIZE
_board_strip_readonly_list += BOARD_SYSTEMIMAGE_PARTITION_SIZE
_board_strip_readonly_list += BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE
_board_strip_readonly_list += BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE
_board_strip_readonly_list += BOARD_USERDATAIMAGE_PARTITION_SIZE
_board_strip_readonly_list += BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE
_board_strip_readonly_list += BOARD_CACHEIMAGE_PARTITION_SIZE
_board_strip_readonly_list += BOARD_VENDORIMAGE_PARTITION_SIZE
_board_strip_readonly_list += BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
_board_strip_readonly_list += BOARD_PRODUCTIMAGE_PARTITION_SIZE
_board_strip_readonly_list += BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE
_board_strip_readonly_list += BOARD_SYSTEM_EXTIMAGE_PARTITION_SIZE
_board_strip_readonly_list += BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE
_board_strip_readonly_list += BOARD_ODMIMAGE_PARTITION_SIZE
_board_strip_readonly_list += BOARD_ODMIMAGE_FILE_SYSTEM_TYPE
_board_strip_readonly_list += BOARD_VENDOR_DLKMIMAGE_PARTITION_SIZE
_board_strip_readonly_list += BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE
_board_strip_readonly_list += BOARD_ODM_DLKMIMAGE_PARTITION_SIZE
_board_strip_readonly_list += BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE
2022-01-27 08:05:08 +01:00
_board_strip_readonly_list += BOARD_SYSTEM_DLKMIMAGE_PARTITION_SIZE
_board_strip_readonly_list += BOARD_SYSTEM_DLKMIMAGE_FILE_SYSTEM_TYPE
2021-10-04 11:34:11 +02:00
_board_strip_readonly_list += BOARD_PVMFWIMAGE_PARTITION_SIZE
2019-02-26 16:49:25 +01:00
# Logical partitions related variables.
2020-12-14 16:17:13 +01:00
_board_strip_readonly_list += BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE
_board_strip_readonly_list += BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE
_board_strip_readonly_list += BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE
_board_strip_readonly_list += BOARD_VENDOR_DLKMIMAGE_PARTITION_RESERVED_SIZE
_board_strip_readonly_list += BOARD_ODM_DLKMIMAGE_PARTITION_RESERVED_SIZE
2022-01-27 08:05:08 +01:00
_board_strip_readonly_list += BOARD_SYSTEM_DLKMIMAGE_PARTITION_RESERVED_SIZE
2020-12-14 16:17:13 +01:00
_board_strip_readonly_list += BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE
_board_strip_readonly_list += BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE
_board_strip_readonly_list += BOARD_SUPER_PARTITION_SIZE
_board_strip_readonly_list += BOARD_SUPER_PARTITION_GROUPS
2019-02-26 16:49:25 +01:00
2020-08-05 23:30:32 +02:00
# Kernel related variables
2020-12-14 16:17:13 +01:00
_board_strip_readonly_list += BOARD_KERNEL_BINARIES
_board_strip_readonly_list += BOARD_KERNEL_MODULE_INTERFACE_VERSIONS
2020-08-05 23:30:32 +02:00
2020-10-08 20:08:20 +02:00
# Variables related to generic kernel image (GKI) and generic boot image
# - BOARD_USES_GENERIC_KERNEL_IMAGE is the global variable that defines if the
# board uses GKI and generic boot image.
# Update mechanism of the boot image is not enforced by this variable.
2020-10-08 20:54:02 +02:00
# - BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE controls whether the recovery image
# contains a kernel or not.
2020-10-09 23:29:39 +02:00
# - BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT controls whether ramdisk
# recovery resources are built to vendor_boot.
2021-04-04 10:12:25 +02:00
# - BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT controls whether recovery
# resources are built as a standalone recovery ramdisk in vendor_boot.
2020-10-12 21:42:12 +02:00
# - BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT controls whether GSI AVB keys are
# built to vendor_boot.
2020-11-09 20:52:52 +01:00
# - BOARD_COPY_BOOT_IMAGE_TO_TARGET_FILES controls whether boot images in $OUT are added
# to target files package directly.
2020-12-14 16:17:13 +01:00
_board_strip_readonly_list += BOARD_USES_GENERIC_KERNEL_IMAGE
_board_strip_readonly_list += BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE
_board_strip_readonly_list += BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT
2021-04-04 10:12:25 +02:00
_board_strip_readonly_list += BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT
2020-12-14 16:17:13 +01:00
_board_strip_readonly_list += BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT
_board_strip_readonly_list += BOARD_COPY_BOOT_IMAGE_TO_TARGET_FILES
2020-10-08 20:08:20 +02:00
2021-11-04 20:01:19 +01:00
# Prebuilt image variables
_board_strip_readonly_list += BOARD_PREBUILT_INIT_BOOT_IMAGE
2020-12-10 11:42:47 +01:00
# Defines the list of logical vendor ramdisk names to build or include in vendor_boot.
_board_strip_readonly_list += BOARD_VENDOR_RAMDISK_FRAGMENTS
2021-11-30 02:26:03 +01:00
# These are all variables used to build $(INSTALLED_MISC_INFO_TARGET)
# in build/make/core/Makefile. Their values get used in command line
# arguments, so they have to be stripped to make the ninja files stable.
_board_strip_list :=
_board_strip_list += BOARD_DTBOIMG_PARTITION_SIZE
_board_strip_list += BOARD_AVB_DTBO_KEY_PATH
_board_strip_list += BOARD_AVB_DTBO_ALGORITHM
_board_strip_list += BOARD_AVB_DTBO_ROLLBACK_INDEX_LOCATION
_board_strip_list += BOARD_AVB_PVMFW_KEY_PATH
_board_strip_list += BOARD_AVB_PVMFW_ALGORITHM
_board_strip_list += BOARD_AVB_PVMFW_ROLLBACK_INDEX_LOCATION
_board_strip_list += BOARD_PARTIAL_OTA_UPDATE_PARTITIONS_LIST
_board_strip_list += BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX_LOCATION
_board_strip_list += BOARD_AVB_VBMETA_VENDOR_ALGORITHM
_board_strip_list += BOARD_AVB_VBMETA_VENDOR_KEY_PATH
_board_strip_list += BOARD_AVB_VBMETA_VENDOR
_board_strip_list += BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION
_board_strip_list += BOARD_AVB_VBMETA_SYSTEM_ALGORITHM
_board_strip_list += BOARD_AVB_VBMETA_SYSTEM_KEY_PATH
_board_strip_list += BOARD_AVB_VBMETA_SYSTEM
_board_strip_list += BOARD_AVB_RECOVERY_KEY_PATH
_board_strip_list += BOARD_AVB_RECOVERY_ALGORITHM
_board_strip_list += BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION
_board_strip_list += BOARD_AVB_VENDOR_BOOT_KEY_PATH
_board_strip_list += BOARD_AVB_VENDOR_BOOT_ALGORITHM
_board_strip_list += BOARD_AVB_VENDOR_BOOT_ROLLBACK_INDEX_LOCATION
2022-02-24 03:30:15 +01:00
_board_strip_list += BOARD_AVB_VENDOR_KERNEL_BOOT_KEY_PATH
_board_strip_list += BOARD_AVB_VENDOR_KERNEL_BOOT_ALGORITHM
_board_strip_list += BOARD_AVB_VENDOR_KERNEL_BOOT_ROLLBACK_INDEX_LOCATION
2021-11-30 02:26:03 +01:00
_board_strip_list += BOARD_MKBOOTIMG_ARGS
_board_strip_list += BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE
2022-02-24 03:30:15 +01:00
_board_strip_list += BOARD_VENDOR_KERNEL_BOOTIMAGE_PARTITION_SIZE
2021-12-09 19:30:19 +01:00
_board_strip_list += ODM_MANIFEST_SKUS
2021-11-30 02:26:03 +01:00
2019-02-26 16:49:25 +01:00
_build_broken_var_list := \
2022-08-25 16:17:18 +02:00
BUILD_BROKEN_CLANG_PROPERTY \
2022-09-14 21:10:51 +02:00
BUILD_BROKEN_CLANG_ASFLAGS \
BUILD_BROKEN_CLANG_CFLAGS \
2022-06-21 18:00:02 +02:00
BUILD_BROKEN_DEPFILE \
2019-02-26 16:49:25 +01:00
BUILD_BROKEN_DUP_RULES \
2020-07-15 12:35:12 +02:00
BUILD_BROKEN_DUP_SYSPROP \
2020-03-17 10:49:49 +01:00
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES \
2020-10-19 06:31:58 +02:00
BUILD_BROKEN_ENFORCE_SYSPROP_OWNER \
2022-01-31 22:16:06 +01:00
BUILD_BROKEN_INPUT_DIR_MODULES \
2020-07-15 12:35:12 +02:00
BUILD_BROKEN_MISSING_REQUIRED_MODULES \
2020-01-10 01:15:11 +01:00
BUILD_BROKEN_OUTSIDE_INCLUDE_DIRS \
2019-09-17 18:45:09 +02:00
BUILD_BROKEN_PREBUILT_ELF_FILES \
2019-10-17 12:32:59 +02:00
BUILD_BROKEN_TREBLE_SYSPROP_NEVERALLOW \
2019-04-09 18:56:48 +02:00
BUILD_BROKEN_USES_NETWORK \
2021-02-03 10:17:49 +01:00
BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE \
2020-01-10 01:15:11 +01:00
BUILD_BROKEN_VINTF_PRODUCT_COPY_FILES \
2023-07-26 23:33:51 +02:00
BUILD_BROKEN_INCORRECT_PARTITION_IMAGES \
2023-10-19 00:50:26 +02:00
BUILD_BROKEN_GENRULE_SANDBOXING \
2024-01-05 00:21:26 +01:00
BUILD_BROKEN_DONT_CHECK_SYSTEMSDK \
2019-02-26 16:49:25 +01:00
2019-04-17 21:25:09 +02:00
_build_broken_var_list += \
$( foreach m,$( AVAILABLE_BUILD_MODULE_TYPES) \
$( DEFAULT_WARNING_BUILD_MODULE_TYPES) \
$( DEFAULT_ERROR_BUILD_MODULE_TYPES) , \
BUILD_BROKEN_USES_$( m) )
2019-02-26 16:49:25 +01:00
_board_true_false_vars := $( _build_broken_var_list)
2020-01-03 05:08:10 +01:00
_board_strip_readonly_list += $( _build_broken_var_list) \
BUILD_BROKEN_NINJA_USES_ENV_VARS
2019-02-26 16:49:25 +01:00
2019-02-27 15:38:27 +01:00
# Conditional to building on linux, as dex2oat currently does not work on darwin.
i f e q ( $( HOST_OS ) , l i n u x )
2023-11-06 18:55:59 +01:00
WITH_DEXPREOPT ?= true
2019-02-27 15:38:27 +01:00
e n d i f
2019-02-26 14:37:28 +01:00
# ###############################################################
# Broken build defaults
# ###############################################################
2019-04-09 18:56:48 +02:00
$(foreach v,$(_build_broken_var_list),$(eval $(v) : =))
2020-01-03 05:08:10 +01:00
BUILD_BROKEN_NINJA_USES_ENV_VARS :=
2019-02-26 14:37:28 +01:00
2019-02-26 13:34:03 +01:00
# Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)
# or under vendor/*/$(TARGET_DEVICE). Search in both places, but
# make sure only one exists.
# Real boards should always be associated with an OEM vendor.
i f d e f T A R G E T _ D E V I C E _ D I R
ifneq ( $( origin TARGET_DEVICE_DIR) ,command line)
$( error TARGET_DEVICE_DIR may not be set manually)
endif
board_config_mk := $( TARGET_DEVICE_DIR) /BoardConfig.mk
e l s e
board_config_mk := \
$( strip $( sort $( wildcard \
$( SRC_TARGET_DIR) /board/$( TARGET_DEVICE) /BoardConfig.mk \
2023-10-20 20:56:05 +02:00
device/generic/goldfish/board/$( TARGET_DEVICE) /BoardConfig.mk \
device/google/cuttlefish/board/$( TARGET_DEVICE) /BoardConfig.mk \
2019-02-26 13:34:03 +01:00
$( shell test -d device && find -L device -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk' ) \
$( shell test -d vendor && find -L vendor -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk' ) \
) ) )
ifeq ( $( board_config_mk) ,)
$( error No config file found for TARGET_DEVICE $( TARGET_DEVICE) )
endif
ifneq ( $( words $( board_config_mk) ) ,1)
$( error Multiple board config files for TARGET_DEVICE $( TARGET_DEVICE) : $( board_config_mk) )
endif
TARGET_DEVICE_DIR := $( patsubst %/,%,$( dir $( board_config_mk) ) )
.KATI_READONLY := TARGET_DEVICE_DIR
e n d i f
2020-11-27 12:00:38 +01:00
2022-05-02 23:16:04 +02:00
i f n d e f R B C _ P R O D U C T _ C O N F I G
2019-02-26 13:34:03 +01:00
i n c l u d e $( board_config_mk )
2021-10-01 02:14:29 +02:00
e l s e
2021-10-08 02:14:23 +02:00
$( shell mkdir -p $( OUT_DIR) /rbc)
2021-12-01 22:49:12 +01:00
$( call dump-variables-rbc, $( OUT_DIR) /rbc/make_vars_pre_board_config.mk)
2021-10-08 02:14:23 +02:00
2022-03-25 01:32:39 +01:00
$( shell $( OUT_DIR) /mk2rbc \
2021-10-08 02:14:23 +02:00
--mode= write -r --outdir $( OUT_DIR) /rbc \
--boardlauncher= $( OUT_DIR) /rbc/boardlauncher.rbc \
--input_variables= $( OUT_DIR) /rbc/make_vars_pre_board_config.mk \
2022-02-08 00:17:55 +01:00
--makefile_list= $( OUT_DIR) /.module_paths/configuration.list \
2021-10-08 02:14:23 +02:00
$( board_config_mk) )
ifneq ( $( .SHELLSTATUS) ,0)
$( error board configuration converter failed: $( .SHELLSTATUS) )
endif
2021-11-18 02:19:12 +01:00
$( shell build/soong/scripts/update_out $( OUT_DIR) /rbc/rbc_board_config_results.mk \
2023-05-09 23:56:36 +02:00
$( OUT_DIR) /rbcrun --mode= rbc $( OUT_DIR) /rbc/boardlauncher.rbc)
2021-10-08 02:14:23 +02:00
ifneq ( $( .SHELLSTATUS) ,0)
$( error board configuration runner failed: $( .SHELLSTATUS) )
2021-10-01 02:14:29 +02:00
endif
2021-10-08 02:14:23 +02:00
include $( OUT_DIR) /rbc/rbc_board_config_results.mk
2021-10-01 02:14:29 +02:00
e n d i f
2020-11-27 12:00:38 +01:00
i f n e q ( , $( and $ ( TARGET_ARCH ) ,$ ( TARGET_ARCH_SUITE ) ) )
$( error $( board_config_mk) erroneously sets both TARGET_ARCH and TARGET_ARCH_SUITE)
e n d i f
i f e q ( $( TARGET_ARCH ) $( TARGET_ARCH_SUITE ) , )
$( error Target architectures not defined by board config: $( board_config_mk) )
2019-02-26 13:34:03 +01:00
e n d i f
2020-11-27 12:00:38 +01:00
i f e q ( $( TARGET_CPU_ABI ) $( TARGET_ARCH_SUITE ) , )
$( error TARGET_CPU_ABI not defined by board config: $( board_config_mk) )
e n d i f
2019-02-26 13:34:03 +01:00
i f n e q ( $( MALLOC_IMPL ) , )
$( warning *** Unsupported option MALLOC_IMPL defined by board config: $( board_config_mk) .)
$( error Use ` MALLOC_SVELTE := true ` to configure jemalloc for low-memory)
e n d i f
board_config_mk :=
2019-02-26 16:49:25 +01:00
# Clean up and verify BoardConfig variables
$(foreach var,$(_board_strip_readonly_list),$(eval $(var) : = $$( strip $ $ ( $ ( var ) ) ) ))
2021-11-30 02:26:03 +01:00
$(foreach var,$(_board_strip_list),$(eval $(var) : = $$( strip $ $ ( $ ( var ) ) ) ))
2019-02-26 16:49:25 +01:00
$( foreach var ,$ ( _board_true_false_vars ) , \
$( if $( filter-out true false,$( $( var) ) ) , \
$( error Valid values of $( var) are "true" , "false" , and "" . Not " $( $( var) ) " ) ) )
2019-02-26 14:37:28 +01:00
2022-07-25 07:10:19 +02:00
i n c l u d e $( BUILD_SYSTEM ) / b o a r d _ c o n f i g _ w i f i . m k
2024-02-29 12:40:59 +01:00
# Set up soong config for "soong_config_value_variable".
- i n c l u d e v e n d o r / g o o g l e / b u i l d / s o o n g / s o o n g _ c o n f i g _ n a m e s p a c e / c a m e r a . m k
2019-02-26 14:37:28 +01:00
# Default *_CPU_VARIANT_RUNTIME to CPU_VARIANT if unspecified.
TARGET_CPU_VARIANT_RUNTIME := $( or $( TARGET_CPU_VARIANT_RUNTIME) ,$( TARGET_CPU_VARIANT) )
TARGET_2ND_CPU_VARIANT_RUNTIME := $( or $( TARGET_2ND_CPU_VARIANT_RUNTIME) ,$( TARGET_2ND_CPU_VARIANT) )
2020-11-27 12:00:38 +01:00
i f d e f T A R G E T _ A R C H
# The combo makefiles check and set defaults for various CPU configuration
combo_target := TARGET_
combo_2nd_arch_prefix :=
include $( BUILD_SYSTEM) /combo/select.mk
e n d i f
2019-02-28 18:15:57 +01:00
i f d e f T A R G E T _ 2 N D _ A R C H
combo_2nd_arch_prefix := $( TARGET_2ND_ARCH_VAR_PREFIX)
include $( BUILD_SYSTEM) /combo/select.mk
e n d i f
2019-02-26 16:49:25 +01:00
.KATI_READONLY := $( _board_strip_readonly_list)
INTERNAL_KERNEL_CMDLINE := $( BOARD_KERNEL_CMDLINE)
2021-03-11 01:28:49 +01:00
i f n e q ( , $( BOARD_BOOTCONFIG ) )
INTERNAL_KERNEL_CMDLINE += bootconfig
INTERNAL_BOOTCONFIG := $( BOARD_BOOTCONFIG)
e n d i f
2020-11-27 12:00:38 +01:00
2019-02-26 14:37:28 +01:00
i f n e q ( $( filter %64,$ ( TARGET_ARCH ) ) , )
TARGET_IS_64_BIT := true
e n d i f
i f e q ( , $( filter true ,$ ( TARGET_SUPPORTS_ 32_BIT_APPS ) $ ( TARGET_SUPPORTS_ 64_BIT_APPS ) ) )
TARGET_SUPPORTS_32_BIT_APPS := true
e n d i f
2020-07-30 23:23:31 +02:00
# Quick check to warn about likely cryptic errors later in the build.
2019-02-26 14:37:28 +01:00
i f e q ( $( TARGET_IS_ 64_BIT ) , t r u e )
ifeq ( ,$( filter true false,$( TARGET_SUPPORTS_64_BIT_APPS) ) )
2019-05-10 16:29:28 +02:00
$( error Building a 32-bit-app-only product on a 64-bit device. \
2019-02-26 14:37:28 +01:00
If this is intentional, set TARGET_SUPPORTS_64_BIT_APPS := false )
endif
e n d i f
# "ro.product.cpu.abilist32" and "ro.product.cpu.abilist64" are
# comma separated lists of the 32 and 64 bit ABIs (in order of
# preference) that the target supports. If TARGET_CPU_ABI_LIST_{32,64}_BIT
# are defined by the board config, we use them. Else, we construct
# these lists based on whether TARGET_IS_64_BIT is set.
#
# Note that this assumes that the 2ND_CPU_ABI for a 64 bit target
# is always 32 bits. If this isn't the case, these variables should
# be overriden in the board configuration.
Add native bridge abis to corresponding abilists
This uses TARGET_NATIVE_BRIDGE_*_ABI variable to automatically generate
abi lists.
Sample properties for x86+arm:
ro.product.cpu.abilist=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=
Sample properties for x86_64+arm64:
ro.product.cpu.abilist=x86_64,x86,arm64-v8a,armeabi-v7a,armeabi
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=x86_64,arm64-v8a
Bug: http://b/77159578
Bug: http://b/28684022
Test: make cf_x86_64_phone, deploys, check adb shell getprop | grep abi
Change-Id: I42a73f5c627b9d9f44e31cc5ad84238e1050f52a
2019-07-29 16:23:19 +02:00
#
# Similarly, TARGET_NATIVE_BRIDGE_2ND_ABI for a 64 bit target is always
# 32 bits. Note that all CPU_ABIs are preferred over all NATIVE_BRIDGE_ABIs.
_target_native_bridge_abi_list_32_bit :=
_target_native_bridge_abi_list_64_bit :=
2019-02-26 14:37:28 +01:00
i f e q ( , $( TARGET_CPU_ABI_LIST_ 64_BIT ) )
ifeq ( true| true,$( TARGET_IS_64_BIT) | $( TARGET_SUPPORTS_64_BIT_APPS) )
TARGET_CPU_ABI_LIST_64_BIT := $( TARGET_CPU_ABI) $( TARGET_CPU_ABI2)
Add native bridge abis to corresponding abilists
This uses TARGET_NATIVE_BRIDGE_*_ABI variable to automatically generate
abi lists.
Sample properties for x86+arm:
ro.product.cpu.abilist=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=
Sample properties for x86_64+arm64:
ro.product.cpu.abilist=x86_64,x86,arm64-v8a,armeabi-v7a,armeabi
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=x86_64,arm64-v8a
Bug: http://b/77159578
Bug: http://b/28684022
Test: make cf_x86_64_phone, deploys, check adb shell getprop | grep abi
Change-Id: I42a73f5c627b9d9f44e31cc5ad84238e1050f52a
2019-07-29 16:23:19 +02:00
_target_native_bridge_abi_list_64_bit := $( TARGET_NATIVE_BRIDGE_ABI)
2019-02-26 14:37:28 +01:00
endif
e n d i f
2019-05-16 23:09:35 +02:00
# "arm64-v8a-hwasan", the ABI for libraries compiled with HWASAN, is supported
# in all builds with SANITIZE_TARGET=hwaddress.
i f n e q ( $( filter hwaddress ,$ ( SANITIZE_TARGET ) ) , )
ifneq ( $( filter arm64-v8a,$( TARGET_CPU_ABI_LIST_64_BIT) ) ,)
TARGET_CPU_ABI_LIST_64_BIT := arm64-v8a-hwasan $( TARGET_CPU_ABI_LIST_64_BIT)
endif
e n d i f
2019-02-26 14:37:28 +01:00
i f e q ( , $( TARGET_CPU_ABI_LIST_ 32_BIT ) )
ifneq ( true,$( TARGET_IS_64_BIT) )
TARGET_CPU_ABI_LIST_32_BIT := $( TARGET_CPU_ABI) $( TARGET_CPU_ABI2)
Add native bridge abis to corresponding abilists
This uses TARGET_NATIVE_BRIDGE_*_ABI variable to automatically generate
abi lists.
Sample properties for x86+arm:
ro.product.cpu.abilist=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=
Sample properties for x86_64+arm64:
ro.product.cpu.abilist=x86_64,x86,arm64-v8a,armeabi-v7a,armeabi
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=x86_64,arm64-v8a
Bug: http://b/77159578
Bug: http://b/28684022
Test: make cf_x86_64_phone, deploys, check adb shell getprop | grep abi
Change-Id: I42a73f5c627b9d9f44e31cc5ad84238e1050f52a
2019-07-29 16:23:19 +02:00
_target_native_bridge_abi_list_32_bit := $( TARGET_NATIVE_BRIDGE_ABI)
2019-02-26 14:37:28 +01:00
else
ifeq ( true,$( TARGET_SUPPORTS_32_BIT_APPS) )
# For a 64 bit target, assume that the 2ND_CPU_ABI
# is a 32 bit ABI.
TARGET_CPU_ABI_LIST_32_BIT := $( TARGET_2ND_CPU_ABI) $( TARGET_2ND_CPU_ABI2)
Add native bridge abis to corresponding abilists
This uses TARGET_NATIVE_BRIDGE_*_ABI variable to automatically generate
abi lists.
Sample properties for x86+arm:
ro.product.cpu.abilist=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=
Sample properties for x86_64+arm64:
ro.product.cpu.abilist=x86_64,x86,arm64-v8a,armeabi-v7a,armeabi
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=x86_64,arm64-v8a
Bug: http://b/77159578
Bug: http://b/28684022
Test: make cf_x86_64_phone, deploys, check adb shell getprop | grep abi
Change-Id: I42a73f5c627b9d9f44e31cc5ad84238e1050f52a
2019-07-29 16:23:19 +02:00
_target_native_bridge_abi_list_32_bit := $( TARGET_NATIVE_BRIDGE_2ND_ABI)
2019-02-26 14:37:28 +01:00
endif
endif
e n d i f
# "ro.product.cpu.abilist" is a comma separated list of ABIs (in order
# of preference) that the target supports. If a TARGET_CPU_ABI_LIST
# is specified by the board configuration, we use that. If not, we
# build a list out of the TARGET_CPU_ABIs specified by the config.
Add native bridge abis to corresponding abilists
This uses TARGET_NATIVE_BRIDGE_*_ABI variable to automatically generate
abi lists.
Sample properties for x86+arm:
ro.product.cpu.abilist=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=
Sample properties for x86_64+arm64:
ro.product.cpu.abilist=x86_64,x86,arm64-v8a,armeabi-v7a,armeabi
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=x86_64,arm64-v8a
Bug: http://b/77159578
Bug: http://b/28684022
Test: make cf_x86_64_phone, deploys, check adb shell getprop | grep abi
Change-Id: I42a73f5c627b9d9f44e31cc5ad84238e1050f52a
2019-07-29 16:23:19 +02:00
# Add NATIVE_BRIDGE_ABIs at the end to keep order of preference.
2019-02-26 14:37:28 +01:00
i f e q ( , $( TARGET_CPU_ABI_LIST ) )
2020-04-18 00:46:55 +02:00
TARGET_CPU_ABI_LIST := $( TARGET_CPU_ABI_LIST_64_BIT) $( TARGET_CPU_ABI_LIST_32_BIT) \
$( _target_native_bridge_abi_list_64_bit) $( _target_native_bridge_abi_list_32_bit)
2019-02-26 14:37:28 +01:00
e n d i f
Add native bridge abis to corresponding abilists
This uses TARGET_NATIVE_BRIDGE_*_ABI variable to automatically generate
abi lists.
Sample properties for x86+arm:
ro.product.cpu.abilist=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=
Sample properties for x86_64+arm64:
ro.product.cpu.abilist=x86_64,x86,arm64-v8a,armeabi-v7a,armeabi
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=x86_64,arm64-v8a
Bug: http://b/77159578
Bug: http://b/28684022
Test: make cf_x86_64_phone, deploys, check adb shell getprop | grep abi
Change-Id: I42a73f5c627b9d9f44e31cc5ad84238e1050f52a
2019-07-29 16:23:19 +02:00
# Add NATIVE_BRIDGE_ABIs at the end of 32 and 64 bit CPU_ABIs to keep order of preference.
TARGET_CPU_ABI_LIST_32_BIT += $( _target_native_bridge_abi_list_32_bit)
TARGET_CPU_ABI_LIST_64_BIT += $( _target_native_bridge_abi_list_64_bit)
2019-02-26 14:37:28 +01:00
# Strip whitespace from the ABI list string.
TARGET_CPU_ABI_LIST := $( subst $( space) ,$( comma) ,$( strip $( TARGET_CPU_ABI_LIST) ) )
TARGET_CPU_ABI_LIST_32_BIT := $( subst $( space) ,$( comma) ,$( strip $( TARGET_CPU_ABI_LIST_32_BIT) ) )
TARGET_CPU_ABI_LIST_64_BIT := $( subst $( space) ,$( comma) ,$( strip $( TARGET_CPU_ABI_LIST_64_BIT) ) )
2019-07-12 05:51:37 +02:00
# Check if config about image building is valid or not.
d e f i n e c h e c k _ i m a g e _ c o n f i g
$( eval _uc_name := $( call to-upper,$( 1) ) ) \
$( eval _lc_name := $( call to-lower,$( 1) ) ) \
$( if $( filter $( _lc_name) ,$( TARGET_COPY_OUT_$( _uc_name) ) ) , \
$( if $( BOARD_USES_$( _uc_name) IMAGE) ,, \
$( error If TARGET_COPY_OUT_$( _uc_name) is '$(_lc_name)' , either BOARD_PREBUILT_$( _uc_name) IMAGE or BOARD_$( _uc_name) IMAGE_FILE_SYSTEM_TYPE must be set ) ) , \
$( if $( BOARD_USES_$( _uc_name) IMAGE) , \
$( error TARGET_COPY_OUT_$( _uc_name) must be set to '$(_lc_name)' to use a $( _lc_name) image) ) ) \
$( eval _uc_name := ) \
$( eval _lc_name := )
e n d e f
2019-02-26 13:34:03 +01:00
###########################################
# Configure whether we're building the system image
BUILDING_SYSTEM_IMAGE := true
i f e q ( $( PRODUCT_BUILD_SYSTEM_IMAGE ) , )
ifndef PRODUCT_USE_DYNAMIC_PARTITION_SIZE
ifndef BOARD_SYSTEMIMAGE_PARTITION_SIZE
BUILDING_SYSTEM_IMAGE :=
endif
endif
e l s e i f e q ( $( PRODUCT_BUILD_SYSTEM_IMAGE ) , f a l s e )
BUILDING_SYSTEM_IMAGE :=
e n d i f
.KATI_READONLY := BUILDING_SYSTEM_IMAGE
# Are we building a system_other image
BUILDING_SYSTEM_OTHER_IMAGE :=
i f e q ( $( PRODUCT_BUILD_SYSTEM_OTHER_IMAGE ) , )
ifdef BUILDING_SYSTEM_IMAGE
ifeq ( $( BOARD_USES_SYSTEM_OTHER_ODEX) ,true)
BUILDING_SYSTEM_OTHER_IMAGE := true
endif
endif
e l s e i f e q ( $( PRODUCT_BUILD_SYSTEM_OTHER_IMAGE ) , t r u e )
BUILDING_SYSTEM_OTHER_IMAGE := true
ifndef BUILDING_SYSTEM_IMAGE
$( error PRODUCT_BUILD_SYSTEM_OTHER_IMAGE = true requires building the system image)
endif
e n d i f
.KATI_READONLY := BUILDING_SYSTEM_OTHER_IMAGE
# Are we building a cache image
BUILDING_CACHE_IMAGE :=
i f e q ( $( PRODUCT_BUILD_CACHE_IMAGE ) , )
ifdef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE
BUILDING_CACHE_IMAGE := true
endif
e l s e i f e q ( $( PRODUCT_BUILD_CACHE_IMAGE ) , t r u e )
BUILDING_CACHE_IMAGE := true
ifndef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE
$( error PRODUCT_BUILD_CACHE_IMAGE set to true, but BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE not defined)
endif
e n d i f
.KATI_READONLY := BUILDING_CACHE_IMAGE
2019-04-22 20:09:57 +02:00
# Are we building a boot image
BUILDING_BOOT_IMAGE :=
2020-10-06 20:09:56 +02:00
i f e q ( $( PRODUCT_BUILD_BOOT_IMAGE ) , )
ifeq ( $( BOARD_USES_RECOVERY_AS_BOOT) ,true)
BUILDING_BOOT_IMAGE :=
2021-05-19 18:14:42 +02:00
else ifdef BOARD_PREBUILT_BOOTIMAGE
BUILDING_BOOT_IMAGE :=
2020-10-06 20:09:56 +02:00
else ifdef BOARD_BOOTIMAGE_PARTITION_SIZE
2019-04-22 20:09:57 +02:00
BUILDING_BOOT_IMAGE := true
2020-10-15 23:48:07 +02:00
else ifneq ( ,$( foreach kernel,$( BOARD_KERNEL_BINARIES) ,$( BOARD_$( call to-upper,$( kernel) ) _BOOTIMAGE_PARTITION_SIZE) ) )
BUILDING_BOOT_IMAGE := true
2019-04-22 20:09:57 +02:00
endif
e l s e i f e q ( $( PRODUCT_BUILD_BOOT_IMAGE ) , t r u e )
2020-10-06 20:09:56 +02:00
ifeq ( $( BOARD_USES_RECOVERY_AS_BOOT) ,true)
$( warning *** PRODUCT_BUILD_BOOT_IMAGE is true, but so is BOARD_USES_RECOVERY_AS_BOOT.)
$( warning *** Skipping building boot image.)
BUILDING_BOOT_IMAGE :=
else
BUILDING_BOOT_IMAGE := true
endif
2019-04-22 20:09:57 +02:00
e n d i f
.KATI_READONLY := BUILDING_BOOT_IMAGE
2021-11-04 20:01:19 +01:00
# Are we building an init boot image
BUILDING_INIT_BOOT_IMAGE :=
i f e q ( $( PRODUCT_BUILD_INIT_BOOT_IMAGE ) , )
ifeq ( $( BOARD_USES_RECOVERY_AS_BOOT) ,true)
BUILDING_INIT_BOOT_IMAGE :=
else ifdef BOARD_PREBUILT_INIT_BOOT_IMAGE
BUILDING_INIT_BOOT_IMAGE :=
else ifdef BOARD_INIT_BOOT_IMAGE_PARTITION_SIZE
BUILDING_INIT_BOOT_IMAGE := true
endif
e l s e i f e q ( $( PRODUCT_BUILD_INIT_BOOT_IMAGE ) , t r u e )
ifeq ( $( BOARD_USES_RECOVERY_AS_BOOT) ,true)
$( error PRODUCT_BUILD_INIT_BOOT_IMAGE is true, but so is BOARD_USES_RECOVERY_AS_BOOT. Use only one option.)
else
BUILDING_INIT_BOOT_IMAGE := true
endif
e n d i f
.KATI_READONLY := BUILDING_INIT_BOOT_IMAGE
2019-04-22 20:09:57 +02:00
# Are we building a recovery image
BUILDING_RECOVERY_IMAGE :=
2020-10-06 20:09:56 +02:00
i f e q ( $( PRODUCT_BUILD_RECOVERY_IMAGE ) , )
ifeq ( $( BOARD_USES_RECOVERY_AS_BOOT) ,true)
BUILDING_RECOVERY_IMAGE := true
2020-10-09 23:29:39 +02:00
else ifeq ( $( BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT) ,true)
# Set to true to build recovery resources for vendor_boot
BUILDING_RECOVERY_IMAGE := true
2020-10-06 20:09:56 +02:00
else ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE
2019-04-22 20:09:57 +02:00
ifeq ( ,$( filter true, $( TARGET_NO_KERNEL) $( TARGET_NO_RECOVERY) ) )
BUILDING_RECOVERY_IMAGE := true
endif
endif
e l s e i f e q ( $( PRODUCT_BUILD_RECOVERY_IMAGE ) , t r u e )
BUILDING_RECOVERY_IMAGE := true
e n d i f
.KATI_READONLY := BUILDING_RECOVERY_IMAGE
2019-02-26 13:34:03 +01:00
2019-07-10 19:49:37 +02:00
# Are we building a vendor boot image
BUILDING_VENDOR_BOOT_IMAGE :=
i f d e f B O A R D _ B O O T _ H E A D E R _ V E R S I O N
ifneq ( $( call math_gt_or_eq,$( BOARD_BOOT_HEADER_VERSION) ,3) ,)
2020-10-17 00:10:21 +02:00
ifeq ( $( PRODUCT_BUILD_VENDOR_BOOT_IMAGE) ,)
2020-10-06 20:09:56 +02:00
BUILDING_VENDOR_BOOT_IMAGE := true
else ifeq ( $( PRODUCT_BUILD_VENDOR_BOOT_IMAGE) ,true)
2020-02-12 22:38:28 +01:00
BUILDING_VENDOR_BOOT_IMAGE := true
endif
2019-07-10 19:49:37 +02:00
endif
e n d i f
.KATI_READONLY := BUILDING_VENDOR_BOOT_IMAGE
2022-02-24 03:30:15 +01:00
# Are we building a vendor kernel boot image
BUILDING_VENDOR_KERNEL_BOOT_IMAGE :=
i f e q ( $( PRODUCT_BUILD_VENDOR_KERNEL_BOOT_IMAGE ) , t r u e )
ifneq ( $( BUILDING_VENDOR_BOOT_IMAGE) ,true)
$( error BUILDING_VENDOR_BOOT_IMAGE is required, but BUILDING_VENDOR_BOOT_IMAGE is not true )
endif
ifndef BOARD_VENDOR_KERNEL_BOOTIMAGE_PARTITION_SIZE
$( error BOARD_VENDOR_KERNEL_BOOTIMAGE_PARTITION_SIZE is required when PRODUCT_BUILD_VENDOR_KERNEL_BOOT_IMAGE is true )
endif
BUILDING_VENDOR_KERNEL_BOOT_IMAGE := true
e l s e i f e q ( $( PRODUCT_BUILD_VENDOR_KERNEL ) , )
ifdef BOARD_VENDOR_KERNEL_BOOTIMAGE_PARTITION_SIZE
ifeq ( $( BUILDING_VENDOR_BOOT_IMAGE) ,true)
BUILDING_VENDOR_KERNEL_BOOT_IMAGE := true
endif
endif
e n d i f # end of PRODUCT_BUILD_VENDOR_KERNEL_BOOT_IMAGE
.KATI_READONLY := BUILDING_VENDOR_KERNEL_BOOT_IMAGE
2019-02-26 13:34:03 +01:00
# Are we building a ramdisk image
BUILDING_RAMDISK_IMAGE := true
i f e q ( $( PRODUCT_BUILD_RAMDISK_IMAGE ) , )
# TODO: Be smarter about this. This probably only needs to happen when one of the follow is true:
# BUILDING_BOOT_IMAGE
# BUILDING_RECOVERY_IMAGE
e l s e i f e q ( $( PRODUCT_BUILD_RAMDISK_IMAGE ) , f a l s e )
BUILDING_RAMDISK_IMAGE :=
e n d i f
.KATI_READONLY := BUILDING_RAMDISK_IMAGE
2021-09-29 13:41:11 +02:00
# Are we building a debug vendor_boot image
BUILDING_DEBUG_VENDOR_BOOT_IMAGE :=
# Can't build vendor_boot-debug.img if we're not building a ramdisk.
2022-10-07 15:18:45 +02:00
i f n d e f B U I L D I N G _ R A M D I S K _ I M A G E
2021-09-29 13:41:11 +02:00
ifeq ( $( PRODUCT_BUILD_DEBUG_VENDOR_BOOT_IMAGE) ,true)
$( warning PRODUCT_BUILD_DEBUG_VENDOR_BOOT_IMAGE is true, but we' re not building a ramdisk image. \
Skip building the debug vendor_boot image.)
endif
# Can't build vendor_boot-debug.img if we're not building a vendor_boot.img.
e l s e i f n d e f B U I L D I N G _ V E N D O R _ B O O T _ I M A G E
ifeq ( $( PRODUCT_BUILD_DEBUG_VENDOR_BOOT_IMAGE) ,true)
$( warning PRODUCT_BUILD_DEBUG_VENDOR_BOOT_IMAGE is true, but we' re not building a vendor_boot image. \
Skip building the debug vendor_boot image.)
endif
e l s e
ifeq ( $( PRODUCT_BUILD_DEBUG_VENDOR_BOOT_IMAGE) ,)
BUILDING_DEBUG_VENDOR_BOOT_IMAGE := true
else ifeq ( $( PRODUCT_BUILD_DEBUG_VENDOR_BOOT_IMAGE) ,true)
BUILDING_DEBUG_VENDOR_BOOT_IMAGE := true
endif
e n d i f
.KATI_READONLY := BUILDING_DEBUG_VENDOR_BOOT_IMAGE
_has_boot_img_artifact :=
i f n e q ( $( strip $ ( TARGET_NO_KERNEL ) ) , t r u e )
ifdef BUILDING_BOOT_IMAGE
_has_boot_img_artifact := true
endif
# BUILDING_RECOVERY_IMAGE && BOARD_USES_RECOVERY_AS_BOOT implies that
# recovery is being built with the file name *boot.img*, which still counts
# as "building boot.img".
ifdef BUILDING_RECOVERY_IMAGE
ifeq ( $( BOARD_USES_RECOVERY_AS_BOOT) ,true)
_has_boot_img_artifact := true
endif
endif
e n d i f
# Are we building a debug boot image
BUILDING_DEBUG_BOOT_IMAGE :=
# Can't build boot-debug.img if we're not building a ramdisk.
2022-10-07 15:18:45 +02:00
i f n d e f B U I L D I N G _ R A M D I S K _ I M A G E
2021-09-29 13:41:11 +02:00
ifeq ( $( PRODUCT_BUILD_DEBUG_BOOT_IMAGE) ,true)
$( warning PRODUCT_BUILD_DEBUG_BOOT_IMAGE is true, but we' re not building a ramdisk image. \
Skip building the debug boot image.)
endif
# Can't build boot-debug.img if we're not building a boot.img.
e l s e i f n d e f _ h a s _ b o o t _ i m g _ a r t i f a c t
ifeq ( $( PRODUCT_BUILD_DEBUG_BOOT_IMAGE) ,true)
$( warning PRODUCT_BUILD_DEBUG_BOOT_IMAGE is true, but we' re not building a boot image. \
Skip building the debug boot image.)
endif
2021-11-04 20:01:19 +01:00
e l s e i f d e f B U I L D I N G _ I N I T _ B O O T _ I M A G E
ifeq ( $( PRODUCT_BUILD_DEBUG_BOOT_IMAGE) ,true)
$( warning PRODUCT_BUILD_DEBUG_BOOT_IMAGE is true, but we don' t have a ramdisk in the boot image. \
Skip building the debug boot image.)
endif
2021-09-29 13:41:11 +02:00
e l s e
ifeq ( $( PRODUCT_BUILD_DEBUG_BOOT_IMAGE) ,)
BUILDING_DEBUG_BOOT_IMAGE := true
# Don't build boot-debug.img if we're already building vendor_boot-debug.img.
ifdef BUILDING_DEBUG_VENDOR_BOOT_IMAGE
BUILDING_DEBUG_BOOT_IMAGE :=
endif
else ifeq ( $( PRODUCT_BUILD_DEBUG_BOOT_IMAGE) ,true)
BUILDING_DEBUG_BOOT_IMAGE := true
endif
e n d i f
.KATI_READONLY := BUILDING_DEBUG_BOOT_IMAGE
_has_boot_img_artifact :=
2019-02-26 13:34:03 +01:00
# Are we building a userdata image
BUILDING_USERDATA_IMAGE :=
i f e q ( $( PRODUCT_BUILD_USERDATA_IMAGE ) , )
ifdef BOARD_USERDATAIMAGE_PARTITION_SIZE
BUILDING_USERDATA_IMAGE := true
endif
e l s e i f e q ( $( PRODUCT_BUILD_USERDATA_IMAGE ) , t r u e )
BUILDING_USERDATA_IMAGE := true
e n d i f
.KATI_READONLY := BUILDING_USERDATA_IMAGE
2019-08-13 09:30:57 +02:00
# Are we building a vbmeta image
BUILDING_VBMETA_IMAGE := true
i f e q ( $( PRODUCT_BUILD_VBMETA_IMAGE ) , f a l s e )
BUILDING_VBMETA_IMAGE :=
e n d i f
.KATI_READONLY := BUILDING_VBMETA_IMAGE
2021-03-25 11:12:28 +01:00
# Are we building a super_empty image
BUILDING_SUPER_EMPTY_IMAGE :=
i f e q ( $( PRODUCT_BUILD_SUPER_EMPTY_IMAGE ) , )
ifeq ( true,$( PRODUCT_USE_DYNAMIC_PARTITIONS) )
ifneq ( $( BOARD_SUPER_PARTITION_SIZE) ,)
BUILDING_SUPER_EMPTY_IMAGE := true
endif
endif
e l s e i f e q ( $( PRODUCT_BUILD_SUPER_EMPTY_IMAGE ) , t r u e )
ifneq ( true,$( PRODUCT_USE_DYNAMIC_PARTITIONS) )
$( error PRODUCT_BUILD_SUPER_EMPTY_IMAGE set to true, but PRODUCT_USE_DYNAMIC_PARTITIONS is not true )
endif
ifeq ( $( BOARD_SUPER_PARTITION_SIZE) ,)
$( error PRODUCT_BUILD_SUPER_EMPTY_IMAGE set to true, but BOARD_SUPER_PARTITION_SIZE is not defined)
endif
BUILDING_SUPER_EMPTY_IMAGE := true
e n d i f
.KATI_READONLY := BUILDING_SUPER_EMPTY_IMAGE
2019-02-26 13:34:03 +01:00
###########################################
# Now we can substitute with the real value of TARGET_COPY_OUT_VENDOR
i f e q ( $( TARGET_COPY_OUT_VENDOR ) , $( _vendor_path_placeholder ) )
TARGET_COPY_OUT_VENDOR := system/vendor
e l s e i f e q ( $( filter vendor system /vendor ,$ ( TARGET_COPY_OUT_VENDOR ) ) , )
$( error TARGET_COPY_OUT_VENDOR must be either 'vendor' or 'system/vendor' , seeing '$(TARGET_COPY_OUT_VENDOR)' .)
e n d i f
PRODUCT_COPY_FILES := $( subst $( _vendor_path_placeholder) ,$( TARGET_COPY_OUT_VENDOR) ,$( PRODUCT_COPY_FILES) )
BOARD_USES_VENDORIMAGE :=
i f d e f B O A R D _ P R E B U I L T _ V E N D O R I M A G E
BOARD_USES_VENDORIMAGE := true
e n d i f
i f d e f B O A R D _ V E N D O R I M A G E _ F I L E _ S Y S T E M _ T Y P E
BOARD_USES_VENDORIMAGE := true
e n d i f
2019-07-12 05:51:37 +02:00
# TODO(b/137169253): For now, some AOSP targets build with prebuilt vendor image.
# But target's BOARD_PREBUILT_VENDORIMAGE is not filled.
2019-02-26 13:34:03 +01:00
i f e q ( $( TARGET_COPY_OUT_VENDOR ) , v e n d o r )
BOARD_USES_VENDORIMAGE := true
e l s e i f d e f B O A R D _ U S E S _ V E N D O R I M A G E
$( error TARGET_COPY_OUT_VENDOR must be set to 'vendor' to use a vendor image)
e n d i f
.KATI_READONLY := BOARD_USES_VENDORIMAGE
BUILDING_VENDOR_IMAGE :=
i f e q ( $( PRODUCT_BUILD_VENDOR_IMAGE ) , )
ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
BUILDING_VENDOR_IMAGE := true
endif
e l s e i f e q ( $( PRODUCT_BUILD_VENDOR_IMAGE ) , t r u e )
BUILDING_VENDOR_IMAGE := true
ifndef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
$( error PRODUCT_BUILD_VENDOR_IMAGE set to true, but BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE not defined)
endif
e n d i f
i f d e f B O A R D _ P R E B U I L T _ V E N D O R I M A G E
BUILDING_VENDOR_IMAGE :=
e n d i f
.KATI_READONLY := BUILDING_VENDOR_IMAGE
###########################################
# Now we can substitute with the real value of TARGET_COPY_OUT_PRODUCT
i f e q ( $( TARGET_COPY_OUT_PRODUCT ) , $( _product_path_placeholder ) )
TARGET_COPY_OUT_PRODUCT := system/product
e l s e i f e q ( $( filter product system /product ,$ ( TARGET_COPY_OUT_PRODUCT ) ) , )
$( error TARGET_COPY_OUT_PRODUCT must be either 'product ' or 'system /product ', seeing '$ ( TARGET_COPY_OUT_PRODUCT ) '.)
e n d i f
PRODUCT_COPY_FILES := $( subst $( _product_path_placeholder) ,$( TARGET_COPY_OUT_PRODUCT) ,$( PRODUCT_COPY_FILES) )
BOARD_USES_PRODUCTIMAGE :=
i f d e f B O A R D _ P R E B U I L T _ P R O D U C T I M A G E
BOARD_USES_PRODUCTIMAGE := true
e n d i f
i f d e f B O A R D _ P R O D U C T I M A G E _ F I L E _ S Y S T E M _ T Y P E
BOARD_USES_PRODUCTIMAGE := true
e n d i f
2019-07-12 05:51:37 +02:00
$( call check_image_config ,product )
2019-02-26 13:34:03 +01:00
.KATI_READONLY := BOARD_USES_PRODUCTIMAGE
BUILDING_PRODUCT_IMAGE :=
i f e q ( $( PRODUCT_BUILD_PRODUCT_IMAGE ) , )
ifdef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE
BUILDING_PRODUCT_IMAGE := true
endif
e l s e i f e q ( $( PRODUCT_BUILD_PRODUCT_IMAGE ) , t r u e )
BUILDING_PRODUCT_IMAGE := true
ifndef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE
$( error PRODUCT_BUILD_PRODUCT_IMAGE set to true, but BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE not defined)
endif
e n d i f
i f d e f B O A R D _ P R E B U I L T _ P R O D U C T I M A G E
BUILDING_PRODUCT_IMAGE :=
e n d i f
.KATI_READONLY := BUILDING_PRODUCT_IMAGE
###########################################
2019-06-25 08:58:13 +02:00
# TODO(b/135957588) TARGET_COPY_OUT_PRODUCT_SERVICES will be set to
# TARGET_COPY_OUT_PRODUCT as a workaround.
TARGET_COPY_OUT_PRODUCT_SERVICES := $( TARGET_COPY_OUT_PRODUCT)
###########################################
# Now we can substitute with the real value of TARGET_COPY_OUT_SYSTEM_EXT
i f e q ( $( TARGET_COPY_OUT_SYSTEM_EXT ) , $( _system_ext_path_placeholder ) )
TARGET_COPY_OUT_SYSTEM_EXT := system/system_ext
e l s e i f e q ( $( filter system_ext system /system_ext ,$ ( TARGET_COPY_OUT_SYSTEM_EXT ) ) , )
$( error TARGET_COPY_OUT_SYSTEM_EXT must be either 'system_ext ' or 'system /system_ext ', seeing '$ ( TARGET_COPY_OUT_SYSTEM_EXT ) '.)
e n d i f
PRODUCT_COPY_FILES := $( subst $( _system_ext_path_placeholder) ,$( TARGET_COPY_OUT_SYSTEM_EXT) ,$( PRODUCT_COPY_FILES) )
BOARD_USES_SYSTEM_EXTIMAGE :=
i f d e f B O A R D _ P R E B U I L T _ S Y S T E M _ E X T I M A G E
BOARD_USES_SYSTEM_EXTIMAGE := true
e n d i f
i f d e f B O A R D _ S Y S T E M _ E X T I M A G E _ F I L E _ S Y S T E M _ T Y P E
BOARD_USES_SYSTEM_EXTIMAGE := true
e n d i f
2019-07-12 05:51:37 +02:00
$( call check_image_config ,system_ext )
2019-06-25 08:58:13 +02:00
.KATI_READONLY := BOARD_USES_SYSTEM_EXTIMAGE
BUILDING_SYSTEM_EXT_IMAGE :=
i f e q ( $( PRODUCT_BUILD_SYSTEM_EXT_IMAGE ) , )
ifdef BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE
BUILDING_SYSTEM_EXT_IMAGE := true
2019-02-26 13:34:03 +01:00
endif
2019-06-25 08:58:13 +02:00
e l s e i f e q ( $( PRODUCT_BUILD_SYSTEM_EXT_IMAGE ) , t r u e )
BUILDING_SYSTEM_EXT_IMAGE := true
ifndef BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE
$( error PRODUCT_BUILD_SYSTEM_EXT_IMAGE set to true, but BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE not defined)
2019-02-26 13:34:03 +01:00
endif
e n d i f
2019-06-25 08:58:13 +02:00
i f d e f B O A R D _ P R E B U I L T _ S Y S T E M _ E X T I M A G E
BUILDING_SYSTEM_EXT_IMAGE :=
2019-02-26 13:34:03 +01:00
e n d i f
2019-06-25 08:58:13 +02:00
.KATI_READONLY := BUILDING_SYSTEM_EXT_IMAGE
2019-02-26 13:34:03 +01:00
2020-05-07 23:58:20 +02:00
###########################################
# Now we can substitute with the real value of TARGET_COPY_OUT_VENDOR_DLKM
i f e q ( $( TARGET_COPY_OUT_VENDOR_DLKM ) , $( _vendor_dlkm_path_placeholder ) )
TARGET_COPY_OUT_VENDOR_DLKM := $( TARGET_COPY_OUT_VENDOR) /vendor_dlkm
e l s e i f e q ( $( filter vendor_dlkm system /vendor /vendor_dlkm vendor /vendor_dlkm ,$ ( TARGET_COPY_OUT_VENDOR_DLKM ) ) , )
$( error TARGET_COPY_OUT_VENDOR_DLKM must be either 'vendor_dlkm' , 'system/vendor/vendor_dlkm' or 'vendor/vendor_dlkm' , seeing '$(TARGET_COPY_OUT_VENDOR_DLKM)' .)
e n d i f
PRODUCT_COPY_FILES := $( subst $( _vendor_dlkm_path_placeholder) ,$( TARGET_COPY_OUT_VENDOR_DLKM) ,$( PRODUCT_COPY_FILES) )
BOARD_USES_VENDOR_DLKMIMAGE :=
i f d e f B O A R D _ P R E B U I L T _ V E N D O R _ D L K M I M A G E
BOARD_USES_VENDOR_DLKMIMAGE := true
e n d i f
i f d e f B O A R D _ V E N D O R _ D L K M I M A G E _ F I L E _ S Y S T E M _ T Y P E
BOARD_USES_VENDOR_DLKMIMAGE := true
e n d i f
$( call check_image_config ,vendor_dlkm )
BUILDING_VENDOR_DLKM_IMAGE :=
i f e q ( $( PRODUCT_BUILD_VENDOR_DLKM_IMAGE ) , )
ifdef BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE
BUILDING_VENDOR_DLKM_IMAGE := true
endif
e l s e i f e q ( $( PRODUCT_BUILD_VENDOR_DLKM_IMAGE ) , t r u e )
BUILDING_VENDOR_DLKM_IMAGE := true
ifndef BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE
$( error PRODUCT_BUILD_VENDOR_DLKM_IMAGE set to true, but BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE not defined)
endif
e n d i f
i f d e f B O A R D _ P R E B U I L T _ V E N D O R _ D L K M I M A G E
BUILDING_VENDOR_DLKM_IMAGE :=
e n d i f
.KATI_READONLY := BUILDING_VENDOR_DLKM_IMAGE
2019-02-26 13:34:03 +01:00
###########################################
# Now we can substitute with the real value of TARGET_COPY_OUT_ODM
i f e q ( $( TARGET_COPY_OUT_ODM ) , $( _odm_path_placeholder ) )
2019-10-10 03:26:00 +02:00
TARGET_COPY_OUT_ODM := $( TARGET_COPY_OUT_VENDOR) /odm
e l s e i f e q ( $( filter odm system /vendor /odm vendor /odm ,$ ( TARGET_COPY_OUT_ODM ) ) , )
$( error TARGET_COPY_OUT_ODM must be either 'odm' , 'system/vendor/odm' or 'vendor/odm' , seeing '$(TARGET_COPY_OUT_ODM)' .)
2019-02-26 13:34:03 +01:00
e n d i f
PRODUCT_COPY_FILES := $( subst $( _odm_path_placeholder) ,$( TARGET_COPY_OUT_ODM) ,$( PRODUCT_COPY_FILES) )
BOARD_USES_ODMIMAGE :=
i f d e f B O A R D _ P R E B U I L T _ O D M I M A G E
BOARD_USES_ODMIMAGE := true
e n d i f
i f d e f B O A R D _ O D M I M A G E _ F I L E _ S Y S T E M _ T Y P E
BOARD_USES_ODMIMAGE := true
e n d i f
2019-07-12 05:51:37 +02:00
$( call check_image_config ,odm )
2019-02-26 13:34:03 +01:00
BUILDING_ODM_IMAGE :=
2019-04-20 00:00:12 +02:00
i f e q ( $( PRODUCT_BUILD_ODM_IMAGE ) , )
2019-02-26 13:34:03 +01:00
ifdef BOARD_ODMIMAGE_FILE_SYSTEM_TYPE
BUILDING_ODM_IMAGE := true
endif
e l s e i f e q ( $( PRODUCT_BUILD_ODM_IMAGE ) , t r u e )
BUILDING_ODM_IMAGE := true
ifndef BOARD_ODMIMAGE_FILE_SYSTEM_TYPE
$( error PRODUCT_BUILD_ODM_IMAGE set to true, but BOARD_ODMIMAGE_FILE_SYSTEM_TYPE not defined)
endif
e n d i f
i f d e f B O A R D _ P R E B U I L T _ O D M I M A G E
BUILDING_ODM_IMAGE :=
e n d i f
.KATI_READONLY := BUILDING_ODM_IMAGE
2020-07-16 01:52:59 +02:00
###########################################
# Now we can substitute with the real value of TARGET_COPY_OUT_ODM_DLKM
i f e q ( $( TARGET_COPY_OUT_ODM_DLKM ) , $( _odm_dlkm_path_placeholder ) )
TARGET_COPY_OUT_ODM_DLKM := $( TARGET_COPY_OUT_VENDOR) /odm_dlkm
e l s e i f e q ( $( filter odm_dlkm system /vendor /odm_dlkm vendor /odm_dlkm ,$ ( TARGET_COPY_OUT_ODM_DLKM ) ) , )
$( error TARGET_COPY_OUT_ODM_DLKM must be either 'odm_dlkm' , 'system/vendor/odm_dlkm' or 'vendor/odm_dlkm' , seeing '$(TARGET_COPY_OUT_ODM_DLKM)' .)
e n d i f
PRODUCT_COPY_FILES := $( subst $( _odm_dlkm_path_placeholder) ,$( TARGET_COPY_OUT_ODM_DLKM) ,$( PRODUCT_COPY_FILES) )
BOARD_USES_ODM_DLKMIMAGE :=
i f d e f B O A R D _ P R E B U I L T _ O D M _ D L K M I M A G E
BOARD_USES_ODM_DLKMIMAGE := true
e n d i f
i f d e f B O A R D _ O D M _ D L K M I M A G E _ F I L E _ S Y S T E M _ T Y P E
BOARD_USES_ODM_DLKMIMAGE := true
e n d i f
$( call check_image_config ,odm_dlkm )
BUILDING_ODM_DLKM_IMAGE :=
i f e q ( $( PRODUCT_BUILD_ODM_DLKM_IMAGE ) , )
ifdef BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE
BUILDING_ODM_DLKM_IMAGE := true
endif
e l s e i f e q ( $( PRODUCT_BUILD_ODM_DLKM_IMAGE ) , t r u e )
BUILDING_ODM_DLKM_IMAGE := true
ifndef BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE
$( error PRODUCT_BUILD_ODM_DLKM_IMAGE set to true, but BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE not defined)
endif
e n d i f
i f d e f B O A R D _ P R E B U I L T _ O D M _ D L K M I M A G E
BUILDING_ODM_DLKM_IMAGE :=
e n d i f
.KATI_READONLY := BUILDING_ODM_DLKM_IMAGE
2022-01-27 08:05:08 +01:00
###########################################
# Now we can substitute with the real value of TARGET_COPY_OUT_SYSTEM_DLKM
i f e q ( $( TARGET_COPY_OUT_SYSTEM_DLKM ) , $( _system_dlkm_path_placeholder ) )
TARGET_COPY_OUT_SYSTEM_DLKM := $( TARGET_COPY_OUT_SYSTEM) /system_dlkm
e l s e i f e q ( $( filter system_dlkm system /system_dlkm ,$ ( TARGET_COPY_OUT_SYSTEM_DLKM ) ) , )
$( error TARGET_COPY_OUT_SYSTEM_DLKM must be either 'system_dlkm' or 'system/system_dlkm' , seeing '$(TARGET_COPY_OUT_ODM_DLKM)' .)
e n d i f
PRODUCT_COPY_FILES := $( subst $( _system_dlkm_path_placeholder) ,$( TARGET_COPY_OUT_SYSTEM_DLKM) ,$( PRODUCT_COPY_FILES) )
BOARD_USES_SYSTEM_DLKMIMAGE :=
i f d e f B O A R D _ P R E B U I L T _ S Y S T E M _ D L K M I M A G E
BOARD_USES_SYSTEM_DLKMIMAGE := true
e n d i f
i f d e f B O A R D _ S Y S T E M _ D L K M I M A G E _ F I L E _ S Y S T E M _ T Y P E
BOARD_USES_SYSTEM_DLKMIMAGE := true
e n d i f
$( call check_image_config ,system_dlkm )
BUILDING_SYSTEM_DLKM_IMAGE :=
i f e q ( $( PRODUCT_BUILD_SYSTEM_DLKM_IMAGE ) , )
ifdef BOARD_SYSTEM_DLKMIMAGE_FILE_SYSTEM_TYPE
BUILDING_SYSTEM_DLKM_IMAGE := true
endif
e l s e i f e q ( $( PRODUCT_BUILD_SYSTEM_DLKM_IMAGE ) , t r u e )
BUILDING_SYSTEM_DLKM_IMAGE := true
ifndef BOARD_SYSTEM_DLKMIMAGE_FILE_SYSTEM_TYPE
$( error PRODUCT_BUILD_SYSTEM_DLKM_IMAGE set to true, but BOARD_SYSTEM_DLKMIMAGE_FILE_SYSTEM_TYPE not defined)
endif
e n d i f
i f d e f B O A R D _ P R E B U I L T _ S Y S T E M _ D L K M I M A G E
BUILDING_SYSTEM_DLKM_IMAGE :=
e n d i f
.KATI_READONLY := BUILDING_SYSTEM_DLKM_IMAGE
2021-09-24 15:41:13 +02:00
BOARD_USES_PVMFWIMAGE :=
2021-09-24 15:49:00 +02:00
i f e q ( $( PRODUCT_BUILD_PVMFW_IMAGE ) , t r u e )
BOARD_USES_PVMFWIMAGE := true
e n d i f
2021-09-24 15:41:13 +02:00
.KATI_READONLY := BOARD_USES_PVMFWIMAGE
2019-02-26 13:34:03 +01:00
###########################################
2020-04-17 19:08:10 +02:00
# Ensure consistency among TARGET_RECOVERY_UPDATER_LIBS, AB_OTA_UPDATER, and PRODUCT_OTA_FORCE_NON_AB_PACKAGE.
2019-02-26 13:34:03 +01:00
TARGET_RECOVERY_UPDATER_LIBS ?=
AB_OTA_UPDATER ?=
.KATI_READONLY := TARGET_RECOVERY_UPDATER_LIBS AB_OTA_UPDATER
2020-04-17 19:08:10 +02:00
# Ensure that if PRODUCT_OTA_FORCE_NON_AB_PACKAGE == true, then AB_OTA_UPDATER must be true
i f e q ( $( PRODUCT_OTA_FORCE_NON_AB_PACKAGE ) , t r u e )
ifneq ( $( AB_OTA_UPDATER) ,true)
$( error AB_OTA_UPDATER must be set to true when PRODUCT_OTA_FORCE_NON_AB_PACKAGE is true )
endif
e n d i f
# In some configurations, A/B and non-A/B may coexist. Check TARGET_OTA_ALLOW_NON_AB
# to see if non-A/B is supported.
TARGET_OTA_ALLOW_NON_AB := false
i f n e q ( $( AB_OTA_UPDATER ) , t r u e )
TARGET_OTA_ALLOW_NON_AB := true
e l s e i f e q ( $( PRODUCT_OTA_FORCE_NON_AB_PACKAGE ) , t r u e )
TARGET_OTA_ALLOW_NON_AB := true
e n d i f
.KATI_READONLY := TARGET_OTA_ALLOW_NON_AB
i f n e q ( $( TARGET_OTA_ALLOW_NON_AB ) , t r u e )
2019-02-26 13:34:03 +01:00
ifneq ( $( strip $( TARGET_RECOVERY_UPDATER_LIBS) ) ,)
2020-04-17 19:08:10 +02:00
$( error Do not use TARGET_RECOVERY_UPDATER_LIBS when using TARGET_OTA_ALLOW_NON_AB)
2019-02-26 13:34:03 +01:00
endif
e n d i f
2023-01-18 09:39:10 +01:00
# For Non A/B full OTA, disable brotli compression.
i f e q ( $( TARGET_OTA_ALLOW_NON_AB ) , t r u e )
BOARD_NON_AB_OTA_DISABLE_COMPRESSION := true
e n d i f
2020-07-30 23:23:31 +02:00
# Quick check for building generic OTA packages. Currently it only supports A/B OTAs.
2019-04-09 06:11:59 +02:00
i f e q ( $( PRODUCT_BUILD_GENERIC_OTA_PACKAGE ) , t r u e )
ifneq ( $( AB_OTA_UPDATER) ,true)
$( error PRODUCT_BUILD_GENERIC_OTA_PACKAGE with 'AB_OTA_UPDATER != true' is not supported)
endif
e n d i f
2019-05-20 20:10:24 +02:00
i f d e f B O A R D _ P R E B U I L T _ D T B I M A G E _ D I R
ifneq ( $( BOARD_INCLUDE_DTB_IN_BOOTIMG) ,true)
$( error BOARD_PREBUILT_DTBIMAGE_DIR with 'BOARD_INCLUDE_DTB_IN_BOOTIMG != true' is not supported)
endif
e n d i f
2019-02-26 13:34:03 +01:00
# Check BOARD_VNDK_VERSION
d e f i n e c h e c k _ v n d k _ v e r s i o n
$( eval vndk_path := prebuilts/vndk/v$( 1) ) \
$( if $( wildcard $( vndk_path) /*/Android.bp) ,,$( error VNDK version $( 1) not found) )
e n d e f
2023-06-03 00:53:03 +02:00
TARGET_VENDOR_TEST_SUFFIX := /vendor
2020-12-07 08:00:50 +01:00
2020-06-04 16:16:39 +02:00
i f e q ( , $( TARGET_BUILD_UNBUNDLED ) )
2019-02-26 13:34:03 +01:00
i f d e f P R O D U C T _ E X T R A _ V N D K _ V E R S I O N S
$( foreach v,$( PRODUCT_EXTRA_VNDK_VERSIONS) ,$( call check_vndk_version,$( v) ) )
e n d i f
e n d i f
# Ensure that BOARD_SYSTEMSDK_VERSIONS are all within PLATFORM_SYSTEMSDK_VERSIONS
_unsupported_systemsdk_versions := $( filter-out $( PLATFORM_SYSTEMSDK_VERSIONS) ,$( BOARD_SYSTEMSDK_VERSIONS) )
i f n e q ( , $( _unsupported_systemsdk_versions ) )
$( error System SDK versions '$(_unsupported_systemsdk_versions)' in BOARD_SYSTEMSDK_VERSIONS are not supported.\
Supported versions are $( PLATFORM_SYSTEMSDK_VERSIONS) )
e n d i f
2019-04-17 21:25:09 +02:00
2023-11-10 08:31:04 +01:00
###########################################
# BOARD_API_LEVEL for vendor API surface
i f d e f R E L E A S E _ B O A R D _ A P I _ L E V E L
ifdef BOARD_API_LEVEL
2024-03-29 20:43:49 +01:00
$( error BOARD_API_LEVEL must not be set manually. The build system automatically sets this value.)
2023-11-10 08:31:04 +01:00
endif
BOARD_API_LEVEL := $( RELEASE_BOARD_API_LEVEL)
.KATI_READONLY := BOARD_API_LEVEL
e n d i f
2019-04-17 21:25:09 +02:00
###########################################
# Handle BUILD_BROKEN_USES_BUILD_*
2020-02-20 03:06:54 +01:00
$( foreach m ,$ ( DEFAULT_WARNING_BUILD_MODULE_TYPES ) ,\
2019-04-17 21:25:09 +02:00
$( if $( filter false,$( BUILD_BROKEN_USES_$( m) ) ) ,\
$( KATI_obsolete_var $( m) ,Please convert to Soong) ,\
$( KATI_deprecated_var $( m) ,Please convert to Soong) ) )
2020-02-20 03:06:54 +01:00
$( if $ ( filter true ,$ ( BUILD_BROKEN_USES_BUILD_COPY_HEADERS ) ) ,\
2021-09-28 21:43:04 +02:00
$( KATI_deprecated_var BUILD_COPY_HEADERS,See $( CHANGES_URL) \# copy_headers) ,\
$( KATI_obsolete_var BUILD_COPY_HEADERS,See $( CHANGES_URL) \# copy_headers) )
2020-01-28 04:26:02 +01:00
2020-02-20 03:06:54 +01:00
$( foreach m ,$ ( filter -out BUILD_COPY_HEADERS ,$ ( DEFAULT_ERROR_BUILD_MODULE_TYPES ) ) ,\
2019-04-17 21:25:09 +02:00
$( if $( filter true,$( BUILD_BROKEN_USES_$( m) ) ) ,\
$( KATI_deprecated_var $( m) ,Please convert to Soong) ,\
$( KATI_obsolete_var $( m) ,Please convert to Soong) ) )
2020-10-08 20:54:02 +02:00
i f n d e f B U I L D I N G _ R E C O V E R Y _ I M A G E
ifeq ( true,$( BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE) )
$( error Should not set BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE if not building recovery image)
endif
e n d i f
2020-10-09 23:29:39 +02:00
i f n d e f B U I L D I N G _ V E N D O R _ B O O T _ I M A G E
ifeq ( true,$( BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT) )
$( error Should not set BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT if not building vendor_boot image)
endif
2020-12-10 11:42:47 +01:00
ifdef BOARD_VENDOR_RAMDISK_FRAGMENTS
$( error Should not set BOARD_VENDOR_RAMDISK_FRAGMENTS if not building vendor_boot image)
endif
2021-04-04 10:03:10 +02:00
e l s e # BUILDING_VENDOR_BOOT_IMAGE
ifneq ( ,$( call math_lt,$( BOARD_BOOT_HEADER_VERSION) ,4) )
ifdef BOARD_VENDOR_RAMDISK_FRAGMENTS
$( error Should not set BOARD_VENDOR_RAMDISK_FRAGMENTS if \
BOARD_BOOT_HEADER_VERSION is less than 4)
endif
2021-04-04 10:12:25 +02:00
ifeq ( true,$( BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT) )
$( error Should not set BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT if \
BOARD_BOOT_HEADER_VERSION is less than 4)
endif
2021-04-04 10:03:10 +02:00
endif
e n d i f # BUILDING_VENDOR_BOOT_IMAGE
2020-12-10 11:42:47 +01:00
i f n e q ( $( words $ ( BOARD_VENDOR_RAMDISK_FRAGMENTS ) ) , $( words $ ( sort $ ( BOARD_VENDOR_RAMDISK_FRAGMENTS ) ) ) )
$( error BOARD_VENDOR_RAMDISK_FRAGMENTS has duplicate entries: $( BOARD_VENDOR_RAMDISK_FRAGMENTS) )
2020-10-09 23:29:39 +02:00
e n d i f
2021-04-04 10:12:25 +02:00
i f e q ( t r u e , $( BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT ) )
ifneq ( true,$( BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT) )
$( error Should not set BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT if \
BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT is not set )
endif
e n d i f
2020-10-09 23:29:39 +02:00
# If BOARD_USES_GENERIC_KERNEL_IMAGE is set, BOARD_USES_RECOVERY_AS_BOOT must not be set.
# Devices without a dedicated recovery partition uses BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT to
# build recovery into vendor_boot.
i f e q ( t r u e , $( BOARD_USES_GENERIC_KERNEL_IMAGE ) )
ifeq ( true,$( BOARD_USES_RECOVERY_AS_BOOT) )
$( error BOARD_USES_RECOVERY_AS_BOOT cannot be true if BOARD_USES_GENERIC_KERNEL_IMAGE is true. \
Use BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT instead)
endif
e n d i f
2020-11-14 04:12:06 +01:00
i f e q ( t r u e , $( BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT ) )
ifeq ( true,$( BOARD_USES_RECOVERY_AS_BOOT) )
$( error BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT and BOARD_USES_RECOVERY_AS_BOOT cannot be \
both true. Recovery resources should be installed to either boot or vendor_boot, but not both)
endif
e n d i f