How to generate system.img.raw to system.img

mksparse tool can transfer system.img.raw to system.img, and how can i revert the system.img to system.img.raw?

hello lizhipaoniu,

may I know what’s the actual use-case,
the flash commands works with either a sparse image or a raw image.
mksparse, it creates a compressed version of the root file system, it’s only a smaller image size to speed-up image flashing.

hi jerry.
thanks for reply.

the odm release basic image for nano to us, and then we need to setup our develop environments(create default user, install various softwares, such as cuda, pytorch, ros, nodejs, etc, the setup will spend hours time.

now we save the final rootfs on nano(setup finished) as system.img.raw(use dd commond), then mount
the system.img.raw, and copy the mounted files to overwrite ${l4t}/rootfs.

once the odm release a newer basic image(system.img), i wanna extra the rootfs from the system.img, and overwrite ${l4t}/rootfs to apply odm modfication. so that, we do not have to do setup jobs again.

for this case, we need a way to extract rootfs from system.img (sparse image)

hello lizhipaoniu,

you may have to create an customize debian packages to include all your changes. maintain your onw package and apply that to the later odm release basic image (i.e. system.img).

This is related, and I have not tried it before, but an Android tool was pointed out which might do what you want:
https://forums.developer.nvidia.com/t/decompressing-a-sparse-image/56772/5

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.