blob: 0b549f9acf52220c36f74326ab40d416946fd14b [file] [log] [blame]
Amit Pundir4e375822019-04-18 16:46:10 +05301#
Peter Collingbournee8b96e32022-02-02 11:38:11 -08002# Copyright (C) 2022 The Android Open-Source Project
Amit Pundir4e375822019-04-18 16:46:10 +05303#
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
Peter Collingbournee8b96e32022-02-02 11:38:11 -080017TARGET_KERNEL_DIR ?= device/linaro/dragonboard-kernel/android-$(TARGET_KERNEL_USE)
Amit Pundir07776a32023-08-16 23:29:35 +053018TARGET_MODS := $(wildcard $(TARGET_KERNEL_DIR)/*.ko)
John Stultzfa0fa162020-02-06 23:14:28 +000019
Amit Pundir07776a32023-08-16 23:29:35 +053020BOARD_DO_NOT_STRIP_VENDOR_RAMDISK_MODULES := true
Amit Pundirdc570232024-01-11 13:07:10 +053021BOARD_DO_NOT_STRIP_GENERIC_RAMDISK_MODULES := true
22ifeq ($(TARGET_SDCARD_BOOT), true)
Amit Pundir4f6e7bf2024-06-26 12:00:32 +053023 # Do not copy UFS kernel module in vendor_dlkm.img
Amit Pundirdc570232024-01-11 13:07:10 +053024 # UFS module filename varies from ufs_qcom.ko to ufs-qcom.ko across different kernel versions
Amit Pundir4f6e7bf2024-06-26 12:00:32 +053025 UFS_MODULE := $(wildcard $(TARGET_KERNEL_DIR)/ufs*qcom.ko)
Amit Pundir6729a6c2024-12-30 13:54:56 +053026ifeq ($(TARGET_USES_GBL), true)
27 BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(filter-out $(UFS_MODULE),$(TARGET_MODS))
28else
Amit Pundir4f6e7bf2024-06-26 12:00:32 +053029 BOARD_GENERIC_RAMDISK_KERNEL_MODULES := $(filter-out $(UFS_MODULE),$(TARGET_MODS))
Amit Pundir6729a6c2024-12-30 13:54:56 +053030endif
Amit Pundir94ccdd92024-02-20 17:50:31 +053031else ifeq ($(TARGET_USES_LMP), true)
32 include device/linaro/dragonboard/shared/utils/dlkm_loader/vendor.modules.list.mk
33 BOARD_VENDOR_KERNEL_MODULES := $(patsubst %,$(TARGET_KERNEL_DIR)/%,$(VENDOR_DLKM_KERNEL_MODULES_LIST))
34 BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(patsubst %,$(TARGET_KERNEL_DIR)/%,$(VENDOR_RAMDISK_KERNEL_MODULES_LIST))
35 BOARD_SYSTEM_KERNEL_MODULES := $(filter-out $(BOARD_VENDOR_KERNEL_MODULES) $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES), $(wildcard $(TARGET_KERNEL_DIR)/*.ko))
Amit Pundirdc570232024-01-11 13:07:10 +053036else
37 BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(TARGET_MODS)
38endif
Amit Pundir4e375822019-04-18 16:46:10 +053039
Yongqin Liubfcd3732025-01-09 05:47:48 -080040PRODUCT_SHIPPING_API_LEVEL := 33
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053041
42# Check vendor package version
43# If you need to make changes to the vendor partition,
44# please modify the source git project here:
Sumit Semwal210c79d2024-07-23 13:32:04 +053045# https://source.devboardsforandroid.linaro.org/linaro-vendor-package/
Peter Collingbournee8b96e32022-02-02 11:38:11 -080046include device/linaro/dragonboard/vendor-package-ver.mk
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053047ifneq (,$(wildcard $(LINARO_VENDOR_PATH)/db845c/$(EXPECTED_LINARO_VENDOR_VERSION)/version.mk))
48 # Unfortunately inherit-product doesn't export build variables from the
49 # called make file to the caller, so we have to include it directly here.
50 include $(LINARO_VENDOR_PATH)/db845c/$(EXPECTED_LINARO_VENDOR_VERSION)/version.mk
51 ifneq ($(TARGET_LINARO_VENDOR_VERSION), $(EXPECTED_LINARO_VENDOR_VERSION))
52 $(warning TARGET_LINARO_VENDOR_VERSION ($(TARGET_LINARO_VENDOR_VERSION)) does not match exiting the build ($(EXPECTED_LINARO_VENDOR_VERSION)).)
Amit Pundire23d6722022-07-05 18:31:03 +053053 $(warning Please download and extract the new binaries by running the following script:)
54 $(warning ./device/linaro/dragonboard/fetch-vendor-package.sh )
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053055 # Would be good to error out here, but that causes other issues
56 endif
57else
58 $(warning Missing Linaro Vendor Package!)
Amit Pundire23d6722022-07-05 18:31:03 +053059 $(warning Please download and extract the vendor binaries by running the following script:)
60 $(warning ./device/linaro/dragonboard/fetch-vendor-package.sh )
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053061 # Would be good to error out here, but that causes other issues
62endif
63
Amit Pundirb192c972021-11-18 14:22:47 +053064PRODUCT_SOONG_NAMESPACES += \
65 device/linaro/dragonboard \
Amit Pundir701031f2024-03-18 14:42:18 +053066 vendor/linaro/shared/$(EXPECTED_LINARO_VENDOR_VERSION)/linux-firmware
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053067
Peter Collingbournee8b96e32022-02-02 11:38:11 -080068# Dynamic partitions
69PRODUCT_BUILD_SUPER_PARTITION := true
70PRODUCT_USE_DYNAMIC_PARTITIONS := true
71PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true
72
73# Enable Virtual A/B
74AB_OTA_UPDATER := true
75AB_OTA_PARTITIONS += \
76 product \
77 system \
78 system_ext \
79 vendor
80
Amit Pundirdc570232024-01-11 13:07:10 +053081ifeq ($(TARGET_SDCARD_BOOT), true)
82 ifneq ($(filter 5.4 5.10 5.15, $(TARGET_KERNEL_USE)),)
83 PRODUCT_COPY_FILES += \
84 device/linaro/dragonboard/shared/utils/sdcard-boot/fstab.sdhci:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.$(TARGET_HARDWARE) \
85 device/linaro/dragonboard/shared/utils/sdcard-boot/fstab.sdhci:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.$(TARGET_HARDWARE)
86 else
87 PRODUCT_COPY_FILES += \
88 device/linaro/dragonboard/shared/utils/sdcard-boot/fstab.mmc:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.$(TARGET_HARDWARE) \
89 device/linaro/dragonboard/shared/utils/sdcard-boot/fstab.mmc:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.$(TARGET_HARDWARE)
90 endif
91else
92 PRODUCT_COPY_FILES += \
93 device/linaro/dragonboard/fstab.common:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.$(TARGET_HARDWARE) \
94 device/linaro/dragonboard/fstab.common:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.$(TARGET_HARDWARE)
95endif
96
Amit Pundirab98c6c2024-02-08 23:18:26 +053097PRODUCT_VENDOR_PROPERTIES += \
98 persist.sys.zram_enabled=1
99
Peter Collingbournee8b96e32022-02-02 11:38:11 -0800100PRODUCT_COPY_FILES += \
101 $(TARGET_KERNEL_DIR)/Image.gz:kernel \
Peter Collingbournee8b96e32022-02-02 11:38:11 -0800102 device/linaro/dragonboard/init.common.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.$(TARGET_HARDWARE).rc \
103 device/linaro/dragonboard/init.common.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.$(TARGET_HARDWARE).usb.rc \
Amit Pundir7f72e1e2022-10-01 11:07:59 +0530104 frameworks/base/data/keyboards/Generic.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/$(TARGET_HARDWARE).kl
Yongqin Liu44956f22024-02-26 12:19:41 +0800105
106# Workaround for the drop of OMX service
107PRODUCT_VENDOR_PROPERTIES += \
108 debug.stagefright.c2inputsurface=-1