-
Notifications
You must be signed in to change notification settings - Fork 0
/
BoardConfigVirtCommon.mk
149 lines (121 loc) · 4.43 KB
/
BoardConfigVirtCommon.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#
# Copyright (C) 2024 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
USES_DEVICE_VIRT_VIRT_COMMON := true
VIRT_COMMON_PATH := device/virt/virt-common
# Bootloader
BOARD_BOOT_HEADER_VERSION := 3
BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
TARGET_NO_BOOTLOADER := true
# Fastboot
TARGET_BOARD_FASTBOOT_INFO_FILE := $(VIRT_COMMON_PATH)/fastboot-info.txt
# Filesystem
BOARD_EXT4_SHARE_DUP_BLOCKS :=
BOARD_EROFS_COMPRESSOR := none
BOARD_EROFS_SHARE_DUP_BLOCKS := true
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
TARGET_USERIMAGES_USE_F2FS := true
TARGET_USERIMAGES_USE_EXT4 := true
# Graphics (Swiftshader)
include device/google/cuttlefish/shared/swiftshader/BoardConfig.mk
# Init
TARGET_INIT_VENDOR_LIB ?= //$(VIRT_COMMON_PATH):init_virt
TARGET_RECOVERY_DEVICE_MODULES ?= init_virt
# Kernel
BOARD_KERNEL_CMDLINE := \
log_buf_len=4M \
loop.max_part=7 \
printk.devkmsg=on \
rw \
androidboot.boot_devices=any \
androidboot.first_stage_console=0 \
androidboot.verifiedbootstate=orange
ifneq ($(wildcard $(TARGET_KERNEL_SOURCE)/Makefile),)
BOARD_VENDOR_KERNEL_MODULES_LOAD := \
btusb.ko \
cfg80211.ko \
virt_wifi.ko
TARGET_KERNEL_CONFIG := \
gki_defconfig \
lineageos/peripheral/bluetooth.config \
lineageos/peripheral/wifi.config \
lineageos/feature/fbcon.config
endif
# Partitions
BOARD_FLASH_BLOCK_SIZE := 4096
BOARD_USES_METADATA_PARTITION := true
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_CACHEIMAGE_PARTITION_SIZE := 52428800 # 50 MB
DLKM_PARTITIONS := system_dlkm vendor_dlkm
SSI_PARTITIONS := product system system_ext
TREBLE_PARTITIONS := odm vendor
ALL_PARTITIONS := $(DLKM_PARTITIONS) $(SSI_PARTITIONS) $(TREBLE_PARTITIONS)
$(foreach p, $(DLKM_PARTITIONS), \
$(eval BOARD_USES_$(call to-upper, $(p))IMAGE := true))
TARGET_LOGICAL_PARTITIONS_FILE_SYSTEM_TYPE ?= ext4
ifeq ($(TARGET_LOGICAL_PARTITIONS_FILE_SYSTEM_TYPE),ext4)
BOARD_SUPER_PARTITION_SIZE := 4294967296 # 4 GB
BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := 8192
BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT := 6144
BOARD_SYSTEM_EXTIMAGE_EXTFS_INODE_COUNT := 4096
BOARD_VENDORIMAGE_EXTFS_INODE_COUNT := 2048
BOARD_ODMIMAGE_EXTFS_INODE_COUNT := 1024
$(foreach p, $(call to-upper, $(SSI_PARTITIONS) $(TREBLE_PARTITIONS)), \
$(eval BOARD_$(p)IMAGE_PARTITION_RESERVED_SIZE := 134217728)) # 128 MB
ifneq ($(WITH_GMS),true)
BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE := 1073741824 # 1 GB
endif
else ifeq ($(TARGET_LOGICAL_PARTITIONS_FILE_SYSTEM_TYPE),erofs)
BOARD_SUPER_PARTITION_SIZE := 3221225472 # 3 GB
else
$(error TARGET_LOGICAL_PARTITIONS_FILE_SYSTEM_TYPE is invalid)
endif
BOARD_SUPER_PARTITION_GROUPS := virt_dynamic_partitions
BOARD_VIRT_DYNAMIC_PARTITIONS_PARTITION_LIST := $(ALL_PARTITIONS)
BOARD_VIRT_DYNAMIC_PARTITIONS_SIZE := $(shell expr $(BOARD_SUPER_PARTITION_SIZE) - 4194304 )
$(foreach p, $(call to-upper, $(ALL_PARTITIONS)), \
$(eval BOARD_$(p)IMAGE_FILE_SYSTEM_TYPE := $(TARGET_LOGICAL_PARTITIONS_FILE_SYSTEM_TYPE)) \
$(eval TARGET_COPY_OUT_$(p) := $(call to-lower, $(p))))
ifneq ($(TARGET_BOOT_MANAGER),)
BOARD_CUSTOMIMAGES_PARTITION_LIST := EFI
BOARD_EFI_IMAGE_LIST := $(PRODUCT_OUT)/obj/CUSTOM_IMAGES/EFI.img
endif
# Platform
TARGET_BOARD_PLATFORM := virt
# Properties
TARGET_PRODUCT_PROP := $(VIRT_COMMON_PATH)/properties/product.prop
TARGET_VENDOR_PROP := $(VIRT_COMMON_PATH)/properties/vendor.prop
ifneq ($(PRODUCT_IS_ATV),true)
ifneq ($(PRODUCT_IS_AUTOMOTIVE),true)
TARGET_VENDOR_PROP += \
$(VIRT_COMMON_PATH)/properties/vendor_bluetooth_profiles.prop
endif
endif
# Ramdisk
BOARD_RAMDISK_USE_LZ4 := true
# Recovery
TARGET_RECOVERY_UI_LIB := librecovery_ui_virt
# Releasetools
TARGET_RELEASETOOLS_EXTENSIONS := $(VIRT_COMMON_PATH)
# RIL
ENABLE_VENDOR_RIL_SERVICE := true
# Security patch level
VENDOR_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH)
# SELinux
BOARD_VENDOR_SEPOLICY_DIRS := \
$(VIRT_COMMON_PATH)/sepolicy/vendor \
device/google/cuttlefish/shared/graphics/sepolicy \
device/google/cuttlefish/shared/swiftshader/sepolicy \
device/google/cuttlefish/shared/virgl/sepolicy \
external/minigbm/cros_gralloc/sepolicy
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(VIRT_COMMON_PATH)/sepolicy/private
# VINTF
DEVICE_MANIFEST_FILE := \
$(VIRT_COMMON_PATH)/config/manifest.xml
# Wi-Fi
BOARD_HOSTAPD_DRIVER := NL80211
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true
WPA_SUPPLICANT_VERSION := VER_0_8_X