A minimalist buildfile

Updated: April 19, 2023

Here's an example of a buildfile stripped down to minimize the time required to capture video and launch Screen.

The system built with this buildfile would have very limited functionality, so unless displaying a video stream from a camera is all you need it to do, you will need to add the components needed for the additional functionality. Remember, to start the services you need immediately first, and then every component added increases the size of the IFS, hence the time it will take to copy the IFS into RAM (see the Optimizing the Loading and Launching of the OS chapter).

# Identify the buildfile and board

# Comments and notes

#[+keeplinked]
[+compress]
[image=0x40100000]
[virtual=aarch64le,raw] .bootstrap = {
    # Options specific to this BSP:
    #
    startup-rcar_v3h -P4 -W -Dscif0
    
    # When assigned globally, the variable will be set not only in procnto's
    # environment, but also in the environment of each subsequently started
    # process, including procnto, both in the bootstrap section and in the
    # startup script.
    # PATH set for procnto is the safe path for executables.
    PATH=/proc/boot:/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib
    
    # LD_LIBRARY_PATH is set "locally", on a line with a command invocation.
    # It will only be available in this command’s environment.   
    # LD_LIBRARY_PATH set here is the *safe* path for libraries.
    # i.e., These are the paths searched by setuid/setgid binaries.
    #          (confstr(_CS_PATH...) and confstr(_CS_LIBPATH...))
    LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib:/usr/photon/lib:/usr/lib:/tmp:/etc procnto-smp-instr -ae
}

# Script inline file

[+script] .script = {

    display_msg Welcome to QNX Neutrino 7.1.0 on the R-Car V3H Condor Board

    # Set up environment variables
    ENV=/etc/profile

    # Start only the drivers and utilities essential for graphics support
    ...

    # Start graphics
    display_msg "Starting Screen ..."
    screen -c /usr/lib/graphics/rcarv3h/graphics.conf

    [+session] ksh
}


# Include only the shared libraries you need
...

# Include only the shared objects for device drivers you need
...

# Include required executables
...

# Include libqcrypto support, if required
...

# Include only drivers and utilities you need
...

# General commands
...

# Screen composition manager support
/lib/libimg.so=libimg.so

# uncomment for Image Loading
# img_codec_bmp.so
# img_codec_gif.so
# img_codec_jpg.so
# img_codec_png.so
# img_codec_sgi.so
# img_codec_tga.so
# img_codec_pcx.so
# img_codec_tif.so
# img_codec_wbmp.so
# libgif.so.5
# libjpeg.so.4
# libpng16.so.0
# libtiff.so.5
# libz.so.2
# liblzma.so.5
# libpng.so

# Graphics support - screen
screen-debug.so
screen-gles1.so
screen-gles2.so
screen-sw.so
screen-stdbuf.so
screen-roguetq.so
screen-rcar3-alloc.so

libswblit.so

libEGL.so
libGLESv1_CL.so
libGLESv1_CM.so
libGLESv2.so
libWFD.so
libgestures.so
libmemobj.so
libscrmem.so
libinputevents.so
libkalman.so
libscreen.so
libmtouch-calib.so

libcapture.so
libcapture-soc-rcar3.so
libcapture-decoder-adv7482.so
libcapture-usb-uvc.so

# Graphics base libraries
/lib/dll/libwfdcfg-sample.so=libwfdcfg-sample.so
/usr/lib/libCL.so=libCL.so

# Input libraries
/lib/libmtouch-devi.so=libmtouch-devi.so
/lib/libmtouch-fake.so=libmtouch-fake.so
/lib/libmtouch-hid.so=libmtouch-hid.so
/lib/libmtouch-inject.so=libmtouch-inject.so

# Video capture libraries
/usr/lib/libcapture-simulated.so=libcapture-simulated.so

# Board specific graphics libraries
/usr/lib/graphics/rcarv3h-debug/libwfdcfg-rcarv3h-starterkit_g.so=graphics/rcarv3h-debug/libwfdcfg-rcarv3h-starterkit_g.so
/usr/lib/graphics/rcarv3h-debug/libWFDrcar3_g.so=graphics/rcarv3h-debug/libWFDrcar3_g.so
/usr/lib/graphics/rcarv3h/libwfdcfg-rcarv3h-starterkit.so=graphics/rcarv3h/libwfdcfg-rcarv3h-starterkit.so
/usr/lib/graphics/rcarv3h/libWFDrcar3.so=graphics/rcarv3h/libWFDrcar3.so

# Scaling configuration
[search=${QNX_TARGET}/etc/system/config]/etc/system/config/scaling.conf=scaling.conf

# Screen executables
/sbin/screen=screen
/usr/bin/gles1-vsync=gles1-vsync
/usr/bin/gles2-gears=gles2-gears
/usr/bin/sw-vsync=sw-vsync

/usr/bin/calib-touch=calib-touch
/usr/bin/events=events

# Graphics base executables
/usr/bin/dpy-vsync=dpy-vsync
/usr/bin/egl-configs=egl-configs
/usr/bin/gles1-gears=gles1-gears
/usr/bin/gles3-gears=gles3-gears
/usr/bin/screen-gles2-tools=screen-gles2-tools
/usr/bin/screenshot=screenshot
/usr/bin/sharewin=sharewin
/usr/bin/win-vsync=win-vsync

# Fonts
/usr/lib/libfontconfig.so=libfontconfig.so
/usr/lib/libfreetype.so=libfreetype.so
/usr/bin/font-freetype=font-freetype

# Image Codecs
[search=${QNX_TARGET}/etc/system/config]/etc/system/config/img.conf=img.conf

# Inputs
/usr/sbin/mtouch=mtouch

# Video capture executables
/usr/bin/vcapture-demo=vcapture-demo

# Board specific graphics files
/usr/lib/graphics/rcarv3h-debug/graphics.conf=graphics/rcarv3h-debug/graphics.conf
/usr/lib/graphics/rcarv3h/graphics.conf=graphics/rcarv3h/graphics.conf

# Interrupt map
...

For more information about the bootstrap inline file, scripts in buildfiles, and buildfiles in general, see Building Embedded Systems, and in particular the OS Image Buildfiles chapter.