forked from coolya/android_kernel_samsung
-
Notifications
You must be signed in to change notification settings - Fork 18
/
sbuild.sh
executable file
·89 lines (67 loc) · 1.9 KB
/
sbuild.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
#!/bin/bash
BASE_SEMA_VER="Semaphore_KK_3.4.3"
case "$1" in
galaxys)
VARIANT="galaxys"
VER=""
;;
captivate)
VARIANT="captivate"
VER="c"
;;
vibrant)
VARIANT="vibrant"
VER="v"
;;
*)
VARIANT="galaxys"
VER=""
esac
if [ "$2" = "s" ] ; then
BASE_SEMA_VER=$BASE_SEMA_VER"s"
fi
SEMA_VER=$BASE_SEMA_VER$VER
#export KBUILD_BUILD_VERSION="2"
export LOCALVERSION="-"`echo $SEMA_VER`
#export CROSS_COMPILE=/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-2012.09-20120921_linux/bin/arm-linux-gnueabihf-
export CROSS_COMPILE=../toolchain/arm-linux-gnueabihf-
export ARCH=arm
echo
echo "Making ""semaphore"_$VARIANT"_defconfig"
DATE_START=$(date +"%s")
make "semaphore"_$VARIANT"_defconfig"
eval $(grep CONFIG_INITRAMFS_SOURCE .config)
INIT_DIR=$CONFIG_INITRAMFS_SOURCE
MODULES_DIR=`echo $INIT_DIR`files/modules
KERNEL_DIR=`pwd`
OUTPUT_DIR=../output/
CWM_DIR=../ics-ramdisk/cwm/
echo "LOCALVERSION="$LOCALVERSION
echo "CROSS_COMPILE="$CROSS_COMPILE
echo "ARCH="$ARCH
echo "INIT_DIR="$INIT_DIR
echo "MODULES_DIR="$MODULES_DIR
echo "KERNEL_DIR="$KERNEL_DIR
echo "OUTPUT_DIR="$OUTPUT_DIR
echo "CWM_DIR="$CWM_DIR
if [ "$2" = "s" ] ; then
echo "CONFIG_S5P_HUGEMEM=y" >> .config
fi
make -j16 modules
rm `echo $MODULES_DIR"/*"`
find $KERNEL_DIR -name '*.ko' -exec cp -v {} $MODULES_DIR \;
chmod 644 `echo $MODULES_DIR"/*"`
make -j16 zImage
cd arch/arm/boot
tar cvf `echo $SEMA_VER`.tar zImage
mv `echo $SEMA_VER`.tar ../../../$OUTPUT_DIR$VARIANT
echo "Moving to "$OUTPUT_DIR$VARIANT"/"
cd ../../../
cp arch/arm/boot/zImage $CWM_DIR"boot.img"
cd $CWM_DIR
zip -r `echo $SEMA_VER`.zip *
mv `echo $SEMA_VER`.zip ../$OUTPUT_DIR$VARIANT"/"
DATE_END=$(date +"%s")
echo
DIFF=$(($DATE_END - $DATE_START))
echo "Build completed in $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds."