forked from brothaedhung/AK-xGenesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ak-mako-build.sh
executable file
·120 lines (99 loc) · 2.88 KB
/
ak-mako-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
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
118
119
120
#!/bin/bash
# Add Colors to unhappiness
green='\033[01;32m'
red='\033[01;31m'
blink_red='\033[05;31m'
restore='\033[0m'
clear
# AK Kernel Version
BASE_AK_VER="AK"
VER=".355.geeb-aosp"
AK_VER=$BASE_AK_VER$VER
# AK Variables
export LOCALVERSION="~"`echo $AK_VER`
export CROSS_COMPILE=${HOME}/kernel/AK-linaro/4.9.2-2014.08.20140831.CR83/bin/arm-cortex_a15-linux-gnueabihf-
export ARCH=arm
export SUBARCH=arm
export KBUILD_BUILD_USER=Edgar
export KBUILD_BUILD_HOST="Buildbox"
DATE_START=$(date +"%s")
echo
echo -e "${green}"
echo "AK Kernel Creation Script:"
echo " _____ "
echo " (, / | /) , "
echo " /---| __ _ __ (/_ __ "
echo " ) / |_/ (_(_(_/ (_/(___(_(_(_"
echo " ( / "
echo " _/ "
echo -e "${restore}"
echo
echo -e "${green}"
echo "------------------------"
echo "Show: AK geeb Settings"
echo "------------------------"
echo -e "${restore}"
MODULES_DIR=${HOME}/kernel/AK-Mako-AnyKernel/cwm/system/lib/modules
KERNEL_DIR=`pwd`
OUTPUT_DIR=${HOME}/kernel/AK-Mako-AnyKernel
CWM_DIR=${HOME}/kernel/AK-Mako-AnyKernel/cwm
ZIMAGE_DIR=${HOME}/kernel/AK-Mako/arch/arm/boot
CWM_MOVE=${HOME}/kernel/AK-releases
ZIMAGE_ANYKERNEL=${HOME}/kernel/AK-Mako-AnyKernel/cwm/kernel
ANYKERNEL_DIR=${HOME}/kernel/AK-Mako-AnyKernel
echo -e "${red}"; echo "COMPILING VERSION:"; echo -e "${blink_red}"; echo "$LOCALVERSION"; echo -e "${restore}"
echo "CROSS_COMPILE="$CROSS_COMPILE
echo "ARCH="$ARCH
echo "MODULES_DIR="$MODULES_DIR
echo "KERNEL_DIR="$KERNEL_DIR
echo "OUTPUT_DIR="$OUTPUT_DIR
echo "CWM_DIR="$CWM_DIR
echo "ZIMAGE_DIR="$ZIMAGE_DIR
echo "CWM_MOVE="$CWM_MOVE
echo "ZIMAGE_ANYKERNEL="$ZIMAGE_ANYKERNEL
echo "ANYKERNEL_DIR="$ANYKERNEL_DIR
echo -e "${green}"
echo "-------------------------"
echo "Making: AK geeb Defconfig"
echo "-------------------------"
echo -e "${restore}"
make "geeb_defconfig"
make -j9
echo -e "${green}"
echo "--------------------------"
echo "Copy: Modules to directory"
echo "--------------------------"
echo -e "${restore}"
rm `echo $MODULES_DIR"/*"`
find $KERNEL_DIR -name '*.ko' -exec cp -v {} $MODULES_DIR \;
echo
echo -e "${green}"
echo "----------------------------"
echo "Create: Zip and moving files"
echo "----------------------------"
echo -e "${restore}"
cp -vr $ZIMAGE_DIR/zImage $ZIMAGE_ANYKERNEL
echo
cd $CWM_DIR
zip -r `echo $AK_VER`.zip *
mv `echo $AK_VER`.zip $OUTPUT_DIR
echo -e "${green}"
echo "-------------------------"
echo "The End: AK is Born"
echo "-------------------------"
echo -e "${restore}"
cp -vr $OUTPUT_DIR/`echo $AK_VER`.zip $CWM_MOVE
echo
cd $ANYKERNEL_DIR
git reset --hard
echo
cd $KERNEL_DIR
echo -e "${green}"
echo "-------------------------"
echo "Build Completed in:"
echo "-------------------------"
echo -e "${restore}"
DATE_END=$(date +"%s")
DIFF=$(($DATE_END - $DATE_START))
echo "Time: $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds."
echo