blob: 10f01eb5c689cb5a742f7d89db0798dc37d3df74 [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)
23 # UFS module filename varies from ufs_qcom.ko to ufs-qcom.ko across different kernel versions
24 BOARD_VENDOR_KERNEL_MODULES := $(wildcard $(TARGET_KERNEL_DIR)/ufs*qcom.ko)
25 BOARD_GENERIC_RAMDISK_KERNEL_MODULES := $(filter-out $(BOARD_VENDOR_KERNEL_MODULES),$(TARGET_MODS))
26else
27 BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(TARGET_MODS)
28endif
Amit Pundir4e375822019-04-18 16:46:10 +053029
Yongqin Liu183f6a72024-01-30 21:44:11 +080030PRODUCT_SHIPPING_API_LEVEL := 33
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053031
32# Check vendor package version
33# If you need to make changes to the vendor partition,
34# please modify the source git project here:
35# https://staging-git.codelinaro.org/linaro/linaro-aosp/aosp-linaro-vendor-package
Peter Collingbournee8b96e32022-02-02 11:38:11 -080036include device/linaro/dragonboard/vendor-package-ver.mk
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053037ifneq (,$(wildcard $(LINARO_VENDOR_PATH)/db845c/$(EXPECTED_LINARO_VENDOR_VERSION)/version.mk))
38 # Unfortunately inherit-product doesn't export build variables from the
39 # called make file to the caller, so we have to include it directly here.
40 include $(LINARO_VENDOR_PATH)/db845c/$(EXPECTED_LINARO_VENDOR_VERSION)/version.mk
41 ifneq ($(TARGET_LINARO_VENDOR_VERSION), $(EXPECTED_LINARO_VENDOR_VERSION))
42 $(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 +053043 $(warning Please download and extract the new binaries by running the following script:)
44 $(warning ./device/linaro/dragonboard/fetch-vendor-package.sh )
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053045 # Would be good to error out here, but that causes other issues
46 endif
47else
48 $(warning Missing Linaro Vendor Package!)
Amit Pundire23d6722022-07-05 18:31:03 +053049 $(warning Please download and extract the vendor binaries by running the following script:)
50 $(warning ./device/linaro/dragonboard/fetch-vendor-package.sh )
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053051 # Would be good to error out here, but that causes other issues
52endif
53
Amit Pundirb192c972021-11-18 14:22:47 +053054PRODUCT_SOONG_NAMESPACES += \
55 device/linaro/dragonboard \
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053056 vendor/linaro/linux-firmware/$(EXPECTED_LINARO_VENDOR_VERSION) \
57 vendor/linaro/db845c/$(EXPECTED_LINARO_VENDOR_VERSION) \
58 vendor/linaro/rb5/$(EXPECTED_LINARO_VENDOR_VERSION)
59
Peter Collingbournee8b96e32022-02-02 11:38:11 -080060# Dynamic partitions
61PRODUCT_BUILD_SUPER_PARTITION := true
62PRODUCT_USE_DYNAMIC_PARTITIONS := true
63PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true
64
65# Enable Virtual A/B
66AB_OTA_UPDATER := true
67AB_OTA_PARTITIONS += \
68 product \
69 system \
70 system_ext \
71 vendor
72
Amit Pundirdc570232024-01-11 13:07:10 +053073ifeq ($(TARGET_SDCARD_BOOT), true)
74 ifneq ($(filter 5.4 5.10 5.15, $(TARGET_KERNEL_USE)),)
75 PRODUCT_COPY_FILES += \
76 device/linaro/dragonboard/shared/utils/sdcard-boot/fstab.sdhci:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.$(TARGET_HARDWARE) \
77 device/linaro/dragonboard/shared/utils/sdcard-boot/fstab.sdhci:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.$(TARGET_HARDWARE)
78 else
79 PRODUCT_COPY_FILES += \
80 device/linaro/dragonboard/shared/utils/sdcard-boot/fstab.mmc:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.$(TARGET_HARDWARE) \
81 device/linaro/dragonboard/shared/utils/sdcard-boot/fstab.mmc:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.$(TARGET_HARDWARE)
82 endif
83else
84 PRODUCT_COPY_FILES += \
85 device/linaro/dragonboard/fstab.common:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.$(TARGET_HARDWARE) \
86 device/linaro/dragonboard/fstab.common:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.$(TARGET_HARDWARE)
87endif
88
Peter Collingbournee8b96e32022-02-02 11:38:11 -080089PRODUCT_COPY_FILES += \
90 $(TARGET_KERNEL_DIR)/Image.gz:kernel \
Peter Collingbournee8b96e32022-02-02 11:38:11 -080091 device/linaro/dragonboard/init.common.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.$(TARGET_HARDWARE).rc \
92 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 +053093 frameworks/base/data/keyboards/Generic.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/$(TARGET_HARDWARE).kl