-
Notifications
You must be signed in to change notification settings - Fork 26
/
update_defconfig.sh
executable file
·117 lines (102 loc) · 3.35 KB
/
update_defconfig.sh
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
117
cd ../../../../../../../..
ls
export ANDROID_ROOT=$(pwd)
export KERNEL_TOP=$ANDROID_ROOT/kernel/sony/msm-4.14/
export KERNEL_CFG=arch/arm64/configs/sony
export KERNEL_TMP=$ANDROID_ROOT/out/kernel-tmp
export CROSS_COMPILE=prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
export BUILD="make O=$KERNEL_TMP ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE -j$(nproc)"
cd $KERNEL_TOP/kernel
# These values must be changed for forks!
KERNEL_DEFCONFIG_URL="https://github.com/sonyxperiadev/kernel-defconfig"
KERNEL_DEFCONFIG_BRANCH="aosp/LA.UM.7.1.r1"
KERNEL_DEFCONFIG_HEAD=$(git -C ${KERNEL_CFG} rev-parse HEAD)
read -r -d '' KERNEL_COMMIT_MESSAGE << EOM
arm64: configs: somc: update auto-generated defconfig for all platforms
This update is generated automatically by using the script "update_defconfig.sh" which is maintained at this linked project below:
${KERNEL_DEFCONFIG_URL}/tree/${KERNEL_DEFCONFIG_BRANCH}
HEAD of the project used to prepare this commit:
${KERNEL_DEFCONFIG_URL}/tree/${KERNEL_DEFCONFIG_HEAD}
EOM
LOIRE="suzu kugo blanc"
TONE="dora kagura keyaki"
YOSHINO="lilac maple poplar"
NILE="discovery pioneer voyager"
GANGES="kirin mermaid"
TAMA="akari apollo akatsuki"
KUMANO="griffin bahamut"
SEINE="pdx201"
PLATFORMS="loire tone yoshino nile ganges tama kumano seine"
for platform in $PLATFORMS; do \
case $platform in
loire)
DEVICE=$LOIRE;
SOC="msm8956";;
tone)
DEVICE=$TONE;
SOC="msm8996";;
yoshino)
DEVICE=$YOSHINO;
SOC="msm8998";;
nile)
DEVICE=$NILE;
SOC="sdm6xx";;
ganges)
DEVICE=$GANGES;
SOC="sdm6xx";;
tama)
DEVICE=$TAMA;
SOC="sdm845";;
kumano)
DEVICE=$KUMANO;
SOC="sm8150";;
seine)
DEVICE=$SEINE;
SOC="sm6125";;
esac
echo "================================================="
echo "Your Environment:"
echo "ANDROID_ROOT: ${ANDROID_ROOT}"
echo "KERNEL_TOP : ${KERNEL_TOP}"
echo "KERNEL_CFG : ${KERNEL_CFG}"
echo "KERNEL_TMP : ${KERNEL_TMP}"
for device in $DEVICE; do \
ret=$(rm -rf ${KERNEL_TMP} 2>&1);
ret=$(mkdir -p ${KERNEL_TMP} 2>&1);
if [ ! -d ${KERNEL_TMP} ] ; then
echo "Check your environment";
echo "ERROR: ${ret}";
exit 1;
fi
echo "================================================="
echo "SOC -> ${SOC} :: Platform -> ${platform} :: Device -> $device"
echo "Running scripts/kconfig/merge_config.sh ..."
ret=$(ARCH=arm64 scripts/kconfig/merge_config.sh \
-O "${KERNEL_TMP}" \
${KERNEL_CFG}/android-base.config \
${KERNEL_CFG}/android-recommended.config \
${KERNEL_CFG}/android-recommended-arm64.config \
${KERNEL_CFG}/base_${SOC}_defconfig \
${KERNEL_CFG}/base_${platform}"_"${device}\_defconfig \
${KERNEL_CFG}/android-extra.config 2>&1);
case "$ret" in
*"error"*|*"ERROR"*) echo "ERROR: $ret"; exit 1;;
esac
echo "Building new defconfig ..."
ret=$(${BUILD} savedefconfig 2>&1);
case "$ret" in
*"error"*|*"ERROR"*) echo "ERROR: $ret"; exit 1;;
esac
mv $KERNEL_TMP/defconfig ./arch/arm64/configs/aosp_$platform"_"$device\_defconfig
done
done
echo "================================================="
echo "Done!"
rm -rf $KERNEL_TMP
echo "You can now commit the updated defconfig with the following as the commit message:"
echo "${KERNEL_COMMIT_MESSAGE}"
unset ANDROID_ROOT
unset KERNEL_TOP
unset KERNEL_CFG
unset KERNEL_TMP
unset BUILD