This repository was archived by the owner on Sep 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitch_microG.sh
More file actions
executable file
·101 lines (93 loc) · 2.39 KB
/
switch_microG.sh
File metadata and controls
executable file
·101 lines (93 loc) · 2.39 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash
#
# Switch script to switch/checkout to the defined branches
# for each build variant and to apply the respective patches
#
# After initial `repo sync`, the branches are initially
# created and checked out
# ------------------------------------------------------------
switch_branches() {
TOPDIR=$PWD
cd $2
echo "-"
echo "$PWD"
if [ "$2" == ".repo/local_manifests" ] ; then
REMOTE="origin"
else
REMOTE="github"
fi
if [ -n "$(git branch --list $1)" ]; then
git checkout $1
git pull $REMOTE $1 --ff-only
else
git fetch $REMOTE $1
git checkout -b $1 $REMOTE/$1
fi
cd $TOPDIR
}
switch_zpatch() {
TOPDIR=$PWD
cd z_patches
echo "-"
echo "$PWD"
case "$2" in
R) ./patches_reverse.sh
cd $TOPDIR
switch_branches $1 z_patches
;;
S) ./patches_apply.sh
;;
esac
cd $TOPDIR
}
#
# Main run
#
case "$1" in
microG)
BRANCH1="lin-19.1-microG"
BRANCH2="lin-19.1-microG"
PATCHV="S"
;;
default)
BRANCH1="lineage-19.1"
BRANCH2="lineage-19.1"
PATCHV="S"
;;
reference)
BRANCH1="lineage-19.1"
BRANCH2="changelog"
PATCHV="N"
;;
*)
echo "usage: switch_microg.sh default | microG | reference"
echo "-"
echo " default - LineageOS 19.1"
echo " microG - hardened microG build (low memory devices)"
echo " reference - 100% LineageOS 18.1 (no patches - for 'repo sync')"
exit
;;
esac
switch_zpatch $BRANCH1 R
switch_branches $BRANCH1 bionic
switch_branches $BRANCH1 build/make
switch_branches $BRANCH1 build/soong
switch_branches $BRANCH1 frameworks/base
switch_branches $BRANCH1 frameworks/native
switch_branches $BRANCH1 libcore
switch_branches $BRANCH1 packages/apps/Jelly
switch_branches $BRANCH1 packages/apps/LineageParts
switch_branches $BRANCH1 packages/apps/Settings
switch_branches $BRANCH1 packages/apps/Trebuchet
switch_branches $BRANCH1 packages/modules/Connectivity
switch_branches $BRANCH1 packages/modules/DnsResolver
switch_branches $BRANCH1 packages/modules/NetworkStack
switch_branches $BRANCH1 packages/modules/Permission
switch_branches $BRANCH1 packages/modules/Wifi
switch_branches $BRANCH1 packages/providers/MediaProvider
switch_branches $BRANCH1 system/core
switch_branches $BRANCH1 system/sepolicy
switch_branches $BRANCH1 vendor/lineage
switch_branches $BRANCH1 .repo/local_manifests
switch_branches $BRANCH2 OTA
switch_zpatch $BRANCH1 $PATCHV