forked from lateautumn233/erofs-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
repacksuperimg.sh
executable file
·29 lines (26 loc) · 1.05 KB
/
repacksuperimg.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
function mksuper(){
Imgdir=$1
outputimg=$2
supersize=16940199936
groupsize=16936005632
super_group=qti_dynamic_partitions
superpa="--metadata-size 65536 --super-name super --virtual-ab -block-size=4096 "
for imag in $(ls $Imgdir/*.img);do
image=$(echo "$imag" | rev | cut -d"/" -f1 | rev | sed 's/_a.img//g' | sed 's/_b.img//g'| sed 's/.img//g')
img_size=$(wc -c <$Imgdir/$image.img)
superpa+="--partition "$image"_a:readonly:$img_size:${super_group}_a --image "$image"_a=$Imgdir/$image.img "
done
superpa+="--device super:$supersize "
superpa+="--metadata-slots 3 "
superpa+="--group ${super_group}_a:$groupsize "
superpa+="--group cow:0 "
superpa+="-F --output $outputimg"
bin/lpmake $superpa
}
[ ! -d super ] && mkdir super
for img in my_bigball.img my_carrier.img my_company.img my_engineering.img my_heytap.img my_manifest.img my_preload.img my_product.img my_region.img my_stock.img odm.img product.img system.img system_dlkm.img system_ext.img vendor.img vendor_dlkm.img
do
mv -f payload/$img super
done
mksuper super super.img
bin/zstd --rm super.img -o out/super.zst