Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: Build Nvidia Jetpack Yocto Images for Nvidia Orin NX/Orin Nano/Thor platforms
minutes_to_complete: 180

description: Learn how to utilize the new yocto support in Nvidia Jetpack to build a custom linux image for the Jetson Orin NX, Orin Nano, and Thor platforms.

who_is_this_for: This is a moderately advanced topic for engineers who want to construct a highly customizable Jetpack image for the Jetson platforms via Yocto build processes.

learning_objectives:
- Learn about the Yocto custom linux distro creation process and platform
- Utilize scripting to initiate a Yocto build for a give targeted Jetson platform
- Flash and run the custom build on the Jetson platform


prerequisites:
- Experience using Linux on embedded or SBC platforms
- Experience with the Yocto build system
- Experience with Nvidia Jetpack and the Jetson platforms (Orin NX, Orin Nano, and Thor)

author: Doug Anson

### Tags
skilllevels: Advanced
subjects: Performance and Architecture
tools_software_languages:
- Yocto
- C

cloud_service_providers:
- AWS

armips:
- Neoverse

operatingsystems:
- Linux

shared_path: true
shared_between:
- embedded-and-microcontrollers
- automotive

further_reading:
- resource:
title: OE4T
link: https://oe4t.github.io/master/
type: website


### FIXED, DO NOT MODIFY
# ================================================================================
weight: 1 # _index.md always has weight of 1 to order correctly
layout: "learningpathall" # All files under learning paths have this same wrapper
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# ================================================================================
# FIXED, DO NOT MODIFY THIS FILE
# ================================================================================
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
title: "Next Steps" # Always the same, html page title.
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Creating Nvidia Jetpack images with Yocto

weight: 2

layout: "learningpathall"
---

## Introduction to Yocto

The Yocto Project is an open-source collaboration project that provides tools, templates, and processes for creating custom Linux-based systems for embedded products. Rather than being a Linux distribution itself, Yocto gives developers the build framework needed to create a purpose-built Linux distribution tailored to specific hardware, application, security, performance, and lifecycle requirements. It is widely used in embedded systems because it enables reproducible builds, fine-grained image customization, cross-compilation, software package control, and long-term maintainability across different hardware architectures. (The Yocto Project)

At the center of Yocto is the OpenEmbedded build system, which uses BitBake as its task executor. BitBake processes metadata, recipes, configuration files, and layers to fetch source code, apply patches, compile software, package outputs, and assemble bootable Linux images. Yocto’s reference distribution, Poky, provides a working baseline that developers can extend with board support packages, middleware, applications, and product-specific configuration. This layered model is one of Yocto’s main strengths: hardware support, vendor software, open-source packages, and product customizations can be separated cleanly, making the final image easier to maintain and reproduce.

Yocto is especially valuable when a project needs more control than a general-purpose Linux distribution provides. Instead of starting with a full desktop or server operating system and removing unnecessary components, Yocto allows developers to build only what is needed. This can reduce image size, improve boot time, simplify updates, reduce attack surface, and make regulatory or production requirements easier to manage. For embedded AI, robotics, industrial systems, and edge devices, this level of control is often essential.

## Overview of Using Yocto to Build NVIDIA JetPack Images

NVIDIA JetPack is the software stack used on NVIDIA Jetson platforms. It includes Jetson Linux, which provides the board support package, bootloader, Linux kernel, NVIDIA drivers, toolchain, and related platform components, along with accelerated AI and compute libraries such as CUDA, TensorRT, cuDNN, VPI, and other Jetson-specific software. (NVIDIA Developer)

Traditionally, JetPack images are based on NVIDIA’s Ubuntu-based Jetson Linux distribution. However, Yocto can be used to build custom Jetson images that include Jetson Linux and JetPack components while giving developers much greater control over the final root filesystem, packages, services, security configuration, and product-specific software. NVIDIA now documents a Yocto-based path for Jetson platforms, including guidance for selecting machines, building images, flashing devices, and customizing images for production use. (NVIDIA Docs)

