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_blk.ko \
29    virtio_console.ko \
30    virtio_dma_buf.ko \
31    virtio_mmio.ko \
32    virtio_pci.ko \
33    virtio_pci_legacy_dev.ko \
34    virtio_pci_modern_dev.ko \
35    virtio-rng.ko \
36    vmw_vsock_virtio_transport.ko \
37
38BOARD_SYSTEM_KERNEL_MODULES := $(wildcard $(KERNEL_ARTIFACTS_PATH)/*.ko)
39
40BOARD_VENDOR_RAMDISK_KERNEL_MODULES := \
41    $(patsubst %,$(VIRTUAL_DEVICE_KERNEL_MODULES_PATH)/%,$(RAMDISK_KERNEL_MODULES))
42
43BOARD_VENDOR_KERNEL_MODULES := \
44    $(filter-out $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES),\
45                 $(wildcard $(VIRTUAL_DEVICE_KERNEL_MODULES_PATH)/*.ko))
46
47BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := \
48    device/generic/goldfish/board/kernel/kernel_modules.blocklist
49
50EMULATOR_KERNEL_FILE := $(KERNEL_ARTIFACTS_PATH)/kernel-$(TARGET_KERNEL_USE)-gz
51