forked from minealex2244/Aldeon-Kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv_setup.sh
executable file
·107 lines (82 loc) · 2.4 KB
/
env_setup.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
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
100
101
102
103
104
105
106
107
#!/bin/bash
# Colorize and add text parameters
export red=$(tput setaf 1) # red
export grn=$(tput setaf 2) # green
export blu=$(tput setaf 4) # blue
export cya=$(tput setaf 6) # cyan
export txtbld=$(tput bold) # Bold
export bldred=${txtbld}$(tput setaf 1) # red
export bldgrn=${txtbld}$(tput setaf 2) # green
export bldblu=${txtbld}$(tput setaf 4) # blue
export bldcya=${txtbld}$(tput setaf 6) # cyan
export txtrst=$(tput sgr0) # Reset
# check if ccache installed, if not install
if [ ! -e /usr/bin/ccache ]; then
echo "You must install 'ccache' to continue.";
sudo apt-get install ccache
fi
# check if xmllint installed, if not install
if [ ! -e /usr/bin/xmllint ]; then
echo "You must install 'xmllint' to continue.";
sudo apt-get install libxml2-utils
fi
echo "${bldcya}***** Clean up Environment before compile *****${txtrst}";
# Make clean source
read -t 5 -p "Make clean source, 5sec timeout (y/n)?";
if [ "$REPLY" == "y" ]; then
make distclean;
make mrproper;
fi;
# clear ccache
read -t 5 -p "Clear ccache but keeping the config file, 5sec timeout (y/n)?";
if [ "$REPLY" == "y" ]; then
ccache -C;
fi;
TARGET=$1
if [ "$TARGET" != "" ]; then
echo
echo "Starting your build for $TARGET"
else
echo ""
echo "You need to define your device target!"
echo "example: build_kernel.sh G920P"
exit 1
fi
# location
export KERNELDIR=`readlink -f .`;
# set build variables
BK=build_kernel
export KCONFIG_NOTIMESTAMP=true
export ARCH=arm64;
export SUB_ARCH=arm64;
# G920F
if [ "$TARGET" = "G920F" ] ; then
export KERNEL_CONFIG="exynos7420-zeroflte_defconfig";
fi;
# G925F
if [ "$TARGET" = "G925F" ] ; then
export KERNEL_CONFIG="exynos7420-zerolte_defconfig";
fi;
# G920T
if [ "$TARGET" = "G920T" ] ; then
export KERNEL_CONFIG="zerofltetmo_02_defconfig";
fi;
# G925T
if [ "$TARGET" = "G925T" ] ; then
export KERNEL_CONFIG="zeroltetmo_02_defconfig";
fi;
# G920W8
if [ "$TARGET" = "G920W8" ] ; then
export KERNEL_CONFIG="zerofltebmc_02_defconfig";
fi;
# G925W8
if [ "$TARGET" = "G925W8" ] ; then
export KERNEL_CONFIG="zeroltebmc_02_defconfig";
fi;
# build script
export USER=`whoami`;
export TMPFILE=`mktemp -t`;
# system compiler
export CROSS_COMPILE=/home/minealex2244/Desktop/SM-G920F/aarch64-linux-android-4.9/bin/aarch64-linux-android-
# CPU Core
export NUMBEROFCPUS=`grep 'processor' /proc/cpuinfo | wc -l`;