forked from b99/android_kernel_d1_p1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_kernel.sh
More file actions
executable file
·59 lines (53 loc) · 1.96 KB
/
build_kernel.sh
File metadata and controls
executable file
·59 lines (53 loc) · 1.96 KB
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
#!/bin/bash
##############################################################################
#
# Kernel Build Script
#
##############################################################################
# 2014-06-21 Shev_t : modified
# 2011-10-24 effectivesky : modified
# 2010-12-29 allydrop : created
##############################################################################
##############################################################################
# set toolchain
##############################################################################
export ARCH=arm
export SUBARCH=arm
# GCC 5.2 sources: https://github.com/arter97/arm-linux-androideabi-5.2.git
export CROSS_COMPILE=~/AndroidSources/arm-linux-androideabi-5.2/bin/arm-eabi-
export LOCALVERSION="-mm"
export USE_CCACHE=1
export CCACHE_DIR=~/.ccache/front-kernel
export MY_CONFIG=huawei_omap4_defconfig
ccache -M 5G
##############################################################################
# set variables
##############################################################################
export KERNELDIR=`pwd`
KERNEL_OUT=$KERNELDIR/obj/KERNEL_OBJ
STRIP=${CROSS_COMPILE}strip
##############################################################################
# make zImage
##############################################################################
mkdir -p $KERNEL_OUT
mkdir -p $KERNEL_OUT/tmp/kernel
mkdir -p $KERNEL_OUT/tmp/system/lib/modules
make O=$KERNEL_OUT $MY_CONFIG
make -j10 O=$KERNEL_OUT
if [ -f $KERNEL_OUT/arch/arm/boot/zImage ]
then
cp -f $KERNEL_OUT/arch/arm/boot/zImage ./
mv -f $KERNEL_OUT/arch/arm/boot/zImage $KERNEL_OUT/tmp/kernel/zImage
fi
if [ -f ./zImage ]
then
CURRENT_DATE=`date +%Y%m%d-%H%M`
KERNEL_FNAME=kernel$LOCALVERSION-$CURRENT_DATE.zip
cp ./android/blank_any_kernel.zip $KERNEL_FNAME
pushd $KERNEL_OUT/tmp
zip -r ../../../$KERNEL_FNAME ./kernel/
if [ ! "$SGX_MODULE" ]
then
zip -r ../../../$KERNEL_FNAME ./system/
fi
fi