This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathoplus-merge.sh
executable file
·68 lines (64 loc) · 2.21 KB
/
oplus-merge.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
#!/bin/bash
# oplus merger
RUNDIR=$(realpath .)
prep() {
echo "[INFO] Setting up"
cd $RUNDIR
mkdir system
mount system.img system
}
PARTITIONS="my_carrier my_company my_engineering my_heytap my_manifest my_preload my_product my_region my_stock my_version my_bigball"
merge() {
cd $RUNDIR
echo "[INFO] Merging $partition into system"
mkdir $partition >/dev/null 2>&1
mount -o loop -t auto $partition.img $partition >/dev/null 2>&1
cd system/$partition/ >/dev/null 2>&1
cp -fpr ../..//$partition/apkcerts.txt . >/dev/null 2>&1
cp -fpr ../../$partition/applist . >/dev/null 2>&1
cp -fpr ../../$partition/build.prop . >/dev/null 2>&1
cp -fpr ../../$partition/custom_info.txt . >/dev/null 2>&1
cp -fpr ../../$partition/decouping_wallpaper . >/dev/null 2>&1
cp -fpr ../../$partition/del* . >/dev/null 2>&1
cp -fpr ../../$partition/etc . >/dev/null 2>&1
cp -fpr ../../$partition/framework . >/dev/null 2>&1
cp -fpr ../../$partition/lost+found . >/dev/null 2>&1
cp -fpr ../../$partition/media . >/dev/null 2>&1
cp -fpr ../../$partition/non_overlay . >/dev/null 2>&1
cp -fpr ../../$partition/plugin . >/dev/null 2>&1
cp -fpr ../../$partition/product_overlay . >/dev/null 2>&1
cp -fpr ../../$partition/res . >/dev/null 2>&1
cp -fpr ../../$partition/vendor . >/dev/null 2>&1
cd ../../ >/dev/null 2>&1
umount -f -l $partition >/dev/null 2>&1
rm -rf $partition/ >/dev/null 2>&1
}
odmerge() {
cd $RUNDIR
echo "[INFO] Merging odm into system"
mkdir odm >/dev/null 2>&1
mount -o loop -t auto odm.img odm >/dev/null 2>&1
cd system >/dev/null 2>&1
rm -rf odm/
cp -fpr ../odm/ . >/dev/null 2>&1
rm -rf odm/etc/ueventd*
rm -rf odm/etc/*.xml
rm -rf odm/vendor/
rm -rf odm/firmware/
cd ..
umount -f -l odm >/dev/null 2>&1
rm -rf odm >/dev/null 2>&1
}
clean() {
echo "[INFO] Cleaning up"
cd $RUNDIR
umount -f -l system/
rm -rf system/
}
prep
for partition in $PARTITIONS; do
merge
done
#odmerge
clean
echo "[INFO] Done"