Prepare the work environment

Before running mksysimage.py to generate a new target image, you must prepare the work environment on your host system.

On your host system, before you can generate an image for your target board, you must use the QNX Software Center to install the Typical Configuration package for this release and the Hardware Support for hardware_boardname package that matches the hardware target you are building an image for, where hardware_boardname represents the name of the hardware target (e.g., Renesas R-Car H3 Starter Kit Premier, ASRock Beebox).

It's important to note that you should use locked packages from the QNX Software Center when you want to replicate the reference images that are provided as part of this product release. This is because locked packages ensure that the same versions of the components are used to build the reference images when the product was released. If you don't use a locked package, the components can be updated by the QNX Software Center based on your update policy and you might build the image using different versions of the components. For information about the Typical Configuration package and Hardware Support packages, see the Packaging in this product in the Getting Started Overview guide.

Product-specific scripts

As well as the generic mkworkspace.py and mksysimage.py scripts, your product includes scripts that you can run to set your environment variables. example, QNX Platform for ADAS includes qnxadas-env.bat for Windows hosts, and qnxadas-env.sh for Linux/macOS hosts.
Note: If you haven't run the qnxsdp-env.bat (Windows) or qnx-sdp-env.sh (Linux/macOS), the product-specific scripts run them for you.

These scripts are named according to the pattern shown in the figure below:



Figure 1. Naming convention for product-specific scripts used to set environment variables

In our instructions, we use qnxsdp-productrelease-env.bat and qnxsdp-productrelease-env.sh to refer to these scripts. Substitute the QNX SDP release number, product, and product release number for your product.

Set the environment variables and set up the workspace

When you have the required components in a convenient location on your host, you must:

  1. Set BSP_ROOT_DIR to the directory where you extracted the BSP archive (ZIP file) that was downloaded to your $QNX_BASE/bsp directory. Ensure that you use the BSPs that are compatible with your product release. For information about compatibility, see the release notes for your product.
  2. Do following to set the rest of the environment variables before you can create your workspace:
    • (Windows) run qnxproduct-env.bat script

    • (Linux/macOS) source the qnxproduct-env.sh script.

    For example, for QNX Platform for ADAS on a Linux host:

    $ source /users/root/qnx700/qnxadas-env.sh

    For more information about the environment variables you need to set, see qnx*-env.

  3. Run the mkworkspace.py (Linux, macOS) or the mkworkspace.bat (Windows) script. Use the -w option to specify the workspace and the -p option to specify the platform, which sets up your workspace and copies your content files to it.

    mkworkspace.py -w /home/user/workspace -p platform
    						
    where platform is one of:
    • denverton
    • nuc6
    • rcarh3spre
    • rcarv3m3
    • s32v

    This script simplifies the work environment by copying only the required files and directories to it (see mkworkspace.py).

Note: You need to run mkworkspace.py only once, unless you want to create a new workspace or start over again. Remember, however, that the environment variables are set locally, so you must set them again if you open a new shell.

When you have completed the tasks described above, the directories and files in your workspace should follow the model described in Workspace directories.” You should now be able to generate and assemble a new target image.

Environment variables

Most of the environment variables are set after your run the environment shell (Linux or macOS) or batch (Windows) scripts. After you run the environment scripts, you must set the following environment variables manually in the same terminal (Linux or macOS) or Command Prompt window (Windows) that you ran the environment scripts from:

BSP_ROOT_DIR
The name of the directory where you extracted the BSP archive. By default, when you install a BSP, the archive of the file is downloaded to $QNX_BASE/bsp where $QNX_BASE is the location of your installation, such /Users/your_user_id/qnx700.
You can choose to extract the ZIP file in that directory or different location on your host machine.
QNX_DEPLOYMENT_WORKSPACE
The path to your deployment workspace, where mkworkspace.py has copied your files.
Note:

For information about the environment variables used to modify the search paths, see Search path environment variables in the Modifying Content chapter.

See the QNX SDP Utilities Reference appendix Commonly Used Environment Variables for detailed list of environment variables used in the QNX SDP.