forked from 18712886438/android_kernel_zuk_z2_plus
-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.sh
executable file
·34 lines (34 loc) · 1.07 KB
/
build.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
#!/bin/bash
cd ..
rm -rf modules
export CONFIG_FILE="msm-perf_defconfig"
export ARCH="arm64"
export CROSS_COMPILE="aarch64-linux-android-"
export TOOL_CHAIN_PATH="${HOME}/caf/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/"
export CONFIG_ABS_PATH="arch/${ARCH}/configs/${CONFIG_FILE}"
export PATH=$PATH:${TOOL_CHAIN_PATH}
export objdir="${HOME}/kernel/obj"
export sourcedir="${HOME}/kernel/msm8996"
cd $sourcedir
compile() {
make O=$objdir ARCH=arm64 CROSS_COMPILE=${TOOL_CHAIN_PATH}/${CROSS_COMPILE} $CONFIG_FILE -j4
make O=$objdir -j6
}
module(){
mkdir modules
find . -name '*.ko' -exec cp -av {} modules/ \;
# strip modules
${TOOL_CHAIN_PATH}/${CROSS_COMPILE}strip --strip-unneeded modules/*
#mkdir modules/qca_cld
#mv modules/wlan.ko modules/qca_cld/qca_cld_wlan.ko
}
dtbuild(){
cd $sourcedir
./tools/dtbToolCM -2 -o $objdir/arch/arm64/boot/dt.img -s 4096 -p $objdir/scripts/dtc/ $objdir/arch/arm64/boot/dts/
}
compile
cd ../
module
#dtbuild
#cp $objdir/arch/arm64/boot/zImage $sourcedir/zImage
#cp $objdir/arch/arm64/boot/dt.img.lz4 $sourcedir/dt.img