I download Android Emulator M1 Initial Preview from https://github.com/google/android-emulator-m1-preview/releases
Inside the .app file I found api30-gphone-arm64-v8a/system.img
which isn't a yaffs2 nor sparse file:
./unyaffs2 /tmp/android-wip/system.img /tmp/android-wip/system-img/
unyaffs2-0.2.8: image extracting tool for YAFFS2
image size (3232759808) is NOT a mutiple of 2048 + 64
operation incomplete
files contents may be broken
simg2img system.img.ext4 system.img
Invalid sparse file format at header magic
Failed to read sparse file
So what is the format of such file?
Updates:
Based on the direction from @Robert, I can see that the file is an fdisk image:
$ fdisk -lu system.img
Disk system.img: 3,1 GiB, 3232759808 bytes, 6313984 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 41F73643-DBCB-41A1-A27E-9FDB53578618
Device
Start
End Sectors Size Type
system.img1 2048
4095
2048
1M Linux filesystem
system.img2 4096 6311935 6307840
3G Linux filesystem
Now, it's unclear what format of the partition inside, because mount it as a regular linux partition fails:
$ sudo mount -o loop,offset=1048576 system.img /mnt/android-1
mount: /mnt/android-1: wrong fs type, bad option, bad superblock on /dev/loop17, missing codepage or helper program, or other error.
gparted also doesn't understand the partition: