forked from theimpulson/android_kernel_asus_msm8916
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_Z00T.sh
48 lines (40 loc) · 1.22 KB
/
build_Z00T.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
#!/bin/bash
BUILD_START=$(date +"%s")
# Colours
blue='\033[0;34m'
cyan='\033[0;36m'
yellow='\033[0;33m'
red='\033[0;31m'
nocol='\033[0m'
# Kernel details
KERNEL_NAME="Icey"
VERSION="0.2"
DATE=$(date +"%d-%m-%Y-%I-%M")
DEVICE="Z00T"
OUT="msm8916"
FINAL_ZIP=$KERNEL_NAME-$VERSION-$DATE-$DEVICE.zip
defconfig=Z00T_defconfig
# Dirs
ANYKERNEL_DIR=$TRAVIS_BUILD_DIR/AnyKernel2
KERNEL_IMG=$TRAVIS_BUILD_DIR/arch/arm64/boot/Image.gz-dtb
UPLOAD_DIR=$TRAVIS_BUILD_DIR/$OUT
# Export
export ARCH=arm64
export CROSS_COMPILE=~/aarch64-linux-android-4.9/bin/aarch64-linux-android-
export KBUILD_BUILD_USER="Akagi"
export KBUILD_BUILD_HOST="asus-dev"
make $defconfig
make -j8
mkdir -p tmp_mod
make -j4 modules_install INSTALL_MOD_PATH=tmp_mod INSTALL_MOD_STRIP=1
find tmp_mod/ -name '*.ko' -type f -exec cp '{}' $ANYKERNEL_DIR/modules/system/lib/modules/ \;
cp $KERNEL_IMG $ANYKERNEL_DIR
mkdir -p $UPLOAD_DIR
cd $ANYKERNEL_DIR
zip -r9 UPDATE-AnyKernel2.zip * -x README UPDATE-AnyKernel2.zip
mv $ANYKERNEL_DIR/UPDATE-AnyKernel2.zip $UPLOAD_DIR/$FINAL_ZIP
# Cleanup
rm $ANYKERNEL_DIR/Image.gz-dtb
BUILD_END=$(date +"%s")
DIFF=$(($BUILD_END - $BUILD_START))
echo -e "$yellow Build completed in $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds.$nocol"