Categorieën bekijken

nVidia Jetson NANO – Image OS

Official image with UI #

You can download Jetson IMG files wich you can burn on a SD card here: https://developer.nvidia.com/embedded/downloads/

Search for “Jetson Nano Developer Kit SD Card Image“:


https://developer.nvidia.com/embedded/l4t/r32_release_v7.1/jp_4.6.1_b110_sd_card/jeston_nano/jetson-nano-jp461-sd-card-image.zip

or always the latest version:
https://developer.nvidia.com/jetson-nano-sd-card-image


Create your own build #

This build instruction takes place on a windows machine using WSL!

WSL dependancies #

To build the Jetson image you need some dependancies:

start with:

sudo apt-get update

Then:

sudo apt-get install lbzip2 qemu-user-static binfmt-support libxml2-utils gdisk

Create folder:

mkdir -p ~/jetson
cd ~/jetson


Download build files #

To create your own build you need two files from the nvidia website, the Jetson NANO is an older device, so look in the archives here:

https://developer.nvidia.com/embedded/jetson-linux-archive

Then download:

Commands:

wget https://developer.nvidia.com/downloads/embedded/l4t/r32_release_v7.6/t210/jetson-210_linux_r32.7.6
wget https://developer.nvidia.com/downloads/embedded/l4t/r32_release_v7.6/t210/tegra_linux_sample-root-filesystem_r32.7.6_aarch64.tbz2

Unpack and apply binairies #

Unpack Driver Package (BSP)

tar xf jetson-210_linux_r32.7.6_aarch64.tbz2

Unpack ROOT filesystem (rootfs)

cd Linux_for_Tegra/rootfs
sudo tar xpf ../../tegra_linux_sample-root-filesystem_r32.7.6_aarch64.tbz2

Apply binairies

cd ..
sudo ./apply_binaries.sh

Output:

Using rootfs directory of: /home/phoenix/jetson/Linux_for_Tegra/rootfs
Installing extlinux.conf into /boot/extlinux in target rootfs
/home/phoenix/jetson/Linux_for_Tegra/nv_tegra/nv-apply-debs.sh
Root file system directory is /home/phoenix/jetson/Linux_for_Tegra/rootfs
Copying public debian packages to rootfs
Start L4T BSP package installation
QEMU binary is not available, looking for QEMU from host system
Found /usr/bin/qemu-aarch64-static
Installing QEMU binary in rootfs
/home/phoenix/jetson/Linux_for_Tegra/rootfs /home/phoenix/jetson/Linux_for_Tegra
Installing BSP Debian packages in /home/phoenix/jetson/Linux_for_Tegra/rootfs
Selecting previously unselected package nvidia-l4t-core.
(Reading database ... 142631 files and directories currently installed.)
Preparing to unpack .../nvidia-l4t-core_32.7.6-20241104234540_arm64.deb ...
Pre-installing... skip compatibility checking.
Unpacking nvidia-l4t-core (32.7.6-20241104234540) ...
Setting up nvidia-l4t-core (32.7.6-20241104234540) ...
Selecting previously unselected package jetson-gpio-common.
(Reading database ... 142677 files and directories currently installed.)
Preparing to unpack .../jetson-gpio-common_2.0.17_arm64.deb ...
Unpacking jetson-gpio-common (2.0.17) ...
...
...
...
Setting up nvidia-l4t-camera (32.7.6-20241104234540) ...
Setting up nvidia-l4t-gstreamer (32.7.6-20241104234540) ...
Processing triggers for nvidia-l4t-kernel (4.9.337-tegra-32.7.6-20241104234540) ...
Processing triggers for libc-bin (2.27-3ubuntu1.6) ...
/home/phoenix/jetson/Linux_for_Tegra
Removing QEMU binary from rootfs
Removing stashed Debian packages from rootfs
L4T BSP package installation completed!
Rename ubuntu.desktop --> ux-ubuntu.desktop
Disabling NetworkManager-wait-online.service
Disable the ondemand service by changing the runlevels to 'K'
Success!

Add SSH functionality (NOT Working) #

To add SSH functionality you have tin install it first (chroot)

Got to the folder:

cd ~/jetson/Linux_for_Tegra

mount folder/points

sudo mount --bind /dev  rootfs/dev
sudo mount --bind /proc rootfs/proc
sudo mount --bind /sys  rootfs/sys

chroot to root file system

sudo chroot rootfs /bin/bash

Generate SSH keys for the system:

ssh-keygen -A

Output:

ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519

Check it with ls -l /etc/ssh/ssh_host_*:

-rw------- 1 root root  668 Nov  4 22:46 /etc/ssh/ssh_host_dsa_key
-rw-r--r-- 1 root root  602 Nov  4 22:46 /etc/ssh/ssh_host_dsa_key.pub
-rw------- 1 root root  227 Nov  4 22:46 /etc/ssh/ssh_host_ecdsa_key
-rw-r--r-- 1 root root  174 Nov  4 22:46 /etc/ssh/ssh_host_ecdsa_key.pub
-rw------- 1 root root  399 Nov  4 22:46 /etc/ssh/ssh_host_ed25519_key
-rw-r--r-- 1 root root   94 Nov  4 22:46 /etc/ssh/ssh_host_ed25519_key.pub
-rw------- 1 root root 1675 Nov  4 22:46 /etc/ssh/ssh_host_rsa_key
-rw-r--r-- 1 root root  394 Nov  4 22:46 /etc/ssh/ssh_host_rsa_key.pub

Now enable passwordauthentication:

echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config

Add a user (e.g. nvidia):

adduser nvidia

Output:

dding user `nvidia' ...
Adding new group `nvidia' (1000) ...
Adding new user `nvidia' (1000) with group `nvidia' ...
Creating home directory `/home/nvidia' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for nvidia
Enter the new value, or press ENTER for the default
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n]

Add use to SUDO group:

adduser nvidia sudo

Output:

Adding user `nvidia' to group `sudo' ...
Adding user nvidia to group sudo
Done.

To let SSH deamon start on startup:

mkdir -p /etc/systemd/system/multi-user.target.wants
ln -sf /lib/systemd/system/ssh.service /etc/systemd/system/multi-user.target.wants/ssh.service

Exit chroot:

exit

Unmount folders/points:

sudo umount rootfs/dev
sudo umount rootfs/proc
sudo umount rootfs/sys


Build image #

nvidia has a integrated tool to build the image:

********************************************
     Jetson Disk Image Creation Tool
********************************************
ERROR: Invalid board name
Usage:
jetson-disk-image-creator.sh -o <sd_blob_name> -b <board> -r <revision>
        sd_blob_name    - valid file name
        board           - board name. Supported boards are:
                           jetson-nano
                           jetson-nano-2gb-devkit
                           jetson-xavier-nx-devkit
        revision        - SKU revision number
                           jetson-nano: 100/200/300 for A01/A02/B00
                           jetson-nano-2gb-devkit: default
                           jetson-xavier-nx-devkit: default
Example:
jetson-disk-image-creator.sh -o sd-blob.img -b jetson-nano -r 300
jetson-disk-image-creator.sh -o sd-blob.img -b jetson-xavier-nx-devkit

So take a look at the revision you have an choose the proper -r setting:

RevisionBoard IDTypeDescription
-r 100A01Very first devkit (2019, rare)Prototype / early release with different pinouts
-r 200A02First public releaseUsed on the original Jetson Nano Devkit (2019)
-r 300B01Later revision (from 2020)Most common retail version, with dual camera connectors and improved power design
(no -r)Jetson Nano 2GB DevkitRed PCB, 2 GB RAM, different layout — its own target name

In my case a NANO 4GB A02 version:

sudo ./tools/jetson-disk-image-creator.sh -o jetson.img -b jetson-nano -r 200

Output:

********************************************
     Jetson Disk Image Creation Tool
