-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_osprey.sh
executable file
·74 lines (69 loc) · 2.64 KB
/
build_osprey.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
# Copyright � 2016, Sultan Qasim Khan <sultanqasim@gmail.com>
# Copyright � 2016, Zeeshan Hussain <zeeshanhussain12@gmail.com>
# Copyright � 2016, Varun Chitre <varun.chitre15@gmail.com>
#
# Custom build script
#
# This software is licensed under the terms of the GNU General Public
# License version 2, as published by the Free Software Foundation, and
# may be copied, distributed, and modified under those terms.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# Please maintain this if you use this script or any part of it
#
# Define variables
Toolchain="/home/zeeshan/uber-5.2/bin/arm-eabi-"
Kernel_Dir="/home/zeeshan/inazuma-osprey"
KERNEL="/home/zeeshan/inazuma-osprey/arch/arm/boot/zImage"
Dtbtool="/home/zeeshan/inazuma-osprey/tools/dtbToolCM"
#!/bin/bash
BUILD_START=$(date +"%s")
blue='\033[0;34m'
cyan='\033[0;36m'
yellow='\033[0;33m'
red='\033[0;31m'
nocol='\033[0m'
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=$Toolchain
export KBUILD_BUILD_USER="zeeshan"
export KBUILD_BUILD_HOST="thunder-prince"
echo -e "$cyan***********************************************"
echo " Compiling Inazuma kernel "
echo -e "***********************************************$nocol"
rm -f arch/arm/boot/dts/*.dtb
rm -f arch/arm/boot/dt.img
rm -f cwm_flash_zip/boot.img
echo -e " Initializing defconfig"
make osprey_defconfig
echo -e " Building kernel"
make -j4 zImage
make -j4 dtbs
$Dtbtool -2 -o $Kernel_Dir/arch/arm/boot/dt.img -s 2048 -p $Kernel_Dir/scripts/dtc/ $Kernel_Dir/arch/arm/boot/dts/
make -j4 modules
if [ -a $KERNEL ];
then
echo -e " Converting the output into a flashable zip"
rm -rf inazuma_install
mkdir -p inazuma_install
make -j4 modules_install INSTALL_MOD_PATH=inazuma_install INSTALL_MOD_STRIP=1
mkdir -p cwm_flash_zip/system/lib/modules/pronto
find inazuma_install/ -name '*.ko' -type f -exec cp '{}' cwm_flash_zip/system/lib/modules/ \;
mv cwm_flash_zip/system/lib/modules/wlan.ko cwm_flash_zip/system/lib/modules/pronto/pronto_wlan.ko
cp arch/arm/boot/zImage cwm_flash_zip/tools/
cp arch/arm/boot/dt.img cwm_flash_zip/tools/
rm -f /home/zeeshan/afh/squid_kernel.zip
cd cwm_flash_zip
zip -r ../arch/arm/boot/inazuma_kernel_osprey.zip ./
mv $Kernel_Dir/arch/arm/boot/inazuma_kernel_osprey.zip /home/zeeshan/afh
BUILD_END=$(date +"%s")
DIFF=$(($BUILD_END - $BUILD_START))
echo -e "$yellow Build completed in $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds.$nocol"
else
echo "Compilation failed! Fix the errors!"
fi