Extract u-boot multi-file image in Python
25 Oct 2011 Matteo Mattei embedded linux pythonThis simple piece of code shows how to extract/decompress a u-boot multi-file image created with mkimage using Python. The image format is very simple:
64 bytes of image header.
4 bytes for the size of first image.
4 bytes for the size of second image.
...
4 bytes of zeros for termination.
image1.
image2.
...
You need to remember also that each image is padded to 4 bytes.