-
Notifications
You must be signed in to change notification settings - Fork 3
/
env_setup1.sh
executable file
·59 lines (48 loc) · 1.79 KB
/
env_setup1.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
#!/bin/bash
# location
if [ "${1}" != "" ]; then
export KERNELDIR=`readlink -f ${1}`;
else
export KERNELDIR=`readlink -f .`;
fi;
export PARENT_DIR=`readlink -f ${KERNELDIR}/..`;
export INITRAMFS_SOURCE=`readlink -f ${KERNELDIR}/../ramdisk`;
export INITRAMFS_TMP=${KERNELDIR}/tmp/initramfs_source;
# check if parallel installed, if not install
if [ ! -e /usr/bin/parallel ]; then
echo "You must install 'parallel' by this script to continue.";
sudo dpkg -i ${KERNELDIR}/utilities/parallel_20120422-1_all.deb
fi
# 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
# kernel
export ARCH=arm;
export SUB_ARCH=arm;
export KERNEL_CONFIG="custom_defconfig";
# build script
export USER=`whoami`;
export TMPFILE=`mktemp -t`;
# system compiler
# export CROSS_COMPILE=/home/serg/arm-eabi-4.9-cortex-a15-master_uber/bin/arm-eabi-;
# export CROSS_COMPILE=/home/serg/arm-eabi-5.2-linaro/bin/arm-eabi-;
export CROSS_COMPILE=/home/hani/android/toolchains/arm-linux-androideabi-5.1/bin/arm-eabi-;
export NUMBEROFCPUS=`grep 'processor' /proc/cpuinfo | wc -l`;
# 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