Including files from different places

In the example above, we specified that the files at the end were to be part of the image, and mkifs somehow magically found them. Actually, it's not magic — mkifs simply looked for the environment variable MKIFS_PATH. This environment variable contains a list of places to look for the files specified in the buildfile. If the environment variable doesn't exist, then the following are searched in this order:

  1. current working directory if the filename contains a slash (but doesn't start with one).
  2. ${QNX_TARGET}/${PROCESSOR}/sbin
  3. ${QNX_TARGET}/${PROCESSOR}/usr/sbin
  4. ${QNX_TARGET}/${PROCESSOR}/boot/sys
  6. ${QNX_TARGET}/${PROCESSOR}/usr/bin
  8. ${QNX_TARGET}/${PROCESSOR}/lib/dll
  9. ${QNX_TARGET}/${PROCESSOR}/usr/lib

(The ${PROCESSOR} component is replaced with the name of the CPU, e.g. arm.)

Since none of the filenames that we used in our example starts with the "/" character, we're telling mkifs that it should search for files (on the host) within the path list specified by the MKIFS_PATH environment variable as described above. Regardless of where the files came from on the host, in our example they'll all be placed on the target under the /proc/boot directory (there are a few subtleties with this, which we'll come back to).

For our example, devc-con will appear on the target as the file /proc/boot/devc-con, even though it may have come from the host as ${QNX_TARGET}/armle-v7/sbin/devc-con.

To include files from locations other than those specified in the MKIFS_PATH environment variable, you have a number of options: