-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildzf2
executable file
·99 lines (93 loc) · 2.33 KB
/
buildzf2
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
clear
start=`date +%s`
echo "script made by eoghan2t7 of xda"
printf "say thanks to him if this helped you :) \n\n"
wmctrl -r :ACTIVE: -N "Applying Build Settings"
NOW=$(date +"%d-%m-%Y")
echo "Current Date : $NOW"
echo "Applying Build Settings"
sleep 1
export ARCH=x86_64
export CCOMPILE=$CROSS_COMPILE
export CROSS_COMPILE=x86_64-linux-
#CONFIGS
echo "Setting CPU Cores/Threads"
export CPUS=`nproc`
echo "Setting Version Number"
export VER=v$1
echo "Setting Extra Version"
export EV=EXTRAVERSION=_FlareX_v$1
echo "Setting Defconfig"
export DEFCONFIG=x86_64_moor_defconfig
echo "Setting bzImage Location For FlareX kernel"
export BZIMAGE=arch/x86/boot/bzImage
echo "Enabling Graphite Optimizations"
export ENABLE_GRAPHITE=true
echo "Set KBUILD_BUILD_VERSION to zero at all times"
export KBUILD_BUILD_VERSION="0"
echo "Enviroment Setup Complete Now Moving To Compiling"
#Build
echo "Cleaning Out Compiled Files"
sleep 1
#make clean
wmctrl -r :ACTIVE: -N "Starting Build Process"
echo "Starting Build Process"
export USE_CCACHE=1
sleep 1
if [ -f .config ];
then
echo ".config exists"
echo "Continuing To Compiler"
sleep 1
else
echo ".config Does Not Exists"
echo "Compiling From $DEFCONFIG"
make $DEFCONFIG
sleep 1
fi
wmctrl -r :ACTIVE: -N "Compiling FareX Kernel"
make $EV -j$CPUS
if [ -f $BZIMAGE ];
then
echo "$BZIMAGE exists"
echo "Compile Complete Continuing To Packing"
sleep 1
else
echo "$BZIMAGE Does Not Exists Please Check For Compile Errors"
echo "Now exiting script"
sleep 1
exit 0
fi
clear
#make it a bit more beautiful :P
echo "script made by eoghan2t7 of xda"
printf "say thanks to him if this helped you :) \n\n"
echo "Current Date : $NOW"
echo "Applying Build Settings : done"
echo "Version Number = $VER"
echo "cleaning previous files : done"
echo "Starting Build Process : done"
echo "Build complete"
#Kernel Packing
wmctrl -r :ACTIVE: -N "FlareX Kernel Packing"
echo "Starting Packing To Recovery Flashable Zip"
cd out/
echo "Removing Old Files"
rm -rf bzImage *.zip
sleep 1
echo "Copying bzImage"
mv ../arch/x86/boot/bzImage bzImage
sleep 1
echo "Compiling FlareX_"$VER".zip"
find . -type f -exec zip FlareX_"$VER".zip {} +
nowf=$(date +"%T")
cd ..
make clean
rm out/bzImage
printf "cleaned files"
printf "\n\nzip created\n"
end=`date +%s`
runtime=$((end-start))
echo "Completion Time :"
echo "$runtime sec\n"