[U-Boot] Combine zImage and rootfs in single uImage

Currently, I build a linux kernel that contains the root fileystem in the zImage file, when then gets converted into a uImage and booted from NAND flash. This is all working fine, but having the kernel build depend on the rootfs build is a problem.
In another mailing list, somebody told me that if I was using U-Boot, I could build the zImage and rootfs separately and then combine them into a single uImage file for distribution.
I've been looking through the manual and FAQs, and can't figure out how to do this. I did find a vague reference in one of the Linux kernel docs that some bootloaders will detect any "extra" bytes after the end of the zImage data and assume that they are a rootfs image. Is that how U-Boot does it? I just cat the ziminage and rootfs.cpio.gz files together and then prepend a uImage header?

Dear Grant Edwards,
In message jpgbbm$1hk$1@dough.gmane.org you wrote:
Currently, I build a linux kernel that contains the root fileystem in the zImage file, when then gets converted into a uImage and booted from NAND flash. This is all working fine, but having the kernel build depend on the rootfs build is a problem.
In another mailing list, somebody told me that if I was using U-Boot, I could build the zImage and rootfs separately and then combine them into a single uImage file for distribution.
The (deprecated) old style way (using legacy image format) is called "multi-file images".
The modern, recommended way to do things like this is using FIT images.
See the respective documentation.
Best regards,
Wolfgang Denk

On 2012-05-22, Wolfgang Denk wd@denx.de wrote:
In message jpgbbm$1hk$1@dough.gmane.org Grant Edwards wrote:
[...]
somebody told me that if I was using U-Boot, I could build the zImage and rootfs separately and then combine them into a single uImage file for distribution.
The (deprecated) old style way (using legacy image format) is called "multi-file images".
The modern, recommended way to do things like this is using FIT images.
See the respective documentation.
Thanks!
All our build/update infrastcture expects the uImage legacy image format, so I'm going to stick with the multi-file "uImage" format for now.
FWIW, I couldn't find any documentation for FIT images (it's not mentioned in in either FAQs, Table of Contents, or Index), and various google searches didn't find anything except old mailing list messages. Having the manual chopped up into hundreds of separate web pages makes impossible to search when looking for something. It would be very nice if the Manual was available as a single page.

Dear Grant,
In message jpghr5$1at$1@dough.gmane.org you wrote:
FWIW, I couldn't find any documentation for FIT images (it's not mentioned in in either FAQs, Table of Contents, or Index), and various google searches didn't find anything except old mailing list messages.
First, there is documentation in the doc/ directory - see the doc/uImage.FIT/ directory.
Second, the man page for the mkimage command mentions it (not really extensively, though).
Having the manual chopped up into hundreds of separate web pages makes impossible to search when looking for something. It would be very nice if the Manual was available as a single page.
It is. It is available as single HTML, PDF and PostScript files. See section 2.3. Availability for respective links.
Best regards,
Wolfgang Denk

On 2012-05-22, Wolfgang Denk wd@denx.de wrote:
In message jpghr5$1at$1@dough.gmane.org you wrote:
FWIW, I couldn't find any documentation for FIT images (it's not mentioned in in either FAQs, Table of Contents, or Index), and various google searches didn't find anything except old mailing list messages.
First, there is documentation in the doc/ directory - see the doc/uImage.FIT/ directory.
Doh! I forgot to look in the source tree.
Second, the man page for the mkimage command mentions it (not really extensively, though).
Having the manual chopped up into hundreds of separate web pages makes impossible to search when looking for something. It would be very nice if the Manual was available as a single page.
It is. It is available as single HTML, PDF and PostScript files. See section 2.3. Availability for respective links.
Brilliant! I've been looking for that for a while...
Thanks again,
participants (2)
-
Grant Edwards
-
Wolfgang Denk