Yocto Customizations#

Yocto projects facilitate custom package selection, configuration tweaks, and layer additions.

The Layering Structure of NVIDIA DriveOS Components#

The NVIDIA DriveOS™ Yocto Project is comprised of the following layers:

  1. Baseline Poky : This layer includes essential recipes, configuration files, and metadata necessary to construct an embedded Linux distribution. In NVIDIA DriveOS, poky is a foundation and Tegra-specific customizations are applied through additional layers.

  2. Tegra-specific layers : 1. meta-drive : This layer contains customizations in terms of appends and patches to be applied on Open Source recipes. 2. meta-tegra : This layer provides the build system recipes of kernel, NVIDIA-specific drivers, and Tegra-specific board configurations. 3. meta-drive-samples : This layer packages NVIDIA-specific sample applications in the Root filesystem. 4. meta-drive-debug : This layer packages NVIDIA-specific debug tools in the Root filesystem.

Important recipes include the following:

<yocto>/layers/meta-tegra/recipes-core/configs/copytarget_1.0.bb → The comprehensive recipe which copies all the prebuilt NVIDIA elements to the Root filesystem
<yocto>/layers/meta-tegra/recipes-kernel/linux/linux-nvidia-prebuilt.bb → Kernel recipe
<yocto>/layers/meta-tegra/recipes-multimedia/mm-nvm/nvm-drivers_1.0.bb → nvmedia drivers recipe
<yocto>/layers/meta-tegra/recipes-dl/tensorrt/tensorrt.bb → TensorRT libraries and required package recipe
<yocto>/layers/meta-drive/recipes-core/images/tegra-drive-os-av-image.bb → NVIDIA DriveOS Root filesystem recipe
<yocto>/layers/meta-drive/recipes-devtools/gcc/gcc-runtime_%.bbappend → Runtime toolchain append recipe
<yocto>/layers/meta-drive/recipes-kernel/linux-libc-headers/linux-libc-headers_%.bbappend → Kernel headers recipe
<yocto>/layers/meta-drive-samples/recipes-nv-samples/tensorrt-samples/tensorrt-samples.bb → TensorRT samples recipe

Create Board-specific Layers in Yocto#

The recommended method for creating a custom layer for a production board is to add all board-specific contents into a new layer. Next, add the new layer in BBLAYERS list in <yocto>/layers/meta-drive/conf/bblayers.conf.sample.

It is important to set the COMPATIBLE_MACHINE variable in all relevant recipes. For additional information, refer to Adding a New Machine.

Add a Custom Package in Root Filesystem#

To build and package a custom sample in Root filesystem, create a new recipe (<sample>.bb) within the custom layer or in an existing one. Add the <sample> to the IMAGE_INSTALL list in the NVIDIA DriveOS Root filesystem recipe to be packaged in the filesystem. For additional information, refer to Writing a New Recipe.

Reference Layer#

Refer to <yocto>/layers/meta-reference/ for examples related to image customizations such as:

  • Recipe to compile and package an app for which source code is in GitHub

  • Recipe to compile and package an app for which source code is in a local directory

  • Additions and deletions of packages from Root Filesystem

Note

These recipes are not included in the build by default. To enable them, remove all entries from BBMASK in <yocto>/layers/meta-reference/conf/layer.conf.