forked from LineageOS/android_kernel_wingtech_msm8916
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build_starter.sh
41 lines (41 loc) · 1.24 KB
/
build_starter.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
echo "Declaring directories.."
KERNEL_DIR=$(pwd)
cd ..
MAIN_DIR=$(pwd)
LINARO_4_8_DIR=gcc-linaro-4.9-2016.02-x86_64_arm-eabi
DTBTOOL_DIR=$MAIN_DIR/mkbootimg_tools
echo "Switching to kernel directory.."
cd $KERNEL_DIR
echo "Exporting arch, subarch and compiler directories.."
export USE_CCACHE=1
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=$MAIN_DIR/$LINARO_4_8_DIR/bin/arm-eabi-
read -p "Do you want to rebuild all? " rebuild
case $rebuild in
[Yy]* )
echo "Cleaning previously compiled files..";
make clean && make mrproper;
esac
read -p "Do you want to overwrite present configuration with the default one? " choice
case $choice in
[Yy]* )
echo "Creating default configuration..";
make wt88047_defconfig;
esac
read -p "How many threads do you want to use for compiling the kernel? " threads
echo "Compiling kernel.."
make -j$threads
echo "Switching to dtbTool directory.."
cd $DTBTOOL_DIR
echo "Executing dtbToolCM.."
./dtbToolCM -2 -o $KERNEL_DIR/arch/arm/boot/dt.img -s 2048 -p $KERNEL_DIR/scripts/dtc/ $KERNEL_DIR/arch/arm/boot/dts/
echo "Kernel compilation complete!"
echo "Check above for any errors.."
read -p "Do you want to create a flashable zip? " zip
case $zip in
[Yy]* )
cd $KERNEL_DIR
bash zipping.sh
esac
echo "Process completed.."