forked from MotorolaMobilityLLC/kernel-msm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-linaro4.9.sh
executable file
·36 lines (36 loc) · 1.62 KB
/
build-linaro4.9.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
#!/bin/bash
TOOLCHAIN="/home/shivam/development/toolchains/linaro-4.9/bin/arm-eabi"
MODULES_DIR="/home/shivam/development/modules"
ZIMAGE="/home/shivam/development/android_kernel_mototola_msm8610/arch/arm/boot/zImage"
KERNEL_DIR="/home/shivam/development/android_kernel_mototola_msm8610"
MKBOOTIMG="/home/shivam/boot-tools-condor/tools/mkbootimg"
MKBOOTFS="/home/shivam/boot-tools-condor/tools/mkbootfs"
DTBTOOL="/home/shivam/boot-tools-condor/tools/dtbTool"
DTBTOOLCM="/home/shivam/boot-tools-condor/tools/dtbToolCM"
BUILD_START=$(date +"%s")
if [ -a $ZIMAGE ];
then
rm $ZIMAGE
rm $MODULES_DIR/*
fi
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN- phantom_defconfig
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN- -j8
if [ -a $ZIMAGE ];
then
echo "Copying modules"
rm $MODULES_DIR/*
find . -name '*.ko' -exec cp {} $MODULES_DIR/ \;
cd $MODULES_DIR
echo "Stripping modules for size"
$TOOLCHAIN-strip --strip-unneeded *.ko
cd $KERNEL_DIR
$DTBTOOLCM -o dt.img -s 2048 -p scripts/dtc/ arch/arm/boot/
$MKBOOTFS ramdisk/ > $KERNEL_DIR/ramdisk.cpio
cat $KERNEL_DIR/ramdisk.cpio | gzip > $KERNEL_DIR/root.fs
$MKBOOTIMG --kernel $ZIMAGE --ramdisk $KERNEL_DIR/root.fs --cmdline "console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 utags.blkdev=/dev/block/platform/msm_sdcc.1/by-name/utags vmalloc=400M" --pagesize 2048 --base 0x00000000 --ramdisk_offset 0x01000000 --tags_offset 0x00000100 --dt dt.img -o $KERNEL_DIR/boot.img
BUILD_END=$(date +"%s")
DIFF=$(($BUILD_END - $BUILD_START))
echo "Build completed in $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds."
else
echo "Compilation failed! Fix the errors!"
fi