forked from brothaedhung/AK-xGenesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ak-gee-build.sh
120 lines (99 loc) · 2.83 KB
/
ak-gee-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=".345.GEE.CM"
AK_VER=$BASE_AK_VER$VER
# AK Variables
export LOCALVERSION="~"`echo $AK_VER`
export CROSS_COMPILE=${HOME}/ak/AK-linaro/4.9.1-2014.07.20140718.CR83/bin/arm-cortex_a15-linux-gnueabihf-
export ARCH=arm
export SUBARCH=arm
export KBUILD_BUILD_USER=JustinXu
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 gee Settings"
echo "------------------------"
echo -e "${restore}"
MODULES_DIR=${HOME}/ak/AK-anykernel/cwm/system/lib/modules
KERNEL_DIR=`pwd`
OUTPUT_DIR=${HOME}/ak/AK-anykernel/zip
CWM_DIR=${HOME}/ak/AK-anykernel/cwm
ZIMAGE_DIR=${HOME}/ak/AK-xGenesis/arch/arm/boot
CWM_MOVE=${HOME}/ak/AK-releases
ZIMAGE_ANYKERNEL=${HOME}/ak/AK-anykernel/cwm/kernel
ANYKERNEL_DIR=${HOME}/ak/AK-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 gee Defconfig"
echo "-------------------------"
echo -e "${restore}"
make "gee_defconfig"
make -j9
echo -e "${green}"
echo "--------------------------"
echo "Copy: Modules to direcroty"
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