Some Android images are compressed by default for some builds. This is the case for example of the HiKey960 build with lunch hikey960-eng, but not for emulator builds e.g. with lunch aosp_x86_64-eng.
simg2img lives under ./out/host/linux-x86/bin/simg2img, and gets added automatically to PATH by lunch.
Note however that this is not the case for all the images, e.g. boot.img.
If you skip simg2img, you get the error:
NTFS signature is missing.
Failed to mount '/dev/loop3': Invalid argument
The device '/dev/loop3' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
when trying to mount.
It appears that the compressed format is something that fastboot can understand.
You cannot mount
boot.img
file, as it's not a valid filesystemThe
boot.img
file contains ramdisk and kernel binary (zImage
) and possiblydt.img
(device tree).There is an excellent open source project:
mkbootimg_tools
at GitHub. You can use it to split theboot.img
file and unpack the ramdisk.simg2img
Some Android images are compressed by default for some builds. This is the case for example of the HiKey960 build with
lunch hikey960-eng
, but not for emulator builds e.g. withlunch aosp_x86_64-eng
.You must first use
simg2img
to decompress them:simg2img
lives under./out/host/linux-x86/bin/simg2img
, and gets added automatically to PATH bylunch
.Note however that this is not the case for all the images, e.g.
boot.img
.If you skip
simg2img
, you get the error:when trying to mount.
It appears that the compressed format is something that fastboot can understand.
Also mentioned at: https://stackoverflow.com/a/9675784/895245
Tested in Ubuntu 16.04 host, at branch
repo init -b android-8.1.0_r1
.