forked from LineageOS/android_kernel_samsung_manta
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuildkernel.sh
52 lines (42 loc) · 1.61 KB
/
buildkernel.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
#!/bin/sh
# Colorize and add text parameters
red=$(tput setaf 1) # red
grn=$(tput setaf 2) # green
cya=$(tput setaf 6) # cyan
txtbld=$(tput bold) # Bold
bldred=${txtbld}$(tput setaf 1) # red
bldgrn=${txtbld}$(tput setaf 2) # green
bldblu=${txtbld}$(tput setaf 4) # blue
bldcya=${txtbld}$(tput setaf 6) # cyan
txtrst=$(tput sgr0) # Reset
export KERNELDIR=`readlink -f .`;
export PARENT_DIR=`readlink -f ..`;
export ANY_KERNEL=/home/khaon/android/kernel/AnyKernel2;
export ARCH=arm;
export CCACHE_DIR=/home/khaon/caches/.ccache_kernels;
export PACKAGEDIR=/home/khaon/android/kernel/Packages;
export CROSS_COMPILE="ccache /home/khaon/android/rom/aosp_master/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi-";
export MKBOOTIMG=/home/khaon/android/kernel/mkbootimg_tools/mkboot;
export MKBOOTIMG_TOOLTS_ZIMAGE_MANTA_FOLDER=/home/khaon/android/kernel/mkbootimg_tools/manta_temasek;
echo "${txtbld} Remove old zImage ${txtrst}";
make mrproper;
rm $PACKAGEDIR/zImage;
rm arch/arm/boot/zImage;
echo "${bldblu} Make the kernel ${txtrst}";
make khaon_manta_defconfig;
make -j8;
if [ -e $KERNELDIR/arch/arm/boot/zImage ]; then
echo " ${bldgrn} Kernel built !! ${txtrst}";
export curdate=`date "+%m-%d-%Y"`;
cd $PACKAGEDIR;
echo "${txtbld} Make AnyKernel flashable archive ${txtrst} "
echo "";
rm UPDATE-AnyKernel2-khaon-kernel-manta-marshmallow*.zip;
cd $ANY_KERNEL;
cp $KERNELDIR/arch/arm/boot/zImage zImage;
mkdir -p $PACKAGEDIR;
zip -r9 $PACKAGEDIR/UPDATE-AnyKernel2-khaon-kernel-manta-marshmallow-"${curdate}".zip * -x README UPDATE-AnyKernel2.zip .git *~;
cd $KERNELDIR;
else
echo "KERNEL DID NOT BUILD! no zImage exist"
fi;