1#
2# Copyright (C) 2023 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# we do NOT support OTA - suppress the build warning
18PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS := false
19
20TARGET_KERNEL_USE ?= 6.6
21KERNEL_ARTIFACTS_PATH := kernel/prebuilts/$(TARGET_KERNEL_USE)/arm64
22VIRTUAL_DEVICE_KERNEL_MODULES_PATH := \
23    kernel/prebuilts/common-modules/virtual-device/$(TARGET_KERNEL_USE)/arm64
24
25# The list of modules to reach the second stage. For performance reasons we
26# don't want to put all modules into the ramdisk.
27RAMDISK_KERNEL_MODULES := \
28    virtio_dma_buf.ko \
29    virtio_mmio.ko \
30    virtio-rng.ko \
31
32RAMDISK_SYSTEM_KERNEL_MODULES += \
33    virtio_blk.ko \
34    virtio_console.ko \
35    virtio_pci.ko \
36    virtio_pci_legacy_dev.ko \
37    virtio_pci_modern_dev.ko \
38    vmw_vsock_virtio_transport.ko \
39
40BOARD_SYSTEM_KERNEL_MODULES := $(wildcard $(KERNEL_ARTIFACTS_PATH)/*.ko)
41
42BOARD_VENDOR_RAMDISK_KERNEL_MODULES := \
43    $(wildcard $(patsubst %,$(VIRTUAL_DEVICE_KERNEL_MODULES_PATH)/%,$(RAMDISK_KERNEL_MODULES))) \
44    $(wildcard $(patsubst %,$(KERNEL_ARTIFACTS_PATH)/%,$(RAMDISK_SYSTEM_KERNEL_MODULES)))
45
46BOARD_VENDOR_KERNEL_MODULES := \
47    $(filter-out $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES),\
48                 $(wildcard $(VIRTUAL_DEVICE_KERNEL_MODULES_PATH)/*.ko))
49
50BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := \
51    device/generic/goldfish/board/kernel/kernel_modules.blocklist
52
53BOARD_DO_NOT_STRIP_VENDOR_RAMDISK_MODULES := true
54
55EMULATOR_KERNEL_FILE := $(KERNEL_ARTIFACTS_PATH)/kernel-$(TARGET_KERNEL_USE)-gz
56
57# BOARD_KERNEL_CMDLINE is not supported (b/361341981), use the file below
58PRODUCT_COPY_FILES += \
59    device/generic/goldfish/board/kernel/arm64_cmdline.txt:kernel_cmdline.txt
60