The primary Yocto layer used for NVIDIA Jetson support is meta-tegra, maintained under the OpenEmbedded for Tegra, or OE4T, project. This layer integrates NVIDIA Jetson Linux/L4T and JetPack components into the Yocto/OpenEmbedded build system so developers can create custom Linux images for Jetson-based products. (GitHub)

A typical Yocto-based JetPack workflow includes the following steps:

1. Select the Jetson hardware and JetPack/L4T release
The first step is to identify the target Jetson module or developer kit, such as Jetson Orin, Jetson AGX Orin, Jetson Orin Nano, or Jetson Thor, and then choose the matching JetPack and Jetson Linux release. NVIDIA’s current JetPack download notes identify JetPack 7.2 with Jetson Linux 39.2 as a current release and include Yocto-related quick-start material for supported developer kits. (NVIDIA Developer)
2. Set up the Yocto build environment
The build host is prepared with the required Linux packages, source directories, and Yocto build tools. Developers typically start from Poky or an OE4T-supported manifest, then add the required layers, including OpenEmbedded Core, meta-openembedded, and meta-tegra.
3. Choose the correct machine configuration
Yocto builds are driven by a MACHINE setting that identifies the target board. For Jetson platforms, the selected machine configuration determines the kernel, bootloader integration, device tree, firmware, GPU driver components, flashing artifacts, and board-specific image outputs.
4. Configure the image
Developers then decide what should be included in the image. This may include core Linux utilities, networking, SSH, container runtime support, CUDA libraries, TensorRT, multimedia components, robotics middleware, AI applications, security tools, update agents, and custom services. Yocto image recipes and package groups make it possible to define minimal, development, or production image variants.
5. Build the image with BitBake
BitBake processes the selected image recipe and all of its dependencies. It downloads sources, applies patches, cross-compiles packages, assembles the root filesystem, and generates deployable artifacts. For Jetson targets, the output typically includes the root filesystem and supporting boot or flashing files needed to install the image onto the device.
6. Flash the Jetson device
After the build completes, the generated image is flashed to the Jetson module or developer kit. NVIDIA’s Yocto documentation and quick-start materials describe flashing flows for supported Jetson hardware, including prebuilt Yocto images for some JetPack releases and developer kits. (NVIDIA Docs)
7. Customize and productize
Once the image boots, teams usually iterate on kernel configuration, device trees, drivers, system services, application packages, security policies, boot behavior, update strategy, and performance tuning. The Yocto layer model allows these changes to be captured in custom layers instead of being manually applied to a running target, which improves repeatability and makes production releases easier to audit.

Using Yocto for JetPack images is especially useful for production Jetson deployments. It allows a team to move from a general developer-focused JetPack environment to a controlled product image with only the required packages and services. This can improve boot time, reduce storage usage, simplify compliance review, support reproducible builds, and make over-the-air update strategies more manageable.

The main tradeoff is complexity. Yocto has a steep learning curve, and building Jetson images requires understanding both Yocto concepts and NVIDIA’s Jetson software stack. Developers need to manage layer compatibility, JetPack/L4T version alignment, machine configuration, license handling, proprietary NVIDIA components, and flashing workflows. For early prototyping, NVIDIA’s standard JetPack flow may be faster. For production systems, however, Yocto provides a stronger foundation for controlled, repeatable, and highly customized Jetson Linux images.

In summary, Yocto gives embedded developers a powerful framework for creating custom Linux distributions, while NVIDIA’s Jetson Linux, JetPack, and meta-tegra integration make it possible to bring that same level of control to Jetson-based AI and edge-computing systems. The result is a flexible path from prototype to production: developers can use NVIDIA’s accelerated software stack while still owning the structure, contents, and lifecycle of the final embedded Linux image.

## What you've learned and what's next

You have learned about the yocto build system for creating custom linux distributions and how Nvidia makes use of yocto to create custom Jetpack images for its current Jetson platforms.

Next, lets initiate a Google Cloud C4A Axion instance and start our own yocto build!
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
title: Yocto image build on Arm for Nvidia Jetson
weight: 4

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Overview

In this section, the configured C4A instance will now get further configured to execute a yocto build process to produce a custom linux distribution image for a given Nvidia Jetson platform.

## Initial Setup

Within the SSH shell to your C4A instance, clone this repo:

```bash
cd $HOME
git clone https://github.com/DougAnsonAustinTx/jetpack-yocto-builder
```

## Invoke the build

After cloning the above repo, lets explore the repo contents:

```bash
cd $HOME/jetpack-yocto-builder
chmod 755 *.sh
ls
```

These scripts support building a yocto image for Jetson Thor, Jetson Orin NX, and Jetson Orin Nano/Super Nano:

./build-thor.sh: The build script for Nvidia Jetson Thor
./build-orinnx.sh: The build script for Nvidia Jetson Orin NX
./build-orin-super-nano.sh: The build script for Nvidia Jetson Orin Nano and Super Nano
./build-all.sh: Builds all 3 platforms as 3 independent builds

The primary "build" script is: ./build_oe4t_jetson_multi_platform.sh.

A single argument, "--bundle" is available to collect up into an archive file all of the required contents needed to flash the device later.

Lets initiate the build for the Jetson Thor:

```bash
cd $HOME/jetpack-yocto-builder
./build-thor.sh --bundle 2>&1 1>$HOME/build.log &
```

The script will first install all of the necessary pre-requisites needed for yocto builds

{{% notice Note %}}
You may be prompted initially to restart things during the initial prerequisite installation process... just press "tab" and "Ok" for any of them that are presented.
{{% /notice %}}

Eventually the core "yocto" build process (via Yocto "bitbake") will start:

