Sample Header Ad - 728x90

lpmake error "Partition should only have linear extents:"

1 vote
3 answers
1340 views
I'm trying to extract the content of super.img, modify some elements then repack it again. I followed all the steps correctly to extract the contents of super.img file. When running stat '%n %s *.img for all images, I get the following sizes:
super.img 9663676416
For the partitions within super.img, I get the following:
mi_ext_a.img 4096
mi_ext_b.img 0
odm_a.img 755478528
odm_b.img 0
product_a.img 2827481088
product_b.img 0
system_a.img 644575232
system_b.img 0
system_dlkm_a.img 98304
system_dlkm_b.img 0
system_ext_a.img 503472128
system_ext_b.img 0
vendor_a.img 1484333056
vendor_b.img 0
vendor_dlkm_a.img 37294080
vendor_dlkm_b.img 0
I noticed that the sum of the partitions is 6252732416 which is less than the super.img size (don't know if this is the problem) Now, without even modifying any partition content, I wanted to use lpmake to re-create the super.img again, hence, I created this batch
lpmake \
 --metadata-size 4096 \
 --super-name super \
 --metadata-slots 2 \
 --device super:9663676416 \
 --group main:6252736512 \
 --partition system_a:readonly:644575232:main --image system_a=./system_a.img  \
 --partition system_b:readonly:0:main --image system_b=./system_b.img \
 --partition system_ext_a:readonly:503472128:main --image system_ext_a=./system_ext_a.img  \
 --partition system_ext_b:readonly:0:main --image system_ext_b=./system_ext_b.img \
 --partition system_dlkm_a:readonly:98304:main --image system_dlkm_a=./system_dlkm_a.img \
 --partition system_dlkm_b:readonly:0:main --image system_dlkm_b=./system_dlkm_b.img \
 --partition product_a:readonly:2827481088:main --image product_a=./product_a.img  \
 --partition product_b:readonly:0:main --image product_b=./product_b.img \
 --partition vendor_a:readonly:1484333056:main --image vendor_a=./vendor_a.img \
 --partition vendor_b:readonly:0:main --image vendor_b=./vendor_b.img \
 --partition vendor_dlkm_a:readonly:37294080:main --image vendor_dlkm_a=./vendor_dlkm_a.img \
 --partition vendor_dlkm_b:readonly:0:main --image vendor_dlkm_b=./vendor_dlkm_b.img \
 --partition mi_ext_a:readonly:4096:main --image mi_ext_a=./mi_ext_a.img \
 --partition mi_ext_b:readonly:0:main --image mi_ext_b=./mi_ext_b.img \
 --partition odm_a:readonly:755478528:main --image odm_a=./odm_a.img \
 --partition odm_b:readonly:0:main --image odm_b=./odm_b.img \
 --sparse \
 --output ./super.new.img
Yet, I'm getting the below error:
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition system_a will resize from 0 bytes to 644575232 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition system_ext_a will resize from 0 bytes to 503472128 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition system_dlkm_a will resize from 0 bytes to 98304 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition product_a will resize from 0 bytes to 2827481088 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition vendor_a will resize from 0 bytes to 1484333056 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition vendor_dlkm_a will resize from 0 bytes to 37294080 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition mi_ext_a will resize from 0 bytes to 4096 bytes
lpmake I 02-07 20:36:57 3610213 3610213 builder.cpp:1012] [liblp]Partition odm_a will resize from 0 bytes to 755478528 bytes
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
Invalid sparse file format at header
Invalid sparse file format at header magic
lpmake E 02-07 20:36:59 3610213 3610213 images.cpp:320][liblp]Partition should only have linear extents: odm_b
Regardless of changing the order above, it keeps giving the same error for the last partition in the script. Any idea how to get it properly configured?
Asked by zinger (111 rep)
Feb 7, 2023, 05:40 PM
Last activity: Sep 15, 2023, 12:26 PM