• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (C) 2022 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
17TARGET_KERNEL_DIR ?= device/linaro/dragonboard-kernel/android-$(TARGET_KERNEL_USE)
18TARGET_MODS := $(wildcard $(TARGET_KERNEL_DIR)/*.ko)
19
20BOARD_DO_NOT_STRIP_VENDOR_RAMDISK_MODULES := true
21BOARD_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 ifeq ($(TARGET_USES_LMP), true)
27    include device/linaro/dragonboard/shared/utils/dlkm_loader/vendor.modules.list.mk
28    BOARD_VENDOR_KERNEL_MODULES := $(patsubst %,$(TARGET_KERNEL_DIR)/%,$(VENDOR_DLKM_KERNEL_MODULES_LIST))
29    BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(patsubst %,$(TARGET_KERNEL_DIR)/%,$(VENDOR_RAMDISK_KERNEL_MODULES_LIST))
30    BOARD_SYSTEM_KERNEL_MODULES := $(filter-out $(BOARD_VENDOR_KERNEL_MODULES) $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES), $(wildcard $(TARGET_KERNEL_DIR)/*.ko))
31else
32  BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(TARGET_MODS)
33endif
34
35PRODUCT_SHIPPING_API_LEVEL := 33
36
37# Check vendor package version
38# If you need to make changes to the vendor partition,
39# please modify the source git project here:
40#   https://staging-git.codelinaro.org/linaro/linaro-aosp/aosp-linaro-vendor-package
41include device/linaro/dragonboard/vendor-package-ver.mk
42ifneq (,$(wildcard $(LINARO_VENDOR_PATH)/db845c/$(EXPECTED_LINARO_VENDOR_VERSION)/version.mk))
43  # Unfortunately inherit-product doesn't export build variables from the
44  # called make file to the caller, so we have to include it directly here.
45  include $(LINARO_VENDOR_PATH)/db845c/$(EXPECTED_LINARO_VENDOR_VERSION)/version.mk
46  ifneq ($(TARGET_LINARO_VENDOR_VERSION), $(EXPECTED_LINARO_VENDOR_VERSION))
47    $(warning TARGET_LINARO_VENDOR_VERSION ($(TARGET_LINARO_VENDOR_VERSION)) does not match exiting the build ($(EXPECTED_LINARO_VENDOR_VERSION)).)
48    $(warning Please download and extract the new binaries by running the following script:)
49    $(warning    ./device/linaro/dragonboard/fetch-vendor-package.sh )
50    # Would be good to error out here, but that causes other issues
51  endif
52else
53  $(warning Missing Linaro Vendor Package!)
54  $(warning Please download and extract the vendor binaries by running the following script:)
55  $(warning    ./device/linaro/dragonboard/fetch-vendor-package.sh )
56  # Would be good to error out here, but that causes other issues
57endif
58
59PRODUCT_SOONG_NAMESPACES += \
60    device/linaro/dragonboard \
61    vendor/linaro/shared/$(EXPECTED_LINARO_VENDOR_VERSION)/linux-firmware
62
63# Dynamic partitions
64PRODUCT_BUILD_SUPER_PARTITION := true
65PRODUCT_USE_DYNAMIC_PARTITIONS := true
66PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true
67
68# Enable Virtual A/B
69AB_OTA_UPDATER := true
70AB_OTA_PARTITIONS += \
71    product \
72    system \
73    system_ext \
74    vendor
75
76ifeq ($(TARGET_SDCARD_BOOT), true)
77  ifneq ($(filter 5.4 5.10 5.15, $(TARGET_KERNEL_USE)),)
78    PRODUCT_COPY_FILES += \
79        device/linaro/dragonboard/shared/utils/sdcard-boot/fstab.sdhci:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.$(TARGET_HARDWARE) \
80        device/linaro/dragonboard/shared/utils/sdcard-boot/fstab.sdhci:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.$(TARGET_HARDWARE)
81  else
82    PRODUCT_COPY_FILES += \
83        device/linaro/dragonboard/shared/utils/sdcard-boot/fstab.mmc:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.$(TARGET_HARDWARE) \
84        device/linaro/dragonboard/shared/utils/sdcard-boot/fstab.mmc:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.$(TARGET_HARDWARE)
85  endif
86else
87  PRODUCT_COPY_FILES += \
88      device/linaro/dragonboard/fstab.common:$(TARGET_COPY_OUT_RAMDISK)/first_stage_ramdisk/fstab.$(TARGET_HARDWARE) \
89      device/linaro/dragonboard/fstab.common:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.$(TARGET_HARDWARE)
90endif
91
92PRODUCT_VENDOR_PROPERTIES += \
93    persist.sys.zram_enabled=1
94
95PRODUCT_COPY_FILES += \
96    $(TARGET_KERNEL_DIR)/Image.gz:kernel \
97    device/linaro/dragonboard/init.common.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.$(TARGET_HARDWARE).rc \
98    device/linaro/dragonboard/init.common.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.$(TARGET_HARDWARE).usb.rc \
99    frameworks/base/data/keyboards/Generic.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/$(TARGET_HARDWARE).kl
100
101# Workaround for the drop of OMX service
102PRODUCT_VENDOR_PROPERTIES += \
103    debug.stagefright.c2inputsurface=-1
104