Scripts and utilities

Several scripts and utilities are used by mksysimage.sh (Linux) or mksysimage.bat (Windows) to build an Apps and Media image.

mksysimage.py

The first utility to run in the image-generation process is the mksysimage.py utility script. This Python script invokes other utilities to generate tar files and images for each platform. The script is located at:

$QNX_DEPLOYMENT_WORKSPACE/infra/utils/scripts/mksysimage.py

where QNX_DEPLOYMENT_WORKSPACE is the location where you copied:

base_dir/product_deployment/QSAM/1.1/deployment

By default, mksysimage.py reads a platform-specific configuration file (platform.variant/mksysimage/platform-mksysimage.cfg) from the following directory:

QNX_DEPLOYMENT_WORKSPACE/infra/product/AnM/boards/

Figure 1. mktar.py uses profile files (that list filesets and apps) to create tar files, then mksysimage.py generates an image file (.img) from these tar files.

Configuration files specify image variants for each platform; they specify which tar (.tar) files and images are generated. These tar files are intermediate containers used in the image generation process. For information, see "Image configuration settings" and "Filesets and profiles."

For all platforms, mksysimage.py generates a tar file and an image:

platform-os.tar
The content that goes into a QNX Power-Safe filesystem. Typically, this content includes all files except the ones needed for internal booting, such as MLO and IFS files.
platform-image_variant.img
The image file for the bootable media used by the platform (USB stick or micro SD card).

For ARM platforms only, mksysimage.py also generates a second tar file:

platform-dos-image_variant.tar
The content that goes into a FAT32 filesystem that includes all boot files, such as MLO and IFS files. FAT32 is compatible with most boot loaders.

The generated image includes the tar files mentioned above. Linux and Windows hosts can't read the final image, so the tar files allow you to see what will be included in an image.

You can change the default configuration file, or specify your own by using the -c option in mksysimage.py to customize your tar files and images. For more information about this utility, see mksysimage.py in the System Services Reference.

gen-osversion.py

The gen-osversion.py utility script generates the /etc/os.version file based on the specified build environment. For more information about this utility, see gen-osversion.py in the System Services Reference.

gen-ifs.py

The gen-ifs.py utility script consolidates various .build file segments into a single buildfile before calling the mkifs utility to create the .ifs file(s) that will be included in the final target image. An IFS is a bootable image filesystem that contains the procnto module, your boot script, and possibly other components such as drivers and shared objects. For more information about this utility, see gen-ifs.py in the System Services Reference.

mktar.py

The mktar.py utility creates a tar file containing the files, directories, symbolic links, and their permissions as specified in the filesets. These tar files contain the QNX Apps and Media files for the specified platform variant and are used to generate the QNX Power-Safe and FAT32 filesystems included in the QNX Apps and Media target image.

As input, the mktar.py utility uses the dos-variant.xml and os.xml files; otherwise, it uses the default profile.xml file. These files specify which filesets to include, and for os.xml, the .bar files to pre-install.

Note: The contents of a partition come from these generated tar files.

mkimage.py

The mkimage.py utility script calls the mkimage utility, and builds an image called partition_name.image from each partition. The Python script mkimage.py uses a configuration file (platform-variant.cfg) to define session variants, partitions, and image size:

mkflashimage

The mkflashimage script is included in BSPs for the i.MX6x SABRE Smart Devices and OMAP5 platforms. It is used to generate IPLs for these targets.