********************************************
jetson-disk-image-creator.sh - creating signed images
/home/phoenix/jetson/Linux_for_Tegra /home/phoenix/jetson/Linux_for_Tegra
###############################################################################
# L4T BSP Information:
# R32 , REVISION: 7.6
###############################################################################
Board ID(3448) version(200)
copying bctfile(/home/phoenix/jetson/Linux_for_Tegra/bootloader/t210ref/BCT/P3448_A00_lpddr4_204Mhz_P987.cfg)... done.
copying bootloader(/home/phoenix/jetson/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
copying initrd(/home/phoenix/jetson/Linux_for_Tegra/bootloader/l4t_initrd.img)... done.
Making Boot image... done.
Existing sosfile(/home/phoenix/jetson/Linux_for_Tegra/bootloader/nvtboot_recovery.bin) reused.
copying tegraboot(/home/phoenix/jetson/Linux_for_Tegra/bootloader/t210ref/nvtboot.bin)... done.
copying cpu_bootloader(/home/phoenix/jetson/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
copying bpffile(/home/phoenix/jetson/Linux_for_Tegra/bootloader/t210ref/sc7entry-firmware.bin)... done.
copying wb0boot(/home/phoenix/jetson/Linux_for_Tegra/bootloader/t210ref/warmboot.bin)... done.
Existing tosfile(/home/phoenix/jetson/Linux_for_Tegra/bootloader/tos-mon-only.img) reused.
Existing eksfile(/home/phoenix/jetson/Linux_for_Tegra/bootloader/eks.img) reused.
copying dtbfile(/home/phoenix/jetson/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a02.dtb)... done.
Copying nv_boot_control.conf to rootfs
        populating kernel to rootfs... done.
        populating initrd to rootfs... done.
        populating kernel_tegra210-p3448-0000-p3449-0000-a02.dtb to rootfs... done.
Making system.img...
        populating rootfs from /home/phoenix/jetson/Linux_for_Tegra/rootfs ...  populating /boot/extlinux/extlinux.conf ... done.
        Sync'ing system.img ... done.
        Converting RAW image to Sparse image... done.
system.img built successfully.
Existing tbcfile(/home/phoenix/jetson/Linux_for_Tegra/bootloader/nvtboot_cpu.bin) reused.
copying tbcdtbfile(/home/phoenix/jetson/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a02.dtb)... done.
copying cfgfile(/home/phoenix/jetson/Linux_for_Tegra/bootloader/t210ref/cfg/flash_l4t_t210_spi_sd_p3448.xml) to flash.xml... done.
copying flasher(/home/phoenix/jetson/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
Existing flashapp(/home/phoenix/jetson/Linux_for_Tegra/bootloader/tegraflash.py) reused.
./tegraflash.py --bl cboot.bin --bct  P3448_A00_lpddr4_204Mhz_P987.cfg --odmdata 0xa4000 --bldtb kernel_tegra210-p3448-0000-p3449-0000-a02.dtb --applet nvtboot_recovery.bin --cmd "sign"  --cfg flash.xml --chip 0x21    --bins "EBT cboot.bin; DTB tegra210-p3448-0000-p3449-0000-a02.dtb"
saving flash command in /home/phoenix/jetson/Linux_for_Tegra/bootloader/flashcmd.txt
saving Windows flash command to /home/phoenix/jetson/Linux_for_Tegra/bootloader/flash_win.bat
assign_value: crc-flash.xml.bin 1 65520 1
printf '\x1' | dd of=crc-flash.xml.bin bs=1 seek=65520 count=1 conv=notrunc
1+0 records in
1+0 records out
1 byte copied, 8.7785e-05 s, 11.4 kB/s
assign_value: crc-flash.xml.bin 0 65521 1
printf '\x0' | dd of=crc-flash.xml.bin bs=1 seek=65521 count=1 conv=notrunc
1+0 records in
1+0 records out
...
...
jetson-disk-image-creator.sh - writing /home/phoenix/jetson/Linux_for_Tegra/bootloader/system.img.raw
10827776+0 records in
10827776+0 records out
5543821312 bytes (5.5 GB, 5.2 GiB) copied, 112.567 s, 49.2 MB/s
********************************************
   Jetson Disk Image Creation Complete
********************************************

check output:

ls -l ~/jetson/Linux_for_Tegra/bootloader/system.img

output:

-rwxr-xr-x 1 root root 5162140336 Nov  4 23:35 /home/user/jetson/Linux_for_Tegra/bootloader/system.img

Copy the output to your Windows download folder (fill in your username where [USER] :

sudo cp ~/jetson/Linux_for_Tegra/bootloader/system.img /mnt/c/Users/[USER]/Downloads/jetson.img