Closed Liberations closed 9 months ago
unpack/view: oem.img may be sparse ext4 image, or raw ext4 image. If it's sparse image, we can convert it to raw ext4 image, and then view the contents by mounting the contents to some directory. If it's raw ext4 image, we can directly mount it without using this tool.
pack: While creating the (sparse) ext4 image should include external ext4 mkfs/tunefs tools. Let me have a think ...
view oem.img contents:
$ udisksctl loop-setup --file oem.img
Mapped file oem.img as /dev/loop0.
$ udisksctl mount -b /dev/loop0
Mounted /dev/loop0 at /media/guest/oem
But this ext4 image has exactly the size of its contents, no spare space for extra new data poured in.
$ udisksctl unmount -b /dev/loop0
Unmounted /dev/loop0.
$ udisksctl loop-delete -b /dev/loop0
From latest AOSP, we see Google may use EROFS instead of ext4 from Android 13. if you're really interested in unpacking/packing oem.img, please refer to AOSP code, there are tools to make the images. Thanks.
Latest code supports ext4 now
Really late here but @cfig you can run resize2fs -l (size in G,M,K,etc) (img file).img
to resize the image!
https://share.weiyun.com/xknPvylq
oem.img
it is transfer from oem.new.dat.br by rom tools.
oem_PD2049_CN-ZH_FULL_SC_CT-BMW.zip
it is office update zip
oem_unpack.zip
it is adb pull from system root /oem