-
Notifications
You must be signed in to change notification settings - Fork 2
/
device-common.mk
92 lines (76 loc) · 2.71 KB
/
device-common.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#
# Copyright (C) 2024 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
# Inherit from common
$(call inherit-product, device/virt/virt-common/virt-common.mk)
# Graphics (Composer)
PRODUCT_PACKAGES += \
android.hardware.graphics.composer@2.4-service \
hwcomposer.drm
PRODUCT_VENDOR_PROPERTIES += \
ro.hardware.hwcomposer=drm
# Graphics (Gralloc)
PRODUCT_PACKAGES += \
android.hardware.graphics.allocator-service.minigbm \
android.hardware.graphics.mapper@4.0-impl.minigbm \
gralloc.minigbm \
mapper.minigbm
# Graphics (Mesa)
ifneq ($(wildcard external/mesa/android/Android.mk),)
PRODUCT_PACKAGES += \
libEGL_mesa \
libGLESv1_CM_mesa \
libGLESv2_mesa \
libgallium_dri \
libglapi
$(foreach vk_drv, virtio, \
$(eval PRODUCT_PACKAGES += vulkan.$(vk_drv)))
PRODUCT_VENDOR_PROPERTIES += \
ro.vendor.graphics.mesa.is_upstream=true
else
PRODUCT_PACKAGES += \
libGLES_mesa
PRODUCT_VENDOR_PROPERTIES += \
ro.vendor.graphics.mesa.is_upstream=false
PRODUCT_SOONG_NAMESPACES += \
external/mesa3d
endif
# Init
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/init/init.virtio.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.virtio.rc
PRODUCT_PACKAGES += \
fstab.virtio \
fstab.virtio.gsi.sda \
fstab.virtio.gsi.vdc
# Input
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/.emptyfile:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/QEMU_QEMU_USB_Tablet.kl \
$(LOCAL_PATH)/configs/.emptyfile:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/QEMU_Virtio_Tablet.kl
# Kernel
TARGET_PREBUILT_KERNEL_USE ?= 6.1
TARGET_PREBUILT_KERNEL_DIR := device/virt/kernel-virtio/$(TARGET_PREBUILT_KERNEL_USE)/$(TARGET_PREBUILT_KERNEL_ARCH)
TARGET_KERNEL_SOURCE := kernel/virt/virtio
ifneq ($(wildcard $(TARGET_KERNEL_SOURCE)/Makefile),)
$(warning Using source built kernel)
else ifneq ($(wildcard $(TARGET_PREBUILT_KERNEL_DIR)/kernel),)
PRODUCT_COPY_FILES += $(TARGET_PREBUILT_KERNEL_DIR)/kernel:kernel
$(warning Using prebuilt kernel from $(TARGET_PREBUILT_KERNEL_DIR)/kernel)
else
KERNEL_ARTIFACTS_PATH := kernel/prebuilts/$(TARGET_PREBUILT_EMULATOR_KERNEL_USE)/$(TARGET_PREBUILT_KERNEL_ARCH)
EMULATOR_KERNEL_FILE := $(KERNEL_ARTIFACTS_PATH)/kernel-$(TARGET_PREBUILT_EMULATOR_KERNEL_USE)
PRODUCT_COPY_FILES += $(EMULATOR_KERNEL_FILE):kernel
$(warning Using prebuilt kernel from $(EMULATOR_KERNEL_FILE))
endif
# Recovery
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/init/init.recovery.virtio.rc:$(TARGET_COPY_OUT_RECOVERY)/root/init.recovery.virtio.rc
# Soong namespaces
PRODUCT_SOONG_NAMESPACES += \
$(LOCAL_PATH)
# Vendor ramdisk
PRODUCT_PACKAGES += \
fstab.virtio.vendor_ramdisk \
fstab.virtio.gsi.sda.vendor_ramdisk \
fstab.virtio.gsi.vdc.vendor_ramdisk