Buildfile structure and contents

The buildfile for a bootable image includes four major components.

The buildfile for a bootable image must include a startup script, and specify a bootstrap loader, an operating system, and executables and shared libraries.

Note:
  • Executables aren’t strictly required, but without them the system wouldn’t actually do anything!
  • In most cases, the bootable image needs libc.so, which is required to run an executable.

Below is a very simple buildfile that can be used to generate a bootable image. This buildfile is based on a buildfile for a fictional Elsinor Hamlet 2B ON2B BSP, but has had all but the most basic OS capabilities stripped out:

[image=0x10800000]
[virtual=armle-v7,raw] .bootstrap = {
# Startup parameters:
    # '-c' -> configure bottom SD slot pin muxing
    #			to support Silex SDIO based WLAN module
    # '-m' -> enable D-Cache, MMU during startup,
    #			which will improve boot time if booting from a compressed IFS.	
    # '-W' -> enable watchdog
    
    startup-imx6x-sabrelite -m -v

    PATH=:/proc/boot:/bin:/sbin:/usr/bin:/usr/sbin \
    LD_LIBRARY_PATH=:/proc/boot:/lib:/usr/lib:/lib/dll procnto-smp-instr -v
	
}
[+script] .script = {
# Initialise the console
    procmgr_symlink ../../proc/boot/libc.so /usr/lib/ldqnx.so.2
    devc-sermx1 -e -F -S -c80000000 0x021E8000,59

    reopen
    display_msg Welcome to QNX Neutrino 7.0 on the Elsinor Hamlet 2B ON2B (ARM Cortex-A9 MP Core)

    [+session] ksh /proc/boot/.console.sh &
}

# Redirect console messages
[type=link] /bin/sh=/proc/boot/ksh
[type=link] /dev/console=/dev/ser1
[type=link] /tmp=/dev/shmem

# Programs require the runtime linker (ldqnx.so) to be at a fixed location

# Shared libraries
libc.so
libm.so.3

# Executables
[data=c]
devc-sermx1

# Set environment and start the main shell

[perms=0744] .console.sh={
echo setting env variables.

export SYSNAME=nto
export TERM=qansi
export HOME=/
export PATH=:/bin:/usr/bin:/sbin:/usr/sbin:/proc/boot
export LD_LIBRARY_PATH=:/lib:/usr/lib:/usr/lib/graphics/2BON2B:/lib/dll:/proc/boot

# REMOTE_DEBUG (gdb or Momentics)
#  - refer to the help documentation for the gdb, qconn and the IDE
#    for more information on remote debugging
#  - the commands shown require that NETWORK is enabled too

devc-pty
waitfor /dev/ptyp0 4
#waitfor /dev/socket 4
#PATH=$PATH:/usr/bin qconn port=8000

ksh -l
}

# general commands

cp
ls
cat
ksh
pipe
pidin
uname
slogger2
slog2info
slay
mount
umount
use
date
shutdown
rm
mv

This buildfile consists of the sections listed above:

For more detailed information about each part of the buildfile, see below: The bootstrap file, Scripts, and The rest of the buildfile.

Note:

To make an image from this buildfile, from the command line, enter: mkifs shell.bld shell.ifs (see Building an OS image).

Sample buildfiles

For sample buildfiles, use the buildfiles that come with your BSP and refer to the appendix Sample Buildfiles in this guide.

See also the mkifs entry in the Utilities Reference, and .