Skip to contentSkip to conversation

Combine zImage and rootfs in single uImage

U-Boot Grant Edwards 2 participants 5 messages May 22, 2012

lore
Share & tools
lore
#0 lore raw

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?

Signature · 3 lines
Grant Edwards               grant.b.edwards        Yow! I selected E5 ... but
                                  at               I didn't hear "Sam the Sham
                              gmail.com            and the Pharoahs"!
#1 lore raw

Dear Grant Edwards,

Quoted 8 lines · In message <[email protected]> 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

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Cleverness and Style have no place in getting a project completed.
                                                  -- Tom Christiansen
#2 lore raw
Quoted 1 line · Wolfgang Denk

In message <[email protected]> Grant Edwards wrote:

[...]

Quoted 11 lines
Quoted 3 lines

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.

Signature · 3 lines
Grant Edwards               grant.b.edwards        Yow! BELA LUGOSI is my
                                  at               co-pilot ...
                              gmail.com            
#3 lore raw

Dear Grant,

Quoted 4 lines · In message <[email protected]> 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).

Quoted 3 lines

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

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If there was anything that depressed him more than his own  cynicism,
it was that quite often it still wasn't as cynical as real life.
                                 - Terry Pratchett, _Guards! Guards!_
#4 lore raw
Quoted 9 lines · Wolfgang Denk
Quoted 4 lines · In message <[email protected]> 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.

Quoted 9 lines

Second, the man page for the mkimage command mentions it (not really extensively, though).

Quoted 3 lines

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,

Signature · 3 lines
Grant Edwards               grant.b.edwards        Yow! Will it improve my
                                  at               CASH FLOW?
                              gmail.com