Hi,
I’m trying to create a custom JetPack image, in which my software is pre-installed in root file system.
I would like to continuously create new image every-time my software gets updated using CircleCI (so I cannot plug Jetson Nano HW while creating the custom image).
I tried two ways:
1. Copy partitions (failing to boot)
- Create an empty image:
dd if=/dev/zero bs=1M count=$(expr 14 \* 1024) > root.img
-
Download https://developer.download.nvidia.com/assets/embedded/downloads/jetson-nano-sd-card-image/jetpack-4.4-ga/jetson-nano-developer-kit-sd-card-image.zip and unzip it.
-
Create 14 partitions original JetPack (sd-blob-b01.img) has.
# APP
parted -s root.img unit s mkpart primary – $(gdisk -l sd-blob-b01.img |grep APP |awk ‘{print $2}’) -34
parted -s root.img unit s name 1 APP# TBC
parted -s root.img unit s mkpart primary – $(gdisk -l sd-blob-b01.img |grep TBC |awk ‘{print $2 " " $3}’)
parted -s root.img unit s name 2 TBC…
-
Byte-to-byte copy 13 non-root partitions.
# TBC
offset=$(gdisk -l sd-blob-b01.img |grep TBC |awk ‘{print $2}’) ; size=$(gdisk -l sd-blob-b01.img |grep TBC |awk ‘{print $3 - $2}’) ; dd conv=notrunc bs=512 skip=$offset count=$size seek=$offset if=sd-blob-b01.img of=root.img# RP1
offset=$(gdisk -l sd-blob-b01.img |grep RP1 |awk ‘{print $2}’) ; size=$(gdisk -l sd-blob-b01.img |grep RP1 |awk ‘{print $3 - $2}’) ; dd conv=notrunc bs=512 skip=$offset count=$size seek=$offset if=sd-blob-b01.img of=root.img…
-
Loopback mount root filesystem (APP) and format it as ext4.
LOOPBACK=$(losetup -f -P --show root.img)
mkfs.ext4 -j APP ${LOOPBACK}p1
mkdir -p /mnt/my-jetpack
mount ${LOOPBACK}p1 -o rw /mnt/my-jetpack/ -
Mount root filesystem of original image (sd-blob-b01.img) and copy all contents into root.img.
LOOPBACK2=$(losetup -f -P --show sd-blob-b01.img)
mkdir -p /mnt/orig-jetpack
mount ${LOOPBACK2}p1 -o rw /mnt/orig-jetpack/
cp -Rp /mnt/orig-jetpack/* /mnt/jetpack/ -
Write root.img into SD card using Etcher.
This card does not boot Ubuntu GUI unfortunatelly.
2. Using L4T Driver Package and Sample Root Filesystem. (Succeeding in boot)
Plug my Jetson Nano Developer Kit (recovery mode) via USB.
Use https://developer.nvidia.com/embedded/L4T/r32_Release_v4.3/t210ref_release_aarch64/Tegra210_Linux_R32.4.3_aarch64.tbz2 and copy my software in rootfs, then ./flash.sh.
Resulting SD card successfully boots.
However, I cannot apply this way because I would like to use standard CircleCI.
Any help?