-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrom-build.sh
More file actions
83 lines (73 loc) · 2.22 KB
/
rom-build.sh
File metadata and controls
83 lines (73 loc) · 2.22 KB
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
#!/bin/bash
# Version 2
# Infinitive-OS
# Console Colors
red='tput setaf 1' # red
green='tput setaf 2' # green
yellow='tput setaf 3' # yellow
blue='tput setaf 4' # blue
violet='tput setaf 5' # violet
cyan='tput setaf 6' # cyan
white='tput setaf 7' # white
txtbld=$(tput bold) # Bold
bldred=${txtbld}$(tput setaf 1) # Bold red
bldgrn=${txtbld}$(tput setaf 2) # Bold green
bldblu=${txtbld}$(tput setaf 4) # Bold blue
bldcya=${txtbld}$(tput setaf 6) # Bold cyan
normal='tput sgr0'
# Get start time
res1=$(date +%s.%N)
#check for architecture
#ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/')
ARCH=32
# Manage jobs parameter
if
expr $1 : '[-][j][0-9]' >/dev/null 2>&1; then export JOBS=$1 && export PRODUCT=$2
else
if
expr $2 : '[-][j][0-9]' >/dev/null 2>&1; then export JOBS=$2 && export PRODUCT=$1
else
export PRODUCT=$1
fi
fi
if [ $ARCH = "64" ]; then
if [[ -n $PRODUCT ]]; then
source build/envsetup.sh
lunch io_$PRODUCT-userdebug
if [[ -n $PRODUCT ]]; then
wget https://raw.githubusercontent.com/Infinitive-OS/platform_vendor_io/mm6.0/io.devices
if [[ -f "./io.devices" ]]; then
while IFS='' read -r line || [[ -n $line ]]; do
#export ${i}=`grep "${i}" "io.config" | cut -d'=' -f2`
if [[ $PRODUCT == $line ]]; then
export IO_BUILDTYPE=OFFICIAL
echo -e "${bldcya}$PRODUCT is an OFFICIAL InfinitiveOS device"
echo -e "${bldcya}Building as official"
tput sgr0
fi
done < "io.devices"
rm ./io.devices
fi
fi
export USE_PREBUILT_CHROMIUM=true
echo "USE_PREBUILT_CHROMIUM=true"
#build
echo -e "Starting Compilation..."
echo -e "Building InfinitiveOS for ${bldcya}"${PRODUCT}
tput sgr0
make bacon $JOBS
else
echo "Error : Product not defined."
echo "USAGE: "
echo " ${bldred}./rom-build.sh -jX <device>"
tput sgr0
echo ""
echo "device name not specified... bailing out.. "
fi
# Get elapsed time
res2=$(date +%s.%N)
echo -e "${bldgrn}Total time elapsed: ${txtrst}${grn}$(echo "($res2 - $res1) / 60"|bc ) minutes ($(echo "$res2 - $res1"|bc ) seconds)${txtrst}"
tput sgr0
else
echo -e "${bldred}This script only supports 64 bit architecture${txtrst}"
fi