-
Notifications
You must be signed in to change notification settings - Fork 430
/
build.config.moto
48 lines (40 loc) · 2.3 KB
/
build.config.moto
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
# Common Moto configuration for building GKI-based kernels
# Copyright (c) 2021, Motorola. All rights reserved.
TARGET_PRODUCT_NAME=${TARGET_PRODUCT%%_*}
TARGET_PRODUCT_TYPE=${TARGET_PRODUCT#*_}
echo "moto fragment config: TARGET_PRODUCT=$TARGET_PRODUCT TARGET_PRODUCT_NAME=$TARGET_PRODUCT_NAME TARGET_PRODUCT_TYPE=$TARGET_PRODUCT_TYPE"
function add_moto_defconfig_fragments() {
if [[ "${VARIANT}" =~ ^(gki|consolidate)$ ]]; then
if [ -e ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/moto-${MSM_ARCH}.config ]; then
apply_defconfig_fragment ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/moto-${MSM_ARCH}.config
fi
if [ -e ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/moto-${MSM_ARCH}-${TARGET_PRODUCT_NAME}.config ]; then
apply_defconfig_fragment ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/moto-${MSM_ARCH}-${TARGET_PRODUCT_NAME}.config
fi
# factory config takes effect in both gki and consolidate varaints
if [ "$TARGET_PRODUCT_TYPE" == "factory" ]; then
if [ -e ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/factory-${MSM_ARCH}.config ]; then
apply_defconfig_fragment ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/factory-${MSM_ARCH}.config
fi
if [ -e ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/factory-${MSM_ARCH}-${TARGET_PRODUCT_NAME}.config ]; then
apply_defconfig_fragment ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/factory-${MSM_ARCH}-${TARGET_PRODUCT_NAME}.config
fi
fi
if [ "${VARIANT}" = gki -o "$TARGET_PRODUCT_TYPE" = "factory" ]; then
if [ -e ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/moto-${MSM_ARCH}-gki.config ]; then
apply_defconfig_fragment ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/moto-${MSM_ARCH}-gki.config
fi
return
fi
if [ -e ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/debug-${MSM_ARCH}.config ]; then
apply_defconfig_fragment ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/debug-${MSM_ARCH}.config
fi
if [ -e ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/debug-${MSM_ARCH}-${TARGET_PRODUCT_NAME}.config ]; then
apply_defconfig_fragment ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/ext_config/debug-${MSM_ARCH}-${TARGET_PRODUCT_NAME}.config
fi
fi
}
#skip msi products
if [ "$TARGET_PRODUCT_NAME" != "msi" ]; then
add_moto_defconfig_fragments
fi