![Yocto "bitbake" build processor working highlighted#center](images/yocto-build.png "Yocto bitbake creating the Nvidia Thor yocto image")

This script will continue building until the yocto image for Thor is ready.

{{% notice Note %}}
This invocation will take a few hours to complete (sometimes more than 3 hours in fact).
{{% /notice %}}

## Yocto build process - some caveats

#### Building Yocto images takes time

The yocto build process constructs an entire linux distribution by pulling down source code from numerous repos and configuring, compiling, and installing thousands of applications. This takes some time.

{{% notice Note %}}
This invocation will take a few hours to complete (sometimes more than 3 hours.... please be patient).
{{% /notice %}}

#### Yocto builds can occasionally fail

While alternate source code mirrors are checked if needed, occasionally a given source code package is simply not downloadable at a given point in time. This will cause the yocto build process to fail.

{{% notice Note %}}
If the script detects failure, just re-run the script... to ensure the greatest "repeatable" outcome, "re-builds" with this script start from scratch... not from their last build point.
{{% /notice %}}

## Examining the built result

Once the Yocto build is complete, depending on which platform you built (Orin Super Nano, Orin NX, Thor), you should see something similar to this:

![Completed yocto build with bundled package created instance#center](images/completed-build.png "Completed yocto build with bundled result artifact file")

With the "--bundle" option having been supplied to the build script, the following file (again, depending onthe specific platform you compiled for...) is the primary file that will be used to flash our Nvidia device:

![Yocto build result file instance#center](images/created-image.png "Yocto build result file")

Please record the full path of the this file as the file will need to be downloaded in order to be flashed.

## What we learned

In this section, we configured and built out our yocto-based custom linux distribution for a selected Nvidia Jetson platform.

Next, lets flash the created image onto our Nvidia Jetson platform and run the image.
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
title: Flashing the Yocto image onto Nvidia Jetson
weight: 5

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Overview

In this section, we'll prepare a local linux host, running Ubuntu 22.04 or greater, download the completed yocto build artifact file, and use the Nvidia supplied instructions for flashing our Nvidia Jetson device with the newly created yocto image.

### Prepare a local ubuntu host

Ubuntu will be used locally to connect to and flash the Nvidia Jetson device. Ubuntu 22.04 or later is recommended. The following pre-requisites should also be installed:

```bash
sudo apt update
sudo apt upgrade
sudo apt install -y dtc build-essential gdisk gptfdisk udisks2 bmap-tools libxml2-utils
sudo apt-get install -y zstd tar usbutils
```

### Install the Google Cloud SDK

Please following the instructions here: https://docs.cloud.google.com/sdk/docs/install-sdk to install the google cloud SDK on your local Ubuntu host.

Once installed, you must first login in with the SDK CLI:

```bash
gcloud auth login
```

From your localh ubuntu host, you can confirm that SSH works by logging into your C4A cloud instance:

From your Google cloud console, please note down:

- your C4A instance name
- your Google Cloud project name
- the zone your C4A instance is currently executing in

Once these are acquired, you can log into your C4A instance via SSH in the google cloud SDK CLI:

```bash
gcloud compute ssh C4A_INSTANCE_NAME --project GOOGLE_CLOUD_PROJECT_NAME --ssh-flag="-o ServerAliveInterval=60 -o ServerAliveCountMax=9999" --zone=C4A_CURRENT_ZONE
```

### Download the completed Yocto build artifacts

Once confirmed that SSH works above, with the SSH session above, note the location of your bundled artifact file... it should be in $HOME/jetpack-yocto-builder within the C4A instance.

In the SSH shell to your C4A host:

```bash
cd $HOME/jetpack-yocto-builder
ls -al *.tar.gz
pwd
```

Back on your local Ubuntu host, type:

```bash
mkdir $HOME/flashing
cd $HOME/flashing
gcloud compute scp C4A_INSTANCE_NAME:~/jetpack-yocto-builder/demo*tar.gz ./yocto_image.tar.gz --project GOOGLE_CLOUD_PROJECT_NAME --zone=C4A_CURRENT_ZONE
```

You should now see a 3-4GB file on your local Ubuntu host:

```bash
cd $HOME/flashing
ls -al yocto_image.tar.gz
```

Next, extract the contents of this file to acquire the "zst" file (which will be used for flashing):

```bash
cd $HOME/flashing
tar xzpf yocto_image.tar.gz
mkdir $HOME/flashing/image
cd $HOME/flashing/image
tar xzpf ../*.zst
```

You should now have an "initrd_flash" executable in your current directory:

```bash
ls -al ./initrd_flash
```

You are now ready to flash. Please keep this shell (on your local Ubuntu host where ./initrd_flash is located) active as you'll use it in the next section.

### Peforming the flash to the Nvidia Jetson device.

At this point, the instructions for flashing a Nvidia Jetson device varies slightly by device.

Please follow the Nvidia instructions located here: https://oe4t.github.io/master/Flashing.html starting with **Step 2**. Your open shell on youir Ubuntu host (where ./initrd_flash is located) effectively completes your **Step 1** in the Nvidia instructions.

The Nvidia instructions will outline:

- Placing your specific Nvidia Jetson device into "recovery mode"
- Connecting the appropriate USB port from your Nvidia Jetson device to your local Ubuntu host
- Initiating the flashing process by executing "./initrd_flash" on your local Ubuntu host

After completing the above Nvidia flashing instructions on your Ubuntu host, your Nvidia Jetson device is now ready to run your custom Yocto image!

You will need to now connect your Nvidia Jetson device to a monitor and keyboard and optional wired ethernet connection and power it up.

## What we've learned and what's next

In this section we downloaded and flashed our custom Yocto image for our Nvidia Jetson device. Then we followed the specific Nvidia Jetson device instructions to place our device into "recovery mode" followed by fully flashing the device with our custom Yocto image.

In the next section, we'll look at what our Nvidia Jetson device looks and feels like running our custom Yocto image!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading