forked from CyanogenMod/android_kernel_sony_msm7x27a
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sh
executable file
·60 lines (43 loc) · 1.75 KB
/
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
#!/bin/bash
# Copyright Joseph Riches <[email protected]> 2014
# Based on build scripts by cybojenix <[email protected]> and DooMLoRD(@github)
# Copy, modify, or distribute as you will under the DWYWWT (do whatever you want with this) licence
if [ -z $target ]; then
echo "choose your target device"
echo "1) JLO (J)"
echo "2) Mesona (Miro)"
echo "3) Nanhu (E)"
echo "4) Tapioca (Tipo)"
read -p "1/2/3/4: " choice
case "$choice" in
1 ) export target=JLO ; export defconfig=cm_tamsui_jlo_defconfig;;
2 ) export target=Mesona ; export defconfig=cm_tamsui_mes_defconfig;;
3 ) export target=Nanhu ; export defconfig=cm_tamsui_nan_defconfig;;
4 ) export target=Tapioca ; export defconfig=cm_tamsui_tap_defconfig;;
* ) echo "invalid choice"; sleep 2 ; $0;;
esac
fi # [ -z $target ]
export COMPILER_DIR=~/cm-11.0/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin
export ARCH=arm
export CROSS_COMPILE=${COMPILER_DIR}/arm-linux-androideabi-
# TODO: always make clean mrproper if the last compiled
# zImage was for a different device
if [ -z "$clean" ]; then
read -p "do make clean mrproper?(y/n)" clean
fi # [ -z "$clean" ]
case "$clean" in
y|Y ) echo "cleaning..."; make clean mrproper;;
n|N ) echo "continuing...";;
* ) echo "invalid option"; sleep 2 ; build.sh;;
esac
echo "building the kernel"
make $defconfig
make -j `cat /proc/cpuinfo | grep "^processor" | wc -l` "$@"
if [ -f arch/arm/boot/zImage ]; then
mkdir -p OUT
cp arch/arm/boot/zImage OUT/zImage
rm -r OUT/zImage
fi # [ -f arch/arm/boot/zImage ]
# TODO: add addresses to build kernel.elf
# and create ramdisk from android ROM directory
export MKELF_PY=~/cm-11.0/device/sony/tamsui-common/tools/mkelf.py