forked from wileylau/erofs
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoplus-rebuild.sh
More file actions
executable file
·43 lines (42 loc) · 1.08 KB
/
Copy pathoplus-rebuild.sh
File metadata and controls
executable file
·43 lines (42 loc) · 1.08 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
#!/bin/bash
RUNDIR=$(realpath .)
cd $RUNDIR
echo "[INFO] Cleaning up existing build residue"
rm -rf ext4/*.img
PARTITIONS="my_product my_engineering my_company my_carrier my_region my_heytap my_stock my_preload my_bigball my_manifest system vendor system_ext odm"
echo "Batch converting erofs images..."
echo
for part in $PARTITIONS
do
if [ -f "$part.img" ]; then
echo "[INFO] Converting $part.img to ext4"
./erofs.sh $part.img $part
fi
done
if [ -f product.img ]; then
cp product.img ext4/
cd ext4
echo "[INFO] Merging partitions into product.img"
./product-merge.sh
else
echo "[WARNING] Product image is not present, skipping..."
cd ext4
fi
if [ -f system.img ]; then
echo "[INFO] Merging partitions into system.img"
./oplus-merge.sh
else
echo "[WARNING] System image is missing, skipping..."
fi
echo "[INFO] Removing overlay corners..."
./oplus-overlay.sh
OUT="system vendor system_ext product"
for out in $OUT
do
if [ -f $out.img ]; then
cp -fpr $out.img ../out
fi
done
[ -f system-org.img ] && mv system-org.img system.img
cp ../product.img .
echo "[INFO] Rebuild oplus images & merge done."