forked from humcycles/galaxy-tab-modified
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_kernel.sh
executable file
·125 lines (96 loc) · 2.98 KB
/
build_kernel.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
121
122
123
124
#/bin/bash
echo "$1 $2 $3"
case "$1" in
Clean)
echo "********************************************************************************"
echo "* Clean Kernel *"
echo "********************************************************************************"
pushd Kernel
make clean
popd
echo " It's done... "
exit
;;
*)
PROJECT_NAME=SPH-P100
HW_BOARD_REV="03"
;;
esac
if [ "$CPU_JOB_NUM" = "" ] ; then
CPU_JOB_NUM=8
fi
TARGET_LOCALE="vzw"
TOOLCHAIN=/home/kevin/Packages/arm-2009q3/bin
TOOLCHAIN_PREFIX=arm-none-linux-gnueabi-
KERNEL_BUILD_DIR=`pwd`/Kernel
ANDROID_OUT_DIR=`pwd`/Android/out/target/product/SPH-P100
export PRJROOT=$PWD
export PROJECT_NAME
export HW_BOARD_REV
export LD_LIBRARY_PATH=.:${TOOLCHAIN}/../lib
echo "************************************************************"
echo "* EXPORT VARIABLE *"
echo "************************************************************"
echo "PRJROOT=$PRJROOT"
echo "PROJECT_NAME=$PROJECT_NAME"
echo "HW_BOARD_REV=$HW_BOARD_REV"
echo "************************************************************"
BUILD_MODULE()
{
echo "************************************************************"
echo "* BUILD_MODULE *"
echo "************************************************************"
echo
pushd Kernel
make -j$CPU_JOB_NUM ARCH=arm CROSS_COMPILE=$TOOLCHAIN/$TOOLCHAIN_PREFIX modules
popd
}
BUILD_KERNEL()
{
echo "************************************************************"
echo "* BUILD_KERNEL *"
echo "************************************************************"
echo
pushd $KERNEL_BUILD_DIR
export KDIR=`pwd`
# make ARCH=arm p1_android_rfs_vzw_defconfig
# make kernel
make -j$CPU_JOB_NUM ARCH=arm CROSS_COMPILE=$TOOLCHAIN/$TOOLCHAIN_PREFIX
popd
}
# print title
PRINT_USAGE()
{
echo "************************************************************"
echo "* PLEASE TRY AGAIN *"
echo "************************************************************"
echo
}
PRINT_TITLE()
{
echo
echo "************************************************************"
echo "* MAKE PACKAGES"
echo "************************************************************"
echo "* 1. kernel : zImage"
echo "* 2. modules"
echo "************************************************************"
}
##############################################################
# MAIN FUNCTION #
##############################################################
if [ $# -gt 3 ]
then
echo
echo "**************************************************************"
echo "* Option Error *"
PRINT_USAGE
exit 1
fi
START_TIME=`date +%s`
PRINT_TITLE
BUILD_MODULE
BUILD_KERNEL
END_TIME=`date +%s`
let "ELAPSED_TIME=$END_TIME-$START_TIME"
echo "Total compile time is $ELAPSED_TIME seconds"