-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-kernels-gcc.sh
executable file
·44 lines (33 loc) · 1.21 KB
/
build-kernels-gcc.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
set -e
if [ -z "$ANDROID_ROOT" ]; then
ANDROID_ROOT="`realpath ../../../`"
echo "WARNING: Guessing Android root at: $ANDROID_ROOT"
fi
kernel_top=$ANDROID_ROOT/kernel/mainline/
kernel_out=$ANDROID_ROOT/out/kernel-mainline
cd $kernel_top/kernel
echo "================================================="
echo "Your Environment:"
echo "ANDROID_ROOT: $ANDROID_ROOT"
echo "kernel_top : $kernel_top"
echo "kernel_out : $kernel_out"
ret=$(mkdir -p $kernel_out 2>&1);
if [ ! -d $kernel_out ] ; then
echo "Failed to create output directory";
echo "ERROR: $ret";
exit 1;
fi
# Build command
build="make O=$kernel_out ARCH=arm64 -j$(nproc) CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-none-eabi-"
echo "$build"
echo "================================================="
echo "Building defconfig ..."
${build} defconfig
echo "The build may take up to 10 minutes. Please be patient ..."
echo "Building new kernel image ..."
${build} Image.gz dtbs
echo "Copying new kernel image ..."
cp $kernel_out/arch/arm64/boot/Image.gz $kernel_top/common-kernel/Image.gz
cp $kernel_out/arch/arm64/boot/dts/qcom/*-sony-xperia-*.dtb $kernel_top/common-kernel/
echo "================================================="
echo "Done!"