1#
2# Copyright 2017 The Android Open-Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17#
18# Common BoardConfig for all supported architectures.
19#
20
21# Some targets still require 32 bit, and 6.6 kernels don't support
22# 32 bit devices (Wear, Go, Auto)
23ifeq (true,$(CLOCKWORK_EMULATOR_PRODUCT))
24TARGET_KERNEL_USE ?= 6.1
25else ifneq (,$(findstring x86_phone,$(PRODUCT_NAME)))
26TARGET_KERNEL_USE ?= 6.1
27else ifneq (,$(findstring x86_tv,$(PRODUCT_NAME)))
28TARGET_KERNEL_USE ?= 6.1
29else
30TARGET_KERNEL_USE ?= 6.6
31endif
32
33TARGET_KERNEL_ARCH ?= $(TARGET_ARCH)
34SYSTEM_DLKM_SRC ?= kernel/prebuilts/$(TARGET_KERNEL_USE)/$(TARGET_KERNEL_ARCH)
35TARGET_KERNEL_PATH ?= $(SYSTEM_DLKM_SRC)/kernel-$(TARGET_KERNEL_USE)
36KERNEL_MODULES_PATH ?= \
37    kernel/prebuilts/common-modules/virtual-device/$(TARGET_KERNEL_USE)/$(subst _,-,$(TARGET_KERNEL_ARCH))
38PRODUCT_COPY_FILES += $(TARGET_KERNEL_PATH):kernel
39
40BOARD_KERNEL_VERSION := $(word 1,$(subst vermagic=,,$(shell egrep -h -ao -m 1 'vermagic=.*' $(KERNEL_MODULES_PATH)/nd_virtio.ko)))
41
42# The list of modules strictly/only required either to reach second stage
43# init, OR for recovery. Do not use this list to workaround second stage
44# issues.
45RAMDISK_KERNEL_MODULES ?= \
46    failover.ko \
47    nd_virtio.ko \
48    net_failover.ko \
49    virtio_blk.ko \
50    virtio_console.ko \
51    virtio_dma_buf.ko \
52    virtio-gpu.ko \
53    virtio_input.ko \
54    virtio_net.ko \
55    virtio_pci.ko \
56    virtio-rng.ko \
57    vmw_vsock_virtio_transport.ko \
58
59ifeq ($(TARGET_KERNEL_ARCH),arm64)
60BOARD_KERNEL_PATH_16K := kernel/prebuilts/mainline/$(TARGET_KERNEL_ARCH)/16k/kernel-mainline
61BOARD_KERNEL_MODULES_16K += $(wildcard kernel/prebuilts/mainline/$(TARGET_KERNEL_ARCH)/16k/*.ko)
62BOARD_KERNEL_MODULES_16K += $(wildcard kernel/prebuilts/common-modules/virtual-device/mainline/$(TARGET_KERNEL_ARCH)/16k/*.ko)
63endif
64
65BOARD_VENDOR_RAMDISK_KERNEL_MODULES := \
66    $(patsubst %,$(KERNEL_MODULES_PATH)/%,$(RAMDISK_KERNEL_MODULES))
67
68# GKI >5.15 will have and require virtio_pci_legacy_dev.ko
69BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(KERNEL_MODULES_PATH)/virtio_pci_legacy_dev.ko)
70# GKI >5.10 will have and require virtio_pci_modern_dev.ko
71BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(KERNEL_MODULES_PATH)/virtio_pci_modern_dev.ko)
72# GKI >6.4 will have an required vmw_vsock_virtio_transport_common.ko and vsock.ko
73BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
74	$(wildcard $(KERNEL_MODULES_PATH)/vmw_vsock_virtio_transport_common.ko) \
75	$(wildcard $(KERNEL_MODULES_PATH)/vsock.ko)
76
77
78# TODO(b/294888357) once virt_wifi is deprecated we can stop loading mac80211 in
79# first stage init. To minimize scope of modules options to first stage init,
80# mac80211_hwsim.radios=0 has to be specified in the modules options file (which we
81# only read in first stage) and mac80211_hwsim has to be loaded in first stage consequently..
82BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(SYSTEM_DLKM_SRC)/libarc4.ko)
83BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(SYSTEM_DLKM_SRC)/rfkill.ko)
84BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(SYSTEM_DLKM_SRC)/cfg80211.ko)
85BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(SYSTEM_DLKM_SRC)/mac80211.ko)
86BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(KERNEL_MODULES_PATH)/cfg80211.ko)
87BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(KERNEL_MODULES_PATH)/mac80211.ko)
88BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(KERNEL_MODULES_PATH)/mac80211_hwsim.ko)
89BOARD_DO_NOT_STRIP_VENDOR_RAMDISK_MODULES := true
90ALL_KERNEL_MODULES := $(wildcard $(KERNEL_MODULES_PATH)/*.ko)
91BOARD_VENDOR_KERNEL_MODULES := \
92    $(filter-out $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES),\
93                 $(wildcard $(KERNEL_MODULES_PATH)/*.ko))
94
95# TODO(b/170639028): Back up TARGET_NO_BOOTLOADER
96__TARGET_NO_BOOTLOADER := $(TARGET_NO_BOOTLOADER)
97include build/make/target/board/BoardConfigMainlineCommon.mk
98TARGET_NO_BOOTLOADER := $(__TARGET_NO_BOOTLOADER)
99
100# For now modules are only blocked in second stage init.
101# If a module ever needs to blocked in first stage init - add a new blocklist to
102# BOARD_VENDOR_RAMDISK_KERNEL_MODULES_BLOCKLIST_FILE
103BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := \
104    device/google/cuttlefish/shared/modules.blocklist
105
106BOARD_VENDOR_RAMDISK_KERNEL_MODULES_OPTIONS_FILE := \
107    device/google/cuttlefish/shared/config/first_stage_modules.options
108
109ifndef TARGET_BOOTLOADER_BOARD_NAME
110TARGET_BOOTLOADER_BOARD_NAME := cutf
111endif
112
113BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
114
115# Boot partition size: 64M
116# This is only used for OTA update packages. The image size on disk
117# will not change (as is it not a filesystem.)
118BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864
119ifdef TARGET_DEDICATED_RECOVERY
120BOARD_RECOVERYIMAGE_PARTITION_SIZE := 67108864
121endif
122BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 67108864
123
124# init_boot partition size is recommended to be 8MB, it can be larger.
125# When this variable is set, init_boot.img will be built with the generic
126# ramdisk, and that ramdisk will no longer be included in boot.img.
127BOARD_INIT_BOOT_IMAGE_PARTITION_SIZE := 8388608
128
129# Build a separate vendor.img partition
130BOARD_USES_VENDORIMAGE := true
131BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
132
133BOARD_USES_METADATA_PARTITION := true
134
135# Build a separate product.img partition
136BOARD_USES_PRODUCTIMAGE := true
137BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
138
139# Build a separate system_ext.img partition
140BOARD_USES_SYSTEM_EXTIMAGE := true
141BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
142TARGET_COPY_OUT_SYSTEM_EXT := system_ext
143
144# Build a separate odm.img partition
145BOARD_USES_ODMIMAGE := true
146BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
147TARGET_COPY_OUT_ODM := odm
148
149# Build a separate vendor_dlkm partition
150BOARD_USES_VENDOR_DLKMIMAGE := true
151BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
152TARGET_COPY_OUT_VENDOR_DLKM := vendor_dlkm
153
154# Build a separate odm_dlkm partition
155BOARD_USES_ODM_DLKMIMAGE := true
156BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
157TARGET_COPY_OUT_ODM_DLKM := odm_dlkm
158
159# Build a separate system_dlkm partition
160BOARD_USES_SYSTEM_DLKMIMAGE := true
161BOARD_SYSTEM_DLKMIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
162TARGET_COPY_OUT_SYSTEM_DLKM := system_dlkm
163BOARD_SYSTEM_KERNEL_MODULES := $(wildcard $(SYSTEM_DLKM_SRC)/*.ko)
164
165# Enable AVB
166BOARD_AVB_ENABLE := true
167BOARD_AVB_ALGORITHM := SHA256_RSA4096
168BOARD_AVB_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
169
170# Enable chained vbmeta for system image mixing
171BOARD_AVB_VBMETA_SYSTEM := product system system_ext
172BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
173BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA4096
174BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
175BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 1
176
177# Enable chained vbmeta for boot images
178BOARD_AVB_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
179BOARD_AVB_BOOT_ALGORITHM := SHA256_RSA4096
180BOARD_AVB_BOOT_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
181BOARD_AVB_BOOT_ROLLBACK_INDEX_LOCATION := 2
182
183# Enable chained vbmeta for init_boot images
184BOARD_AVB_INIT_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
185BOARD_AVB_INIT_BOOT_ALGORITHM := SHA256_RSA4096
186BOARD_AVB_INIT_BOOT_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
187BOARD_AVB_INIT_BOOT_ROLLBACK_INDEX_LOCATION := 3
188
189# Enabled chained vbmeta for vendor_dlkm
190BOARD_AVB_VBMETA_CUSTOM_PARTITIONS := vendor_dlkm system_dlkm
191BOARD_AVB_VBMETA_VENDOR_DLKM := vendor_dlkm
192BOARD_AVB_VBMETA_VENDOR_DLKM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
193BOARD_AVB_VBMETA_VENDOR_DLKM_ALGORITHM := SHA256_RSA4096
194BOARD_AVB_VBMETA_VENDOR_DLKM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
195BOARD_AVB_VBMETA_VENDOR_DLKM_ROLLBACK_INDEX_LOCATION := 4
196
197BOARD_AVB_VBMETA_SYSTEM_DLKM := system_dlkm
198BOARD_AVB_VBMETA_SYSTEM_DLKM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
199BOARD_AVB_VBMETA_SYSTEM_DLKM_ALGORITHM := SHA256_RSA4096
200BOARD_AVB_VBMETA_SYSTEM_DLKM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
201BOARD_AVB_VBMETA_SYSTEM_DLKM_ROLLBACK_INDEX_LOCATION := 5
202
203
204# Using sha256 for dm-verity partitions. b/178983355
205# system, system_other, product.
206TARGET_AVB_SYSTEM_HASHTREE_ALGORITHM ?= sha256
207TARGET_AVB_SYSTEM_OTHER_HASHTREE_ALGORITHM ?= sha256
208TARGET_AVB_PRODUCT_HASHTREE_ALGORITHM ?= sha256
209# Using blake2b-256 for system_ext. This give us move coverage of the
210# algorithms as we otherwise don't have a device using blake2b-256.
211TARGET_AVB_SYSTEM_EXT_HASHTREE_ALGORITHM ?= blake2b-256
212
213BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS += --hash_algorithm $(TARGET_AVB_SYSTEM_HASHTREE_ALGORITHM)
214BOARD_AVB_SYSTEM_OTHER_ADD_HASHTREE_FOOTER_ARGS += --hash_algorithm $(TARGET_AVB_SYSTEM_OTHER_HASHTREE_ALGORITHM)
215BOARD_AVB_SYSTEM_EXT_ADD_HASHTREE_FOOTER_ARGS += --hash_algorithm $(TARGET_AVB_SYSTEM_EXT_HASHTREE_ALGORITHM)
216BOARD_AVB_PRODUCT_ADD_HASHTREE_FOOTER_ARGS += --hash_algorithm $(TARGET_AVB_PRODUCT_HASHTREE_ALGORITHM)
217
218# vendor and odm.
219BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS += --hash_algorithm sha256
220BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS += --hash_algorithm sha256
221
222# vendor_dlkm, odm_dlkm, and system_dlkm.
223BOARD_AVB_VENDOR_DLKM_ADD_HASHTREE_FOOTER_ARGS += --hash_algorithm sha256
224BOARD_AVB_ODM_DLKM_ADD_HASHTREE_FOOTER_ARGS += --hash_algorithm sha256
225BOARD_AVB_SYSTEM_DLKM_ADD_HASHTREE_FOOTER_ARGS += --hash_algorithm sha256
226
227BOARD_USES_GENERIC_AUDIO := false
228USE_CAMERA_STUB := true
229
230# Hardware composer configuration
231TARGET_USES_HWC2 := true
232
233# The compiler will occasionally generate movaps, etc.
234BOARD_MALLOC_ALIGNMENT := 16
235
236# Enable sparse on all filesystem images
237TARGET_USERIMAGES_SPARSE_EROFS_DISABLED ?= false
238TARGET_USERIMAGES_SPARSE_EXT_DISABLED ?= false
239TARGET_USERIMAGES_SPARSE_F2FS_DISABLED ?= false
240
241# Make the userdata partition 8G to accommodate ASAN, CTS and provide
242# enough space for other cases (such as remount, etc)
243BOARD_USERDATAIMAGE_PARTITION_SIZE := $(TARGET_USERDATAIMAGE_PARTITION_SIZE)
244BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := $(TARGET_USERDATAIMAGE_FILE_SYSTEM_TYPE)
245$(call soong_config_append,cvdhost,default_userdata_fs_type,$(TARGET_USERDATAIMAGE_FILE_SYSTEM_TYPE))
246ifeq ($(TARGET_USERDATAIMAGE_FILE_SYSTEM_TYPE),f2fs)
247TARGET_USERIMAGES_USE_F2FS := true
248endif
249ifeq ($(TARGET_USERDATAIMAGE_FILE_SYSTEM_TYPE),ext4)
250TARGET_USERIMAGES_USE_EXT4 := true
251endif
252
253# Enable goldfish's encoder.
254# TODO(b/113617962) Remove this if we decide to use
255# device/generic/opengl-transport to generate the encoder
256BUILD_EMULATOR_OPENGL_DRIVER := true
257BUILD_EMULATOR_OPENGL := true
258
259# Minimum size of the final bootable disk image: 10G
260# GCE will pad disk images out to 10G. Our disk images should be at least as
261# big to avoid warnings about partition table oddities.
262BOARD_DISK_IMAGE_MINIMUM_SIZE := 10737418240
263
264BOARD_BOOTIMAGE_MAX_SIZE := 8388608
265BOARD_SYSLOADER_MAX_SIZE := 7340032
266# TODO(san): See if we can get rid of this.
267BOARD_FLASH_BLOCK_SIZE := 512
268
269USE_OPENGL_RENDERER := true
270
271# Wifi.
272BOARD_WLAN_DEVICE           := emulator
273BOARD_HOSTAPD_PRIVATE_LIB   := lib_driver_cmd_simulated_cf_bp
274WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
275WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA}, 1}, {{AP}, 1}, {{P2P}, 1}}
276BOARD_HOSTAPD_DRIVER        := NL80211
277BOARD_WPA_SUPPLICANT_DRIVER := NL80211
278BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_simulated_cf_bp
279WPA_SUPPLICANT_VERSION      := VER_0_8_X
280WIFI_DRIVER_FW_PATH_PARAM   := "/dev/null"
281WIFI_DRIVER_FW_PATH_STA     := "/dev/null"
282WIFI_DRIVER_FW_PATH_AP      := "/dev/null"
283
284# vendor sepolicy
285BOARD_VENDOR_SEPOLICY_DIRS += device/google/cuttlefish/shared/sepolicy/vendor
286BOARD_VENDOR_SEPOLICY_DIRS += device/google/cuttlefish/shared/sepolicy/vendor/seriallogging
287BOARD_VENDOR_SEPOLICY_DIRS += device/google/cuttlefish/shared/sepolicy/vendor/google
288
289BOARD_SEPOLICY_DIRS += system/bt/vendor_libs/linux/sepolicy
290
291# product sepolicy, allow other layers to append
292PRODUCT_PRIVATE_SEPOLICY_DIRS += device/google/cuttlefish/shared/sepolicy/product/private
293# PRODUCT_PUBLIC_SEPOLICY_DIRS += device/google/cuttlefish/shared/sepolicy/product/public
294# system_ext sepolicy
295SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += device/google/cuttlefish/shared/sepolicy/system_ext/private
296# SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += device/google/cuttlefish/shared/sepolicy/system_ext/public
297
298STAGEFRIGHT_AVCENC_CFLAGS := -DANDROID_GCE
299
300INIT_BOOTCHART := true
301
302# Settings for dhcpcd-6.8.2.
303DHCPCD_USE_IPV6 := no
304DHCPCD_USE_DBUS := no
305DHCPCD_USE_SCRIPT := yes
306
307
308TARGET_RECOVERY_PIXEL_FORMAT := ABGR_8888
309TARGET_RECOVERY_UI_LIB := librecovery_ui_cuttlefish
310TARGET_RECOVERY_FSTAB_GENRULE := gen_fstab_cf_f2fs_cts
311
312BOARD_SUPER_PARTITION_SIZE := 7516192768  # 7GiB
313BOARD_SUPER_PARTITION_GROUPS := google_system_dynamic_partitions google_vendor_dynamic_partitions
314BOARD_GOOGLE_SYSTEM_DYNAMIC_PARTITIONS_PARTITION_LIST := product system system_ext system_dlkm
315BOARD_GOOGLE_SYSTEM_DYNAMIC_PARTITIONS_SIZE := 5771362304  # 5.375GiB
316BOARD_GOOGLE_VENDOR_DYNAMIC_PARTITIONS_PARTITION_LIST := odm vendor vendor_dlkm odm_dlkm
317# 1404MiB, reserve 4MiB for dynamic partition metadata
318BOARD_GOOGLE_VENDOR_DYNAMIC_PARTITIONS_SIZE := 1472200704
319BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT := true
320BOARD_SUPER_IMAGE_IN_UPDATE_PACKAGE := true
321TARGET_RELEASETOOLS_EXTENSIONS := device/google/cuttlefish/shared
322
323# Generate a partial ota update package for partitions in vbmeta_system
324BOARD_PARTIAL_OTA_UPDATE_PARTITIONS_LIST := $(BOARD_AVB_VBMETA_SYSTEM) vbmeta_system init_boot
325
326BOARD_BOOTLOADER_IN_UPDATE_PACKAGE := true
327BOARD_RAMDISK_USE_LZ4 := true
328
329# To see full logs from init, disable ratelimiting.
330# The default is 5 messages per second amortized, with a burst of up to 10.
331BOARD_KERNEL_CMDLINE += printk.devkmsg=on
332
333# Print audit messages for all security check failures
334BOARD_KERNEL_CMDLINE += audit=1
335
336# Reboot immediately on panic
337BOARD_KERNEL_CMDLINE += panic=-1
338
339# Always enable one legacy serial port, for alternative earlycon, kgdb, and
340# serial console. Doesn't do anything on ARM/ARM64 + QEMU or Gem5.
341BOARD_KERNEL_CMDLINE += 8250.nr_uarts=1
342
343# Cuttlefish doesn't use CMA, so don't reserve RAM for it
344BOARD_KERNEL_CMDLINE += cma=0
345
346# Default firmware load path
347BOARD_KERNEL_CMDLINE += firmware_class.path=/vendor/etc/
348
349# Needed to boot Android
350BOARD_KERNEL_CMDLINE += loop.max_part=7
351BOARD_KERNEL_CMDLINE += init=/init
352
353# Enable KUnit for userdebug and eng builds
354ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
355  BOARD_KERNEL_CMDLINE += kunit.enable=1
356endif
357
358BOARD_BOOTCONFIG += androidboot.hardware=cutf_cvm
359
360# TODO(b/182417593): vsock transport is a module on some kernels and builtin
361# on others. To maintain the buffer size setting across these two configs,
362# the setting will remain in the bootconfig AND also the modules.options file.
363# Reduce slab size usage from virtio vsock to reduce slab fragmentation
364BOARD_BOOTCONFIG += \
365    kernel.vmw_vsock_virtio_transport_common.virtio_transport_max_vsock_pkt_buf_size=16384
366
367BOARD_BOOTCONFIG += \
368    androidboot.vendor.apex.com.google.emulated.camera.provider.hal=com.google.emulated.camera.provider.hal \
369
370BOARD_INCLUDE_DTB_IN_BOOTIMG := true
371ifndef BOARD_BOOT_HEADER_VERSION
372BOARD_BOOT_HEADER_VERSION := 4
373endif
374BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
375BOARD_INIT_BOOT_HEADER_VERSION := 4
376BOARD_MKBOOTIMG_INIT_ARGS += --header_version $(BOARD_INIT_BOOT_HEADER_VERSION)
377PRODUCT_COPY_FILES += \
378    device/google/cuttlefish/dtb.img:dtb.img \
379    device/google/cuttlefish/required_images:required_images \
380
381# GKI-related variables.
382BOARD_USES_GENERIC_KERNEL_IMAGE := true
383ifdef TARGET_DEDICATED_RECOVERY
384  BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE := true
385else ifneq ($(PRODUCT_BUILD_VENDOR_BOOT_IMAGE), false)
386  BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := true
387endif
388BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT := true
389
390BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD := dm-user.ko
391
392# Enable the new fingerprint format on cuttlefish
393BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT := true
394
395# Set AB OTA partitions based on the build configuration
396AB_OTA_UPDATER := true
397
398ifneq ($(PRODUCT_BUILD_VENDOR_IMAGE), false)
399AB_OTA_PARTITIONS += vendor
400AB_OTA_PARTITIONS += vendor_dlkm
401ifneq ($(BOARD_AVB_VBMETA_VENDOR_DLKM),)
402AB_OTA_PARTITIONS += vbmeta_vendor_dlkm
403endif
404endif
405ifneq ($(BOARD_AVB_VBMETA_SYSTEM_DLKM),)
406AB_OTA_PARTITIONS += vbmeta_system_dlkm
407endif
408
409ifneq ($(PRODUCT_BUILD_BOOT_IMAGE), false)
410AB_OTA_PARTITIONS += boot
411endif
412
413ifneq ($(PRODUCT_BUILD_INIT_BOOT_IMAGE), false)
414AB_OTA_PARTITIONS += init_boot
415endif
416
417ifneq ($(PRODUCT_BUILD_VENDOR_BOOT_IMAGE), false)
418AB_OTA_PARTITIONS += vendor_boot
419endif
420
421ifneq ($(PRODUCT_BUILD_ODM_IMAGE), false)
422AB_OTA_PARTITIONS += odm
423AB_OTA_PARTITIONS += odm_dlkm
424endif
425
426ifneq ($(PRODUCT_BUILD_PRODUCT_IMAGE), false)
427AB_OTA_PARTITIONS += product
428endif
429
430ifneq ($(PRODUCT_BUILD_SYSTEM_IMAGE), false)
431AB_OTA_PARTITIONS += system
432AB_OTA_PARTITIONS += system_dlkm
433ifneq ($(PRODUCT_BUILD_VBMETA_IMAGE), false)
434AB_OTA_PARTITIONS += vbmeta_system
435endif
436endif
437
438ifneq ($(PRODUCT_BUILD_SYSTEM_EXT_IMAGE), false)
439AB_OTA_PARTITIONS += system_ext
440endif
441
442ifneq ($(PRODUCT_BUILD_VBMETA_IMAGE), false)
443AB_OTA_PARTITIONS += vbmeta
444endif
445