When you complete a project, you
must build a target image that your users can install on their target platform. You do this by
packaging all the artifacts that make up the complete target image:
- Board Support Packages (BSPs)
- the core OS and utilities
- HTML5 apps
- Qt runtime
- HMI
- Browser/WebKit
- other binaries
Typically, you wouldn't build all of these components yourself. Instead, you have these
prebuilt binaries available in your development environment when you install the QNX CAR
platform.
Artifact Organization
When designing a system, you choose how to organize artifacts into one or more IFS files and partition images. Partition
images are then combined to produce target images:
- Image filesystems (IFS) (or .ifs files) are created by mkifs.
An IFS is a single binary that is loaded into RAM, generally on bootup by a bootloader or IPL. IFS files are
usually quite minimal and contain only the drivers and libraries needed to start the kernel and mount additional
partitions. Because an IFS is loaded into RAM and the files in it are more difficult to upgrade than files on a
regular filesystem, an IFS is usually used only for startup code and a few key libraries, especially libraries that
need to load early in the boot process to speed up boot time or improve performance.
In the case of the QNX CAR platform, for example, everything required to start a minimal system and display the backup camera
is stored in an IFS, but the HMI and apps are loaded from a storage device. The primary IFS is automatically
mounted to /proc/boot.
- Partition images (or .image files) are created by mkxfs. These files contain
the contents of a partition that are written to a storage device. A system might consist of a number of partitions. For
example, an SD image for the QNX CAR platform contains 3 partitions: a FAT16 partition for booting and 2 QNX6 partitions
(one for system data and another for user data). Partition images can contain a variety of file types including IFS files.
For the QNX CAR platform, the primary IFS is stored in a FAT16 partition because most targets are capable of reading
FAT16 with their default bootloader.
- Partition images are combined to produce target images (or .img files). A target image
(also referred to as a disk image or system image) contains an entire target system—a partition table and
the partition contents—and so is convenient to install. You can load a target image directly onto a storage
medium such as an SD card without having to modify partition information.
System Generation
In general terms, to generate a system image for the QNX CAR platform, you perform the following steps:
- Develop the .build files that contain the scripts and files used by mkifs.
- Run mkifs to generate IFS files.
- Determine all the files to include in each partition and develop .build files to be used by
mkxfs.
- Run mkxfs to generate all the partition images.
- Run diskimage to generate the partition table and write all the partition images to a
single .img file.
Because generating the various files is time-consuming and error-prone, this isn't the process we recommend.
Instead, the QNX CAR platform includes an mksysimage.py script that handles the entire process
of generating a system image. In fact, the mksysimage.py script supports multiple platforms and
a number of configurations per platform. For example, in the case of
OMAP5432, the mksysimage.py script produces images for SD card, EMMC, and EMMC + SATA SSD.
For more information on mksysimage.py, see the following sections: