# # Copyright 2017 The Android Open-Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #
# # Common BoardConfig for all supported architectures. #
# Some targets still require 32 bit, and 6.6 kernels don't support # 32 bit devices
# This check prevents the $(shell grep ...) subexpression below from printing # "grep: ... No such file or directory" to stdout. Explanation: # # - For some reason BOARD_KERNEL_VERSION seems to be evaluated twice, once # before the RELEASE_KERNEL_CUTTLEFISH_* variables are loaded, and again # after they are loaded. The first evaluation results in KERNEL_MODULES_PATH # having an invalid path, causing grep to fail with the above message. # # - The build still works without this workaround (e.g. "m" and "m dist" # complete successfully). The goal of the workaround is just to prevent the # spurious grep error message. # # - The check uses the RELEASE_KERNEL_CUTTLEFISH_X86_64_VERSION variable, which # was chosen arbirarily. Any other RELEASE_KERNEL_CUTTLEFISH_* flag works, # even when building for Arm64. ifneq (,$(RELEASE_KERNEL_CUTTLEFISH_X86_64_VERSION))
BOARD_KERNEL_VERSION := $(word 1,$(subst vermagic=,,$(shell grep -E -h -ao -m 1'vermagic=.*' $(KERNEL_MODULES_PATH)/nd_virtio.ko))) endif
# The list of modules strictly/only required either to reach second stage # init, OR for recovery. Do not use this list to workaround second stage # issues.
RAMDISK_KERNEL_MODULES ?= \
failover.ko \
nd_virtio.ko \
net_failover.ko \
virtio_dma_buf.ko \
virtio-gpu.ko \
virtio_input.ko \
virtio_net.ko \
virtio-rng.ko \
# TODO(b/294888357) once virt_wifi is deprecated we can stop loading mac80211 in # first stage init. To minimize scope of modules options to first stage init, # mac80211_hwsim.radios=0 has to be specified in the modules options file (which we # only read in first stage) and mac80211_hwsim has to be loaded in first stage consequently..
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(SYSTEM_DLKM_SRC)/cfg80211.ko)
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(SYSTEM_DLKM_SRC)/libarc4.ko)
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(SYSTEM_DLKM_SRC)/mac80211.ko)
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(SYSTEM_DLKM_SRC)/rfkill.ko)
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(KERNEL_MODULES_PATH)/cfg80211.ko)
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(KERNEL_MODULES_PATH)/libarc4.ko)
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(KERNEL_MODULES_PATH)/mac80211.ko)
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(KERNEL_MODULES_PATH)/mac80211_hwsim.ko)
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(KERNEL_MODULES_PATH)/rfkill.ko)
# virtio_blk/console/pci.ko + vmw_vsock_virtio_transport.ko are moved to # SYSTEM_DLKM_SRC (from KERNEL_MODULES_PATH), but exist under both paths in # some early kernel 6.6 prebuilt drops. ifeq ($(TARGET_KERNEL_USE),6.1)
SYSTEM_VIRTIO_PREBUILTS_PATH ?= $(KERNEL_MODULES_PATH) else
SYSTEM_VIRTIO_PREBUILTS_PATH ?= $(SYSTEM_DLKM_SRC) endif
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(SYSTEM_VIRTIO_PREBUILTS_PATH)/virtio_blk.ko
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(SYSTEM_VIRTIO_PREBUILTS_PATH)/virtio_console.ko
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(SYSTEM_VIRTIO_PREBUILTS_PATH)/virtio_pci.ko
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(SYSTEM_VIRTIO_PREBUILTS_PATH)/vmw_vsock_virtio_transport.ko
# GKI >5.15 will have and require virtio_pci_legacy_dev.ko
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(SYSTEM_VIRTIO_PREBUILTS_PATH)/virtio_pci_legacy_dev.ko) # GKI >5.10 will have and require virtio_pci_modern_dev.ko
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(wildcard $(SYSTEM_VIRTIO_PREBUILTS_PATH)/virtio_pci_modern_dev.ko) # GKI >6.4 will have an required vmw_vsock_virtio_transport_common.ko and vsock.ko
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
$(wildcard $(SYSTEM_VIRTIO_PREBUILTS_PATH)/vmw_vsock_virtio_transport_common.ko) \
$(wildcard $(SYSTEM_VIRTIO_PREBUILTS_PATH)/vsock.ko)
include build/make/target/board/BoardConfigMainlineCommon.mk
# For now modules are only blocked in second stage init. # If a module ever needs to blocked in first stage init - add a new blocklist to # BOARD_VENDOR_RAMDISK_KERNEL_MODULES_BLOCKLIST_FILE ifeq ($(TARGET_KERNEL_ARCH),arm64)
BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := \
device/google/cuttlefish/shared/modules_aarch64.blocklist else
BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := \
device/google/cuttlefish/shared/modules.blocklist endif
# Boot partition size: 64M # This is only used for OTA update packages. The image size on disk # will not change (as is it not a filesystem.)
BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864
ifdef TARGET_DEDICATED_RECOVERY
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 67108864 endif
BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 67108864
# init_boot partition size is recommended to be 8MB, it can be larger. # When this variable is set, init_boot.img will be built with the generic # ramdisk, and that ramdisk will no longer be included in boot.img.
BOARD_INIT_BOOT_IMAGE_PARTITION_SIZE := 8388608
# Build a separate vendor.img partition
BOARD_USES_VENDORIMAGE := true
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
BOARD_USES_METADATA_PARTITION := true
# Build a separate product.img partition
BOARD_USES_PRODUCTIMAGE := true
BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
# Build a separate system_ext.img partition
BOARD_USES_SYSTEM_EXTIMAGE := true
BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
TARGET_COPY_OUT_SYSTEM_EXT := system_ext
# Build a separate odm.img partition
BOARD_USES_ODMIMAGE := true
BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
TARGET_COPY_OUT_ODM := odm
# Build a separate vendor_dlkm partition
BOARD_USES_VENDOR_DLKMIMAGE := true
BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
TARGET_COPY_OUT_VENDOR_DLKM := vendor_dlkm
# Build a separate odm_dlkm partition
BOARD_USES_ODM_DLKMIMAGE := true
BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
TARGET_COPY_OUT_ODM_DLKM := odm_dlkm
# Build a separate system_dlkm partition
BOARD_USES_SYSTEM_DLKMIMAGE := true
BOARD_SYSTEM_DLKMIMAGE_FILE_SYSTEM_TYPE := $(TARGET_RO_FILE_SYSTEM_TYPE)
TARGET_COPY_OUT_SYSTEM_DLKM := system_dlkm
BOARD_SYSTEM_KERNEL_MODULES := $(wildcard $(SYSTEM_DLKM_SRC)/*.ko)
# Using sha256 for dm-verity partitions. b/178983355 # system, system_other, product.
TARGET_AVB_SYSTEM_HASHTREE_ALGORITHM ?= sha256
TARGET_AVB_SYSTEM_OTHER_HASHTREE_ALGORITHM ?= sha256
TARGET_AVB_PRODUCT_HASHTREE_ALGORITHM ?= sha256 # Using blake2b-256 for system_ext. This give us move coverage of the # algorithms as we otherwise don't have a device using blake2b-256.
TARGET_AVB_SYSTEM_EXT_HASHTREE_ALGORITHM ?= blake2b-256
# The compiler will occasionally generate movaps, etc.
BOARD_MALLOC_ALIGNMENT := 16
# Enable sparse on all filesystem images
TARGET_USERIMAGES_SPARSE_EROFS_DISABLED ?= false
TARGET_USERIMAGES_SPARSE_EXT_DISABLED ?= false
TARGET_USERIMAGES_SPARSE_F2FS_DISABLED ?= false
# Make the userdata partition 8G to accommodate ASAN, CTS and provide # enough space for other cases (such as remount, etc)
BOARD_USERDATAIMAGE_PARTITION_SIZE := $(TARGET_USERDATAIMAGE_PARTITION_SIZE)
BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := $(TARGET_USERDATAIMAGE_FILE_SYSTEM_TYPE)
$(call soong_config_append,cvdhost,default_userdata_fs_type,$(TARGET_USERDATAIMAGE_FILE_SYSTEM_TYPE)) ifeq ($(TARGET_USERDATAIMAGE_FILE_SYSTEM_TYPE),f2fs)
TARGET_USERIMAGES_USE_F2FS := true endif ifeq ($(TARGET_USERDATAIMAGE_FILE_SYSTEM_TYPE),ext4)
TARGET_USERIMAGES_USE_EXT4 := true endif
# Enable goldfish's encoder. # TODO(b/113617962) Remove this if we decide to use # device/generic/opengl-transport to generate the encoder
BUILD_EMULATOR_OPENGL_DRIVER := true
BUILD_EMULATOR_OPENGL := true
# Minimum size of the final bootable disk image: 10G # GCE will pad disk images out to 10G. Our disk images should be at least as # big to avoid warnings about partition table oddities.
BOARD_DISK_IMAGE_MINIMUM_SIZE := 10737418240
BOARD_BOOTIMAGE_MAX_SIZE := 8388608
BOARD_SYSLOADER_MAX_SIZE := 7340032 # TODO(san): See if we can get rid of this.
BOARD_FLASH_BLOCK_SIZE := 512
# Generate a partial ota update package for partitions in vbmeta_system
BOARD_PARTIAL_OTA_UPDATE_PARTITIONS_LIST := $(BOARD_AVB_VBMETA_SYSTEM) vbmeta_system init_boot
# To see full logs from init, disable ratelimiting. # The default is 5 messages per second amortized, with a burst of up to 10.
BOARD_KERNEL_CMDLINE += printk.devkmsg=on
# Print audit messages for all security check failures
BOARD_KERNEL_CMDLINE += audit=1
# Reboot immediately on panic
BOARD_KERNEL_CMDLINE += panic=-1
# Always enable one legacy serial port, for alternative earlycon, kgdb, and # serial console. Doesn't do anything on ARM/ARM64 + QEMU or Gem5.
BOARD_KERNEL_CMDLINE += 8250.nr_uarts=1
# Enable rust_binder explicitly, because the prop + reboot system doesn't work for # cuttlefish.
BOARD_KERNEL_CMDLINE += binder.impl=rust
# Cuttlefish doesn't use CMA, so don't reserve RAM for it
BOARD_KERNEL_CMDLINE += cma=0
# TODO(b/182417593): vsock transport is a module on some kernels and builtin # on others. To maintain the buffer size setting across these two configs, # the setting will remain in the bootconfig AND also the modules.options file. # Reduce slab size usage from virtio vsock to reduce slab fragmentation
BOARD_BOOTCONFIG += \
kernel.vmw_vsock_virtio_transport_common.virtio_transport_max_vsock_pkt_buf_size=16384
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.