forked from khadas/common_drivers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.config.amlogic.fragment.bazel
111 lines (95 loc) · 5.04 KB
/
build.config.amlogic.fragment.bazel
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
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.gki.aarch64
COMMON_DRIVERS=common_drivers
. ${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS}/project/build.config.project
. ${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS}/project/build.config.gki10
[[ -n ${KASAN} ]] && LTO=none
echo "Base Kernel parm: LTO=${LTO} GKI_CONFIG=${GKI_CONFIG} ANDROID_PROJECT=${ANDROID_PROJECT} KASAN=${KASAN} CHECK_GKI_20=${CHECK_GKI_20}"
DEFCONFIG=amlogic_gki_defconfig
function pre_defconfig_cmds() {
KCONFIG_DEFCONFIG=${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/${DEFCONFIG}
local temp_file=`mktemp /tmp/config.XXXXXXXXXXXX`
if [[ ${GKI_CONFIG} == gki_20 ]]; then
if [[ -z ${ANDROID_PROJECT} ]]; then
echo "CONFIG_AMLOGIC_DRIVER=y" > ${temp_file}
echo "CONFIG_AMLOGIC_MODIFY=y" >> ${temp_file}
echo "CONFIG_AMLOGIC_IN_KERNEL_MODULES=y" >> ${temp_file}
echo "CONFIG_AMLOGIC_SERIAL_MESON=y" >> ${temp_file}
echo "CONFIG_AMLOGIC_SERIAL_MESON_CONSOLE=y" >> ${temp_file}
echo "CONFIG_AMLOGIC_SERIAL_EARLY_CONSOLE=y" >> ${temp_file}
echo "CONFIG_DEVTMPFS=y" >> ${temp_file}
fi
KCONFIG_CONFIG=${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r \
${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/gki_defconfig \
${temp_file}
else
echo "CONFIG_MODULE_SIG_ALL=y" > ${temp_file}
if [[ -z ${ANDROID_PROJECT} ]]; then
echo "CONFIG_AMLOGIC_SERIAL_MESON=y" >> ${temp_file}
echo "CONFIG_DEVTMPFS=y" >> ${temp_file}
fi
KCONFIG_CONFIG=${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r \
${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/gki_defconfig \
${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/amlogic_gki.fragment \
${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/amlogic_gki.10 \
${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/amlogic_gki.debug \
${temp_file}
if [[ ${UPGRADE_PROJECT} == r || ${UPGRADE_PROJECT} == R ]]; then
KCONFIG_CONFIG=${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r ${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/amlogic_upgrade_r.defconfig
fi
if [[ ${UPGRADE_PROJECT} == p || ${UPGRADE_PROJECT} == P ]]; then
KCONFIG_CONFIG=${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r ${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/amlogic_upgrade_p.defconfig
fi
if [[ ${UPGRADE_PROJECT} == s || ${UPGRADE_PROJECT} == S ]]; then
KCONFIG_CONFIG=${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r ${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/amlogic_upgrade_s.defconfig
fi
if [[ ${UPGRADE_PROJECT} == u || ${UPGRADE_PROJECT} == U ]]; then
KCONFIG_CONFIG=${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r ${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/amlogic_upgrade_u.defconfig
fi
if [[ -n ${DEV_CONFIGS} ]]; then
local config_list=$(echo ${DEV_CONFIGS}|sed 's/+/ /g')
for config_name in ${config_list[@]}
do
if [[ -f ${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/${config_name} ]]; then
config_file=${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/${config_name}
KCONFIG_CONFIG=${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r ${KCONFIG_DEFCONFIG} ${config_file}
else
echo "ERROR: config file ${config_name} is not in the right path!!"
exit
fi
done
fi
if [[ ${UPGRADE_PROJECT} == r || ${UPGRADE_PROJECT} == R ]] && [[ "${CONFIG_BOOTIMAGE}" == "user" ]]; then
KCONFIG_CONFIG=${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r ${KCONFIG_DEFCONFIG} ${AMLOGIC_R_USER_DIFFCONFIG}
fi
fi
if [[ -n ${KASAN} ]]; then
cat ${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/amlogic_kasan.defconfig > ${temp_file}
KCONFIG_CONFIG=${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r \
${KCONFIG_DEFCONFIG} \
${temp_file}
fi
if [[ -n ${CHECK_GKI_20} ]]; then
KCONFIG_CONFIG=${KCONFIG_DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r \
${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/gki_defconfig
fi
rm ${temp_file}
}
export -f pre_defconfig_cmds
PRE_DEFCONFIG_CMDS=pre_defconfig_cmds
function post_defconfig_cmds() {
rm -f ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/${DEFCONFIG}
if [[ -n ${DEV_CONFIGS} ]]; then
local config_list=$(echo ${DEV_CONFIGS}|sed 's/+/ /g')
for config_name in ${config_list[@]}
do
if [[ -f ${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/${config_name} ]]; then
rm -f ${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/${config_name}
else
echo "ERROR: config file ${config_name} is not in the right path!!"
exit
fi
done
fi
}
export -f post_defconfig_cmds
POST_DEFCONFIG_CMDS=post_defconfig_cmds