-
Notifications
You must be signed in to change notification settings - Fork 2
/
remake.sh
executable file
·35 lines (29 loc) · 1.02 KB
/
remake.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
#!/usr/bin/env bash
. ./common.sh
# unused
# oldsize=6442450944
FW_SLOT="${1:-a}"
declare -i sizepro
declare -i sizeven
declare -i sizesys
sizepro=$( stat -c %s product_"${FW_SLOT}".img )
sizeven=$( stat -c %s vendor_"${FW_SLOT}".img )
sizesys=$( stat -c %s system_"${FW_SLOT}".img )
newsize=$((sizepro+sizeven+sizesys+sizesys))
./ext/otatools/bin/lpmake \
--metadata-size 65536 \
--super-name super \
--metadata-slots 2 \
--device super:6442450944 \
--group main:${newsize} \
--partition product_"${FW_SLOT}":readonly:"${sizepro}":main \
--image product_"${FW_SLOT}"=./product_a.img \
--partition product_b:readonly:0:main \
--partition vendor_"${FW_SLOT}":readonly:"${sizeven}":main \
--image vendor_"${FW_SLOT}"=./vendor_a.img \
--partition vendor_b:readonly:0:main \
--partition system_"${FW_SLOT}":readonly:"${sizesys}":main \
--image system_"${FW_SLOT}"=./system_a.img \
--partition system_b:readonly:0:main \
--sparse \
--output ./super.new.img