forked from lioux/AK-tuna
-
Notifications
You must be signed in to change notification settings - Fork 1
/
kubo-build.sh
executable file
·120 lines (104 loc) · 2.94 KB
/
kubo-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
clear
#
# VAR
#
PARAM=$1
DATE_START=$(date +"%s")
CWM_MOVE="/home/carlosavignano/android/"
TOOLCHAIN_LINARO="${HOME}/android/Linaro_4.8.x/4.8.1-2013.05.20130524/bin/arm-linux-gnueabihf-"
TOOLCHAIN_GOOGLE="${HOME}/android/Linaro_4.8.x/4.6.x-google/bin/arm-eabi-"
TOOLCHAIN_STRIP="${HOME}/android/Linaro_4.8.x/4.8.1-2013.05.20130524/bin/arm-linux-gnueabihf-strip"
if [ "${PARAM}" == "debug" ]; then
echo ""; echo "# AK BUILD DEBUG ------------------------------------------------------------------------------------------------"; echo ""
#
# CREATE DEFAULT CONFIG
#
make clean; sleep 3; make distclean; sleep 3
echo ""
rm -rfv .config; rm -rfv .config.old
echo ""
make CROSS_COMPILE=$TOOLCHAIN_GOOGLE ARCH=arm tuna_ak_debug_defconfig
#make CROSS_COMPILE=$TOOLCHAIN_LINARO ARCH=arm tuna_ak_debug_defconfig
#
# LOCAL KERNEL VERSION
#
ak_ver="AK.666.DEBUG"; export LOCALVERSION="~"`echo $ak_ver`
debug=1
else
echo ""; echo "# AK BUILD FULL ------------------------------------------------------------------------------------------------"; echo ""
#
# CREATE DEFAULT CONFIG
#
make clean; sleep 3; make distclean; sleep 3
echo ""
rm -rfv .config; rm -rfv .config.old
echo ""
#make CROSS_COMPILE=$TOOLCHAIN_GOOGLE ARCH=arm tuna_ak_defconfig
make CROSS_COMPILE=$TOOLCHAIN_LINARO ARCH=arm tuna_ak_defconfig
#
# LOCAL KERNEL VERSION
#
ak_ver="KUBO-AK-r50"; export LOCALVERSION="~"`echo $ak_ver`
debug=0
fi
#
# CROSS COMPILE KERNEL MODULES
#
#make CROSS_COMPILE=$TOOLCHAIN_GOOGLE ARCH=arm -j4 modules
make CROSS_COMPILE=$TOOLCHAIN_LINARO ARCH=arm -j4 modules
#
# FIND .KO MODULE CREATE WITH CROSS COMPILE
# AND THEN COPY .KO MODULE TO CWM SCRIPT
#
echo ""
rm -rfv ${HOME}/android/AK-ramdisk/cwm/system/lib/modules/*
find ${HOME}/android/AK-tuna/ -name '*.ko' -exec cp -v {} ${HOME}/android/AK-ramdisk/cwm/system/lib/modules \;
$TOOLCHAIN_STRIP --strip-debug ${HOME}/android/AK-ramdisk/cwm/system/lib/modules/*.ko
echo ""
#
# CROSS COMPILE KERNEL WITH TOOLCHAIN
#
#make CROSS_COMPILE=$TOOLCHAIN_GOOGLE ARCH=arm -j4 zImage
make CROSS_COMPILE=$TOOLCHAIN_LINARO ARCH=arm -j4 zImage
#
# COPY ZIMAGE OF KERNEL
# FOR MERGE WITH RAMDISK
#
cp -vr arch/arm/boot/zImage ../AK-ramdisk/
cd ../AK-ramdisk/ramdisk-4.2/
chmod 750 init* charger
chmod 644 default.prop
chmod 640 fstab.tuna
chmod 644 ueventd*
cd ..
./repack-bootimg.pl zImage ramdisk-4.2/ boot.img
cp -vr boot.img cwm/
#
# CREATE A CWM PKG
# FOR FLASH FROM RECOVERY
#
cd cwm
zip -r `echo $ak_ver`.zip *
rm -rf $CWM_MOVE/`echo $ak_ver`.zip
cp -vr `echo $ak_ver`.zip $CWM_MOVE/Builds/
if [ ! -d ../zip ]; then
mkdir ../zip
fi
mv `echo $ak_ver`.zip ../zip/
rm -rf `echo $ak_ver`.zip boot.img
cd ..
cd ../AK-tuna/
echo .
echo ..
echo ... Compile Complete ! ... `echo $ak_ver`.zip
echo ..
echo .
#
# PRINT BUILDING COMPILE-TIME
#
echo ""
DATE_END=$(date +"%s")
DIFF=$(($DATE_END - $DATE_START))
echo "Build completed in $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds."
echo ""