-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.config.amlogic.bazel
116 lines (100 loc) · 5.14 KB
/
build.config.amlogic.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
112
113
114
115
116
COMMON_DRIVERS=${KERNEL_DIR}
KERNEL_DIR=common
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.aarch64
# . ${ROOT_DIR}/${KERNEL_DIR}/build.config.gki.aarch64
. ${COMMON_DRIVERS}/project/build.config.project
. ${COMMON_DRIVERS}/project/build.config.gki10
KCONFIG_EXT_MODULES_PREFIX=$(realpath ${ROOT_DIR} --relative-to ${KERNEL_DIR})/
BUILD_INITRAMFS=1
LZ4_RAMDISK=1
DEFCONFIG=amlogic_gki10_defconfig
GKI_CHECK_CONFIG_WHITE_LIST="
CONFIG_STMMAC_ETH
"
function pre_defconfig_cmds() {
KCONFIG_DEFCONFIG=${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/${DEFCONFIG}
local temp_file=`mktemp /tmp/config.XXXXXXXXXXXX`
if [[ -z ${ANDROID_PROJECT} ]]; then
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
if [[ ${GKI_CONFIG} == 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 ${ROOT_DIR}/${KERNEL_DIR}/${COMMON_DRIVERS_DIR}/arch/arm64/configs/amlogic_gki.fragment ${temp_file}
else
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}
fi
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
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
echo > ${temp_file}
for configs in ${GKI_CHECK_CONFIG_WHITE_LIST}; do
echo "${configs}=n" >> ${temp_file}
done
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 \
${temp_file}
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
MAKE_GOALS="
modules
dtbs
android_overlay_dt.dtbo
"
KMI_SYMBOL_LIST=android/abi_gki_aarch64_amlogic
GKI_MODULES_LIST=android/gki_aarch64_modules