-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sh
executable file
·55 lines (40 loc) · 1.71 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
54
55
#!/bin/bash
if [ -e zImage ]; then
rm zImage
fi
rm compile.log
# Set Default Path
TOP_DIR=$PWD
KERNEL_PATH="/home/simone/neak-kernel"
VOODOO_PATH="/home/simone/neak-kernel/voodoo-mods"
# Set toolchain and root filesystem path
#TOOLCHAIN="/home/simone/arm-2011.03/bin/arm-none-eabi-"
TOOLCHAIN="/home/simone/android-toolchain-eabi/bin/arm-eabi-"
ROOTFS_PATH="/home/simone/neak-kernel/initramfs"
export KBUILD_BUILD_VERSION="N.E.A.K-1.4.2x"
export KERNELDIR=$KERNEL_PATH
echo "Cleaning latest build"
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN -j`grep 'processor' /proc/cpuinfo | wc -l` mrproper
# Making our .config
make neak_defconfig
make -j`grep 'processor' /proc/cpuinfo | wc -l` ARCH=arm CROSS_COMPILE=$TOOLCHAIN CONFIG_INITRAMFS_SOURCE="$ROOTFS_PATH" >> compile.log 2>&1 || exit -1
# Copying Voodoo Modules
cd $VOODOO_PATH
cd ld9040_voodoo_exynos_galaxysii
make default ARCH=arm CROSS_COMPILE=$TOOLCHAIN
# Copying kernel modules
cd $KERNEL_PATH
find -name '*.ko' -exec cp -av {} $ROOTFS_PATH/lib/modules/ \;
make -j`grep 'processor' /proc/cpuinfo | wc -l` ARCH=arm CROSS_COMPILE=$TOOLCHAIN CONFIG_INITRAMFS_SOURCE="$ROOTFS_PATH" || exit -1
# Copy Kernel Image
rm -f $KERNEL_PATH/releasetools/zip/$KBUILD_BUILD_VERSION.zip
cp -f $KERNEL_PATH/arch/arm/boot/zImage .
cp -f $KERNEL_PATH/arch/arm/boot/zImage $KERNEL_PATH/releasetools/zip
cd arch/arm/boot
tar cf $KERNEL_PATH/arch/arm/boot/$KBUILD_BUILD_VERSION.tar ../../../zImage && ls -lh $KBUILD_BUILD_VERSION.tar
cd ../../..
cd releasetools/zip
zip -r $KBUILD_BUILD_VERSION.zip *
cp $KERNEL_PATH/arch/arm/boot/$KBUILD_BUILD_VERSION.tar $KERNEL_PATH/releasetools/tar/$KBUILD_BUILD_VERSION.tar
rm $KERNEL_PATH/arch/arm/boot/$KBUILD_BUILD_VERSION.tar
rm $KERNEL_PATH/releasetools/zip/zImage