We’ve been doing a lot with embedded Xen here at DornerWorks, and we’re continuing to improve our methods. Here’s one for the “tips and tricks” file…
U-Boot, a popular bootloader supporting numerous processor architectures, provides a method to generate a monolithic image, called a FIT image, that includes all the images needed to boot a system. The FIT image is beneficial because it allows for image hashing, multiple configurations, and improved support. This is useful for Xen as it allows a user of an embedded system to boot between Xen or native Linux more easily. It is also useful for Xen systems that are being used in production on embedded boards. With the hash checking, you can ensure that you have all the correct images for your Xen system at boot time. A FIT image is built from an Image Source File (*.its file) using the U-Boot mkimage utility.
Here is an example of an Image Source File for a Xen system running on the CubieTruck: https://raw.githubusercontent.com/dornerworks/xen-arm-builder/fit/FIT/cubietruck-xen.its
More information on the Image Source File format can be found here: http://git.denx.de/?p=u-boot.git;a=blob_plain;f=doc/uImage.FIT/source_file_format.txt;hb=HEAD
Use the following steps to build a Xen FIT image:
$ mkimage -f cubietruck-xen.its xen.itb
Use the following steps to boot your FIT Image on your board:
fatload mmc 0 0x80000000 /xen.itb
bootm 0x80000000#config@1
After the bootm command, U-Boot will check any hashes specified for the images in the configuration. If all of the hashes are verified correctly, U-Boot loads the images into their specified load addresses and then executes the kernel. Now you have booted a Xen system using a FIT image.
The following link has slides from a presentation that we gave at this year’s Xen Developer’s Summit on booting Xen using a FIT image. http://events.linuxfoundation.org/sites/events/files/slides/U-Boot%20FIT%20for%20Xen.pdf