-
Notifications
You must be signed in to change notification settings - Fork 1
/
entrypoint.sh
62 lines (45 loc) · 1.77 KB
/
entrypoint.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
#!/usr/bin/env bash
set -e
(
if [ -z "$1" ]; then
lineageBranch="lineage-17.1"
else
lineageBranch=$1
fi
if [ -z "$2" ]; then
scriptsBranch="android-10"
else
scriptsBranch=$2
fi
# Fetch LineageOS
if [ ! -d ~/android/rom/lineageOS/10 ]; then
mkdir -p ~/android/rom/lineageOS/10
cd ~/android/rom/lineageOS/10
repo init -u git://github.com/LineageOS/android.git -b $lineageBranch
else
cd ~/android/rom/lineageOS/10
repo forall -vc "git reset --hard"
fi
# Fetch patched manifest
if [ ! -d ~/android/rom/lineageOS/10/.repo/local_manifests ]; then
git clone https://github.com/MartinX3-AndroidDevelopment-LineageOS/local_manifests.git -b MartinX3/$lineageBranch ~/android/rom/lineageOS/10/.repo/local_manifests
fi
# Fetch build scripts
if [ ! -d ~/SCRIPTS_BUILD ]; then
git clone https://github.com/MartinX3-AndroidDevelopment/SCRIPTS_BUILD.git -b $scriptsBranch ~/SCRIPTS_BUILD
else
cd ~/SCRIPTS_BUILD
git reset --hard
git pull
fi
chmod +x ~/SCRIPTS_BUILD/ROM/SODP/XPERIA_TAMA/LineageOS/build.sh
cd ~/SCRIPTS_BUILD/ROM/SODP/XPERIA_TAMA/LineageOS/
# Remove interactive input
sed -i 's|read -n1 -r -p "Press space to continue..."||g' ~/SCRIPTS_BUILD/ROM/SODP/XPERIA_TAMA/LineageOS/build.sh
# Set build cache folder to customROM out dir
sed -i 's|build_cache=/media/martin/extLinux/developer/android/cache/lineageOS/10|build_cache=/home/developer/android/rom/lineageOS/10/out|g' ~/SCRIPTS_BUILD/ROM/SODP/XPERIA_TAMA/LineageOS/build.sh
# Set build folder for final rom output
sed -i 's|build_out=/media/martin/extLinux/developer/android/out/lineageOS/10|build_out=/home/developer/out|g' ~/SCRIPTS_BUILD/ROM/SODP/XPERIA_TAMA/LineageOS/build.sh
# Run build
./build.sh
) |& tee ~/out/build.log