U-Boot Image Manipulator Wiki
Python script to create and extract U-Boot image files
Brought to you by:
ollopa
uImage.py usage:
# python uImage.py -h
Usage:
uImage.py -l image
uImage.py -c [options] image
uImage.py -x image
uImage.py -h
Options:
-h, --help show this help message and exit
-l list image contents
-c create new image
-x extract image contents
Creation Options:
-c -A arch -O os -T type -C comp -a addr -e ep -n name -d
data_file[:data_file...] image
-A ARCHITECTURE set architecture to 'arch'
-O OSTYPE set operating system to 'os'
-T IMAGETYPE set image type to 'type'
-C COMPRESSION set compression to 'comp'
-a LOADADDR iset load address to 'addr'
-e ENTRYADDR iset entry point to 'ep'
-n IMAGENAME set image name to 'name'
-d FILESPEC image data from 'datafile'
List the contents of an image:
# python uImage.py -l nova-installer-image-broadway.uImage
Image name: nova-installer-image-broadway-43
Created: Wed Dec 31 16:00:00 1969
Image type: ARM Linux Multi-File (uncompressed)
Data size: 12566392 Bytes
Load Address: 0x000000
Entry Point: 0x000000
Header CRC: 0xcf936b92 ... OK
Data CRC: 0x2defc1cd
Contents:
Image 0: 2610004 bytes
Image 1: 9956376 bytes
Multi-File Image 0: Header
--------------------------
Image name: Linux-2.6.29-palm-shank
Created: Wed Dec 31 16:00:00 1969
Image type: ARM Linux Kernel (uncompressed)
Data size: 2609940 Bytes
Load Address: 0x208000
Entry Point: 0x208000
Header CRC: 0xfd901980 ... OK
Data CRC: 0xffbe63e6
Multi-File Image 1: Header
--------------------------
Image name: ramdisk
Created: Wed Dec 31 16:00:00 1969
Image type: ARM Linux RAMDisk (uncompressed)
Data size: 9956312 Bytes
Load Address: 0x000000
Entry Point: 0x000000
Header CRC: 0xccd15a95 ... OK
Data CRC: 0xa6d2f9e9
Create a ramdisk image:
# gzip nova-installer-image-broadway-4
# python uImage.py -c -A arm -T ramdisk -C none -n ramdisk -d nova-installer-image-broadway-4.gz ramdisk.uImage
Image name: ramdisk
Created: Sun Jun 24 04:01:21 2012
Image type: ARM Linux RAMDisk (uncompressed)
Data size: 10051920 Bytes
Load Address: 0x000000
Entry Point: 0x000000
Header CRC: 0x1cf594e7 ... OK
Data CRC: 0xcf80cb73
Create a multi-file image:
# python uImage.py -c -A arm -T multi -C none -n Linux-2.6.29-palm-shank -d Linux-2.6.29-palm-shank.uImage:ramdisk.uImage my-install-image.uImage
Image name: Linux-2.6.29-palm-shank
Created: Sun Jun 24 04:04:59 2012
Image type: ARM Linux Multi-File (uncompressed)
Data size: 12662000 Bytes
Load Address: 0x000000
Entry Point: 0x000000
Header CRC: 0x71281fb4 ... OK
Data CRC: 0x9f1b4262
Contents:
Image 0: 2610004 bytes
Image 1: 10051984 bytes
Multi-File Image 0: Header
--------------------------
Image name: Linux-2.6.29-palm-shank
Created: Wed Dec 31 16:00:00 1969
Image type: ARM Linux Kernel (uncompressed)
Data size: 2609940 Bytes
Load Address: 0x208000
Entry Point: 0x208000
Header CRC: 0xfd901980 ... OK
Data CRC: 0xffbe63e6
Multi-File Image 1: Header
--------------------------
Image name: ramdisk
Created: Sun Jun 24 04:01:21 2012
Image type: ARM Linux RAMDisk (uncompressed)
Data size: 10051920 Bytes
Load Address: 0x000000
Entry Point: 0x000000
Header CRC: 0x1cf594e7 ... OK
Data CRC: 0xcf80cb73