Your robot now boots NVIDIA's plain Jetson Linux and you reach it over a network cable. NVIDIA's kernel only knows part of this robot, though. The controller board and the Ethernet port work. The LiDAR has no serial port, the Wi-Fi card has no driver, and the Bluetooth radio starts without its firmware. You fix all three here, on the robot itself, with mainline Linux driver code and a driver NVIDIA already ships, and nothing from Hiwonder. Then you give your user access to the depth camera.
The second half of the chapter makes a full backup of the robot's disk, copies it to your PC and proves that it unpacks into a complete system. Writing a backup back onto the robot has never been tested, so a backup makes a risky step easier to undo, not safe.
The drivers took me about ten minutes of actual running time, plus reading. The backup took about eleven minutes more.
Here is what the robot carries and what each part needs. The USB port numbers are positions in the robot's USB tree: 1-2.2.4 means bus 1, root port 2, hub port 2, hub port 4. You'll see them again in the rules below.
| Part | ID | Where | Driver | Shows up as |
|---|---|---|---|---|
| Controller board (STM32) | USB 1a86:55d4 |
USB 1-2.1 | cdc_acm, already in the kernel |
/dev/ttyACM0 |
| COIN-D6 LiDAR (CH340 adapter) | USB 1a86:7523 |
USB 1-2.2.4 | ch341, missing |
/dev/ttyUSB0, /dev/lidar |
| Aurora 930 depth camera | USB 3251:1930 |
USB 1-2.2.1 | none, its vendor library opens the raw USB device | /dev/bus/usb/001/NNN |
| Wi-Fi, Realtek RTL8852CE | PCI 10ec:c852 |
0001:01:00.0 |
rtw89, missing |
wlP1p1s0 |
| Bluetooth, same Realtek chip | USB 0bda:0852 |
USB 1-3 | NVIDIA's rtk_btusb |
hci0 |
| Ethernet | Realtek | PCI | r8168, already there |
enP8p1s0 |
Look before you change anything. Log in with ssh rosorin over the cable and run:
lsusb
for d in /sys/bus/usb/devices/*; do [ -f $d/idVendor ] && [ "$(cat $d/idVendor)" = 1a86 ] && echo "$(basename $d) $(cat $d/idProduct) $(ls $d | grep -E ":1\.0$" | while read i; do readlink $d/$i/driver 2>/dev/null | xargs -r basename; done)"; done
modinfo -n ch341; zcat /proc/config.gz | grep -E "CONFIG_USB_SERIAL(_CH341)?="
The loop goes through every USB device made by QinHeng, the maker of both the controller board's USB chip and the LiDAR's adapter, and prints which driver each one has. On my robot it printed:
1-2.1 55d4 cdc_acm
1-2.2 8091 hub
1-2.2.4 7523
modinfo: ERROR: Module ch341 not found.
CONFIG_USB_SERIAL=m
The controller board (55d4) has its driver. The LiDAR's adapter (7523) has none, because NVIDIA built the kernel without ch341. lsusb should also list QinHeng Electronics CH340 serial converter, Aurora 930 and Realtek Semiconductor Corp. Bluetooth Radio.
Two of the drivers are kernel modules you compile yourself. A kernel module is a piece of kernel code in a .ko file that the kernel loads while it runs. It has to be built against the exact kernel that runs it. Each module carries a string called its vermagic, such as 5.15.148-tegra SMP preempt mod_unload modversions aarch64, and the kernel refuses a module whose vermagic doesn't match. You build on the robot itself, against the kernel headers NVIDIA installed with the system:
ls -la /lib/modules/$(uname -r)/build; dpkg-query -W -f='${Package} ${Version} ${db:Status-Abbrev}\n' nvidia-l4t-kernel-headers; gcc --version | head -1; make --version | head -1
On my robot the first line was a link ending in .../linux-jammy/kernel-source, and then:
nvidia-l4t-kernel-headers 5.15.148-tegra-36.4.3-20250107174145 ii
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
GNU Make 4.3
Don't run apt upgrade yet. Without NVIDIA's packages held first, it pulls in a newer NVIDIA release with a new kernel and a bootloader update. Every module you build in this chapter would stop loading. Chapter 6 holds those packages before it upgrades. Until then, install nothing with apt.
Every install script in this guide comes from the project repo you cloned on your laptop in chapter 3, at ~/CCode/rosorin-pro, and lives in ~/setup on the robot. The scripts have the user name burgerbarn written into their paths. If you picked another name in chapter 3, change it in the scripts before you copy them. From your laptop:
ssh rosorin 'mkdir -p ~/setup ~/build'
cd ~/CCode/rosorin-pro/scripts
scp -q build_ch341.sh install_ch341.sh rollback_ch341.sh build_rtw89.sh install_rtw89.sh rollback_rtw89.sh rosorin:setup/
scp -q setup/wifi_powersave_off.sh setup/robot_bt_rtk.sh rosorin:setup/
That puts eight files in ~/setup. curl isn't installed on the fresh system, so the scripts use wget and git, which are.
The STM32 board speaks the standard USB serial protocol called CDC ACM, and the kernel's cdc_acm driver already binds it. Check that your user can open it:
ls -l /dev/ttyACM0
readlink -f /sys/class/tty/ttyACM0/device/driver
id
You should see:
crw-rw---- 1 root dialout 166, 0 ... /dev/ttyACM0
/sys/bus/usb/drivers/cdc_acm
and id should list 20(dialout). The port belongs to group dialout, and chapter 3 put your user in that group, so nothing needs root. The factory software gave the board a name of its own, /dev/rrc. You don't need one. It's the only ACM device on the robot, and the base driver in chapter 6 opens /dev/ttyACM0 directly.
The LiDAR talks through a CH340 USB-serial chip. Linux has a driver for it, ch341, but NVIDIA left it out of the kernel, and the headers package doesn't contain its source. The source comes from NVIDIA's public kernel sources for exactly this release. build_ch341.sh downloads that 226 MB bundle once, checks its SHA-256 sum, checks the kernel tarball inside against NVIDIA's own checksum, pulls out the single file ch341.c, and compiles it with the kernel's own build system. Run it as your normal user, not root:
bash ~/setup/build_ch341.sh
It took 77 seconds for me, download included. It prints public_sources.tbz2: OK first. The compile ends with lines like these:
CC [M] /home/burgerbarn/build/ch341/ch341.o
MODPOST /home/burgerbarn/build/ch341/Module.symvers
CC [M] /home/burgerbarn/build/ch341/ch341.mod.o
LD [M] /home/burgerbarn/build/ch341/ch341.ko
The last two lines are the module's vermagic and its hash:
5.15.148-tegra SMP preempt mod_unload modversions aarch64
6ab8e01684741a24355b147c38d64ee311e4c1fad676b15f5834379c10f62b42 ch341.ko
The first word of the vermagic must equal what uname -r prints. Your hash will differ, because every build gives other bytes. That's fine.
The kernel numbers serial ports in the order devices appear. The LiDAR can be ttyUSB0 today and ttyUSB1 after a cable gets jiggled. A udev rule fixes that. When the kernel finds a device it tells udev, the service that creates the files under /dev, and a rule is one line that matches a device and acts on it. This one matches a serial port whose USB parent is port 1-2.2.4 and adds the link /dev/lidar:
SUBSYSTEM=="tty", KERNELS=="1-2.2.4:1.0", SYMLINK+="lidar"
install_ch341.sh refuses a module built for another kernel, refuses to overwrite an earlier install, copies the module into the kernel's updates/ folder, where it wins over any other copy, and rebuilds the module index with depmod. That index is how the kernel finds the right module by itself at boot. Then the script loads the module, writes the rule to /etc/udev/rules.d/60-rosorin-lidar.rules, makes udev apply it, and prints what it did. Run it, then reboot to prove the module loads on its own:
sudo bash ~/setup/install_ch341.sh
sudo systemctl reboot
The script should end with /dev/lidar -> ttyUSB0 and CH341_INSTALLED. If it stops with already installed, an earlier attempt left the module in place; sudo bash ~/setup/rollback_ch341.sh removes it and the rule, and prints CH341_ROLLED_BACK.
When the robot is back, log in again and check:
lsmod | grep -E "^(ch341|usbserial) "
modinfo -n ch341
ls -l /dev/lidar /dev/ttyUSB*
echo "failed units: $(systemctl --failed --no-legend | wc -l)"
stty -F /dev/lidar 230400 raw -echo && timeout 2 cat /dev/lidar | wc -c
On my robot:
ch341 20480 0
usbserial 40960 1 ch341
/lib/modules/5.15.148-tegra/updates/ch341/ch341.ko
lrwxrwxrwx 1 root root 7 ... /dev/lidar -> ttyUSB0
crw-rw---- 1 root dialout 188, 0 ... /dev/ttyUSB0
failed units: 0
27567
That last number is 27,567 bytes in two seconds. The LiDAR streams as soon as its port is open, at 230400 baud, so anything in the tens of thousands is right. If another CH340 device is plugged in, you'll also see a ttyUSB1.
The kernel log will say module verification failed ... tainting kernel. That's expected. NVIDIA didn't sign your module, so the kernel loads it and sets a flag saying outside code is running. If /dev/ttyUSB0 exists but /dev/lidar doesn't, the LiDAR isn't on USB port 1-2.2.4. The rule follows the port, not the device, so keep the LiDAR's cable where the kit put it. udevadm info -q property -n /dev/ttyUSB0 | grep ID_PATH shows where it is. On my robot that's ID_PATH=platform-3610000.usb-usb-0:2.2.4:1.0.
The RTL8852CE card needs the rtw89 driver, which only arrived in mainline Linux after 5.15. The source I use is github.com/a5a5aa555oo/rtw89, branch 6.6-lts. It's a backport of the mainline driver, and its README says it supports kernels 5.15 to 6.5. The better-known morrownr/rtw89 needs 6.6 or newer, so it won't build here.
The card's firmware is already on the system, and the kernel's Wi-Fi stack is built as modules, which is what the driver needs:
ls /lib/firmware/rtw89/; zcat /proc/config.gz | grep -E "^CONFIG_(MAC80211|CFG80211)="
You should see five files, rtw8851b_fw.bin, rtw8852a_fw.bin, rtw8852b_fw-1.bin, rtw8852b_fw.bin and rtw8852c_fw.bin, then CONFIG_CFG80211=m and CONFIG_MAC80211=m.
build_rtw89.sh clones the branch into ~/build/rtw89, checks out the commit you give it, prints that commit, and builds. The project's Makefile builds every chip the driver supports, ten modules, and the script prints the kernel each was built for and its hash. Pass the exact commit I run. Without it you get whatever the branch holds that day, which may not be the code that worked here:
bash ~/setup/build_rtw89.sh 2310939e2002117cd2b223c6d4f997e537142b78
It took 22 seconds. It prints the commit first, commit 2310939e2002117cd2b223c6d4f997e537142b78, followed by its date and the subject Revert "rtw89: 8852b: update fw to v0.29.128.0". Then come ten lines that each start with 5.15.148-tegra, and RTW89_BUILT.
install_rtw89.sh follows the same pattern as the ch341 installer. It checks every module's vermagic, copies them into updates/rtw89/, rebuilds the index, and loads rtw89_8852ce_git, the part for this card, which pulls in the others it depends on:
sudo bash ~/setup/install_rtw89.sh
It ends with RTW89_INSTALLED. The verify part above it should show these modules:
rtw89_8852ce_git 16384 0
rtw89_8852c_git 806912 1 rtw89_8852ce_git
rtw89_pci_git 61440 1 rtw89_8852ce_git
rtw89_core_git 348160 2 rtw89_8852c_git,rtw89_pci_git
mac80211 778240 2 rtw89_pci_git,rtw89_core_git
cfg80211 765952 3 rtw89_8852c_git,rtw89_core_git,mac80211
In the kernel lines below that, look for loaded firmware rtw89/rtw8852c_fw.bin, Firmware version 0.27.56.14 (1942d927), chip rfe_type is 1 and wlP1p1s0: renamed from wlan0. The script then lists the network cards. The wlP1p1s0 line carries the Wi-Fi card's MAC address, six pairs of hex digits. Write it down for your router.
Now prove the driver will load by itself at boot and that the radio hears networks. The first line asks the module index which module claims the card's PCI ID. The second scans and counts:
modinfo -F alias rtw89_8852ce_git | grep -i c852; modprobe -R "pci:v000010ECd0000C852sv*sd*bc*sc*i*"
sudo nmcli dev wifi rescan; sleep 5; nmcli -t -f SSID,CHAN,SIGNAL dev wifi list | wc -l; nmcli -t -f CHAN dev wifi list | sort -n | uniq | tr "\n" " "
On my robot:
pci:v000010ECd0000C852sv*sd*bc*sc*i*
rtw89_8852ce_git
34
1 2 6 11 52 60 100 116
That's 34 networks on both 2.4 GHz and 5 GHz channels. Your count depends on your neighbors.
nmcli -t -f SSID,SIGNAL dev wifi list shows the names the robot can see. Join yours by name. The --ask option makes it prompt for the password, so the password never lands on a command line or in your shell history. A prompt needs a terminal, so run this from your laptop with ssh -t, and put your network's name in place of your-wifi-name:
ssh -t rosorin 'sudo nmcli --ask dev wifi connect "your-wifi-name"'
Typed with the placeholder still in, it answers Error: No network with SSID 'your-wifi-name' found. NetworkManager saves the connection and joins it at every boot. Check it, again with your network's name:
nmcli -f DEVICE,STATE,CONNECTION dev | grep wl; ip -br -4 addr show wlP1p1s0; iw dev wlP1p1s0 link | grep -E "freq|signal|tx bitrate|rx bitrate"; nmcli -g connection.autoconnect con show "your-wifi-name"
On my robot:
wlP1p1s0 connected your-wifi-name
p2p-dev-wlP1p1s0 disconnected --
wlP1p1s0 UP ROBOT_WIFI_IP/24
freq: 5300
signal: -42 dBm
rx bitrate: 258.0 MBit/s HE-MCS 10 HE-NSS 2 HE-GI 0 HE-DCM 0
tx bitrate: 286.7 MBit/s HE-MCS 11 HE-NSS 2 HE-GI 0 HE-DCM 0
yes
The final yes means it reconnects at boot. Give the robot's Wi-Fi a fixed address in your router, a DHCP reservation by the Wi-Fi MAC you wrote down, so the address doesn't move. It's a different MAC from the Ethernet port's.
With power save on, this card's firmware hung on my robot while leaving power-save mode. The kernel logged SER catches error: 0x1000 and firmware failed to ack for leaving ps mode, and the link didn't come back until I rebooted. Before that, the same errors had shown up about twice an hour and the link had always recovered. Power save is on because Ubuntu ships a file, default-wifi-powersave-on.conf, that turns it on.
NetworkManager reads the files in /etc/NetworkManager/conf.d/ in name order, and a later file wins. So wifi_powersave_off.sh writes zz-wifi-powersave-off.conf, a name that sorts after Ubuntu's, with wifi.powersave = 2, which NetworkManager defines as off. It makes NetworkManager reread its config, turns power save off on the running card at once, and prints both. Digits sort before letters, so a file called 99-... would lose to default-....
bash ~/setup/wifi_powersave_off.sh
The last line should read:
config: wifi.powersave=2 | live: Power save: off
To undo it, run the same script with --undo.
Add a second alias for the Wi-Fi address to your laptop's ~/.ssh/config, next to your rosorin block. Mine looks like this. Put in your robot's Wi-Fi address, and for HostKeyAlias use the same value your rosorin block has:
Host rosorin-wifi
HostName ROBOT_WIFI_IP
User burgerbarn
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
HostKeyAlias ROBOT_WIRED_IP
HostKeyAlias makes SSH check the robot's key under one stored name, whichever address you connect to. Without it, the Wi-Fi address gets checked separately. If anything else ever used that address on your network, like the factory system, SSH stops with REMOTE HOST IDENTIFICATION HAS CHANGED!. Test both aliases from your laptop:
ssh -o ConnectTimeout=5 rosorin 'echo "rosorin -> $(hostname) via $(echo $SSH_CONNECTION | awk "{print \$3}")"'; ssh -o ConnectTimeout=5 rosorin-wifi 'echo "rosorin-wifi -> $(hostname) via $(echo $SSH_CONNECTION | awk "{print \$3}")"'
The third field of $SSH_CONNECTION is the robot address your session arrived at:
rosorin -> rosorin via ROBOT_WIRED_IP
rosorin-wifi -> rosorin via ROBOT_WIFI_IP
With both links up, the robot's default route is the cable. From here on the guide uses rosorin while the robot sits on its stand or charger with the cable in, and rosorin-wifi once it's on the floor without the cable. If a command with rosorin doesn't connect, check whether the cable is in, and use rosorin-wifi if it isn't.
The Bluetooth half of the Wi-Fi card is a USB device, 0bda:0852. The kernel gives it to the generic btusb driver, which on this kernel doesn't know the chip. Its log says unknown IC info, lmp subver 8852, it loads no firmware, and a discovery finds nothing. A Bluetooth chip has its own small processor, and its program, the firmware, is sent by the driver at start-up from a file under /lib/firmware. If the driver asks for nothing, the chip runs without it.
NVIDIA ships a second driver for Realtek Bluetooth, rtk_btusb. It asks for files named rtl8852cu_fw and rtl8852cu_config at the top of /lib/firmware. Ubuntu already has the right files, just under other names, rtl_bt/rtl8852cu_fw.bin and rtl_bt/rtl8852cu_config.bin. So robot_bt_rtk.sh makes two links to them, writes blacklist btusb into /etc/modprobe.d/rosorin-bt-rtk.conf so that btusb doesn't grab the chip at boot, loads rtk_btusb, and moves the device over from one driver to the other through their unbind and bind files in /sys. Then it prints which driver has the chip, what the driver logged about firmware, and the radio's state.
bash ~/setup/robot_bt_rtk.sh
On my robot:
1-3:1.0 -> rtk_btusb
1-3:1.1 -> rtk_btusb
rtk_btusb: number_of_total_patch = 2
rtk_btusb: patch_length 0xd5c9
rtk_btusb: Svn version: -1849729604
rtk_btusb: fw: exists, config file: exists
rtk_btusb: load_firmware done
rtk_btusb: read_ver_rsp->lmp_subver = 0xa40a
rtk_btusb: patch_entry->lmp_sub = 0x8852
rtk_btusb: Rtk patch end 0
hci0: Type: Primary Bus: USB
UP RUNNING
LMP Version: (0xc) Subversion: 0xa40a
Manufacturer: Realtek Semiconductor Corporation (93)
The chip's version changed from 0x8852, the bare chip, to 0xa40a, which means the firmware is running. Now let the radio listen for 12 seconds and count what it hears:
{ echo "scan on"; sleep 12; echo "scan off"; sleep 1; echo "devices"; sleep 1; echo quit; } | bluetoothctl 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | grep -E "^Device|NEW\] Device" | sed 's/.*Device //' | sort -u > /tmp/bt_scan.txt
echo "devices seen: $(wc -l < /tmp/bt_scan.txt)"
echo "wifi: $(cat /sys/class/net/wlP1p1s0/operstate) | rtw89 errors last 2 min: $(journalctl -k --since '-2 min' --no-pager -o cat | grep -c 'SER catches')"
Mine printed devices seen: 19 and rtw89 errors last 2 min: 0. I ran this before joining Wi-Fi, so mine said wifi: down. Yours should say up. With btusb, a discovery in the same house had found zero devices. If the script says no 0bda:0852 on USB, the radio isn't showing up at all; check lsusb for the Realtek Bluetooth Radio. To undo it, run the script with --undo.
The Aurora 930 isn't a normal webcam. It has no /dev/video device. Its closed vendor library talks to it directly over USB, and that needs read and write access to the camera's raw USB device file, which only root has by default. The vendor's own rule let anyone write to any device from that maker. This rule is narrower: only this product ID, only group video, which your user is in. The camera driver itself comes in chapter 7, which checks that this rule is in place. Apply it now:
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="3251", ATTRS{idProduct}=="1930", MODE="0660", GROUP="video"' \
| sudo tee /etc/udev/rules.d/60-rosorin-aurora930.rules >/dev/null
sudo udevadm control --reload && sudo udevadm trigger --subsystem-match=usb --attr-match=idVendor=3251
Then check the camera's device file. Its number changes whenever the camera reconnects, so the command looks it up from the camera's USB port, 1-2.2.1:
ls -l /dev/bus/usb/001/$(printf %03d $(cat /sys/bus/usb/devices/1-2.2.1/devnum))
You should see group video and mode crw-rw----. Mine was:
crw-rw---- 1 root video 189, 6 ... /dev/bus/usb/001/007
Every driver above has to come back on its own. Reboot:
sudo systemctl reboot
My robot was back on Wi-Fi about 45 seconds later. Then check each part:
ls -l /dev/lidar
stty -F /dev/lidar 230400 raw -echo && timeout 2 cat /dev/lidar | wc -c
modinfo -n ch341
modinfo -n rtw89_8852ce_git
iw dev wlP1p1s0 get power_save
readlink -f /sys/class/bluetooth/hci0/device/driver
hciconfig
ls -l /dev/ttyACM0
On mine, /dev/lidar -> ttyUSB0 and 27,513 bytes from the LiDAR. Both modules pointed into /lib/modules/5.15.148-tegra/updates/. Power save read Power save: off, Bluetooth was on /sys/bus/usb/drivers/rtk_btusb with UP RUNNING, and /dev/ttyACM0 was in group dialout. From your laptop, ssh rosorin-wifi hostname should print rosorin. Run the camera's ls line again too.
If the robot ever drops off Wi-Fi after a kernel update, or the LiDAR loses its port, check uname -r. Both modules are tied to the exact kernel build. The fix is to roll them back with the two rollback_ scripts, then build and install them again. Chapter 6 holds NVIDIA's packages, the kernel among them, so I have never had to do this.
A backup set is one dated folder that holds everything needed to put the robot's disk back. The script that makes it runs on the robot, and the folder is named by the UTC time, such as 20261012T1641Z. It holds three kinds of copies.
The robot's NVMe has 16 partitions. Partitions 2 to 15 are small, from 512 KB to 480 MB: the kernel, the device tree, recovery, the EFI system partition and reserved space. They're copied raw, byte for byte, and compressed. The partition with your running system, the one named APP, is copied file by file with tar, keeping owners, permissions, extended attributes and ACLs, so it can be unpacked onto any fresh ext4 filesystem. If you followed chapter 4, that is partition 16. When I made the set shown below, my system was on partition 1 and an older system on partition 16; the script handles both. And the partition table itself is saved with sgdisk --backup, which keeps each partition's name and unique GUID. The boot line finds the system by that GUID, so it has to come back the same.
Two things are not in a set. One is the bootloader in the Jetson module's own flash chip, which isn't on the NVMe at all. The other is any second system partition that isn't the running one, such as the factory install that chapter 4 left on partition 1 as APP_old.
A set holds your robot's private SSH host keys and your saved Wi-Fi password, because it holds every file. Keep sets on the robot and on your PC, and nowhere public.
The script lives in ~/golden on the robot, next to the sets it makes. From your laptop:
ssh rosorin 'mkdir -p ~/golden'
scp -q ~/CCode/rosorin-pro/scripts/make_golden.sh rosorin:golden/make_golden.sh
Here's what the 47 lines do. First the script refuses to run anywhere it shouldn't. It needs root, the running system must be on partition 1 or 16, that partition must be the one named APP, and the user burgerbarn must exist. The factory install only has a user called ubuntu, so the script can't back up the wrong system by accident. It checks all of this before it creates the output folder. Then it saves the partition table, and two readable copies of it, gpt.txt and lsblk.txt. It copies partitions 2 to 15 through zstd. Partition 10, the EFI system partition, is mounted at /boot/efi, so the script unmounts it for a consistent copy and remounts it however the script ends.
For the system partition it first copies three config files for reference, notes the filesystem's settings, and counts every file and link on / into rootfs_filecount.txt. The restore test later compares against that count. Then it writes the archive, rootfs.tar.zst. The robot keeps running while the script reads its disk, and a file that changes during the read makes tar exit with 1, a warning. The script accepts that and only fails on a real error. Last, it writes a SHA-256 line for every file into SHA256SUMS, hands the folder to your user, and prints GOLDEN_DONE.
Run it in the background, so a dropped SSH session doesn't kill it, and watch the log. sudo -n never asks for a password, so this needs the passwordless sudo from chapter 4:
nohup sudo -n bash ~/golden/make_golden.sh > /tmp/golden.log 2>&1 &
tail -f /tmp/golden.log
The log starts with == GPT and The operation has completed successfully. from sgdisk. My run took about four minutes. Near the end the log showed:
tar rc=1 zstd rc=0
tar: ./var/lib/BrlAPI/0: socket ignored
== checksums
2.4G /home/burgerbarn/golden/20261012T1641Z
then a listing of the folder, and last GOLDEN_DONE /home/burgerbarn/golden/20261012T1641Z. tar rc=1 is the accepted warning, and the line after it says why. Press Ctrl-C to stop watching. Sets grow with what the robot holds, so later ones take longer. Check that /boot/efi is mounted again afterwards. Mine was, as /dev/nvme0n1p10. If it isn't, run sudo mount /boot/efi.
Then check the set on the robot. This is my set's name; use the one your run printed:
cd ~/golden/20261012T1641Z && sha256sum -c --quiet SHA256SUMS && echo robot SHA256 OK; du -sh .
ls ~/golden/20261012T1641Z
It should print robot SHA256 OK and the size. The folder holds 25 files: p2.img.zst to p15.img.zst, rootfs.tar.zst, gpt.sgdisk, gpt.txt, lsblk.txt, extlinux.conf, nv_boot_control.conf, fstab, rootfs_filecount.txt, rootfs_tune2fs.txt, tar_warnings.txt, and SHA256SUMS, which lists the other 24. Make sure rootfs_filecount.txt is there. The restore test needs it.
A backup that only lives on the robot's disk dies with that disk. Run this on your laptop. It streams the set from the robot to your PC over two SSH connections, and on the PC it checks every file against SHA256SUMS before it says OK:
ssh yourpc 'mkdir -p /home/burgerbarn/rosorin-golden'
SET=20261012T1641Z
ssh rosorin "tar -C /home/burgerbarn/golden -cf - $SET" | ssh yourpc "tar -C /home/burgerbarn/rosorin-golden -xf - && cd /home/burgerbarn/rosorin-golden/$SET && sha256sum -c --quiet SHA256SUMS && echo SHA256 OK \$(wc -l < SHA256SUMS) files && df -h /home | tail -1"
Set SET to your set's name. The paths are written out in full because a ~ typed on your laptop would turn into your laptop's home folder before SSH sends it. My PC user is also burgerbarn; if yours isn't, change /home/burgerbarn in the parts that run on yourpc. If the robot's cable is unplugged, use rosorin-wifi in place of rosorin.
It took me about three minutes and printed:
SHA256 OK 24 files
followed by the free space on your PC. sha256sum -c --quiet prints nothing for a good file and a FAILED line for a bad one, and the echo only runs if all 24 match. If the copy stops partway, check that your PC hasn't gone to sleep.
A checksum proves the copy matches the robot's files. It doesn't prove the set can rebuild a disk. The restore test does, without touching any disk. It runs inside the jetson-flash:r36.4.3 container from chapter 3, which has the same sgdisk, zstd, fsck.vfat and mke2fs versions as the robot.
restore_test.sh runs every check even after one fails, and remembers any failure. It test-decompresses every archive. It makes an empty file exactly the size of the robot's NVMe, loads the saved partition table onto it and compares the result with the robot's own table. It unpacks the EFI system partition and checks its filesystem read-only. It unpacks the whole system the way a real restore would and compares the file count with the robot's. It checks that the files the robot can't boot or be reached without are there. It prints the owner and mode of your SSH key and of sudo, which you read yourself, and the number of lines in nv_boot_control.conf. Then it deletes what it unpacked and prints RESULT fail=0 or RESULT fail=1.
The disk size is written into the script as 1,000,215,216 sectors of 512 bytes, the size of my robot's 512 GB NVMe. The nvme0n1 line of lsblk.txt in your set has your disk's size in bytes. If it isn't 512,110,190,592, change the number in the script, and in the GUID check further down. I have only run both with my disk's size.
Copy the script to your PC once, then run it for each set from your laptop:
ssh yourpc 'cat > /home/burgerbarn/rosorin-golden/restore_test.sh' < ~/CCode/rosorin-pro/scripts/restore_test.sh
SET=20261012T1641Z
ssh yourpc "docker run --rm -v /home/burgerbarn/rosorin-golden:/g:z jetson-flash:r36.4.3 bash /g/restore_test.sh $SET 2>&1"
The folder of sets appears inside the container as /g. The script unpacks into /g/restore-test, so your PC needs free space for one fully unpacked system. My set printed:
== zstd integrity
zst files tested: 15
== GPT restore onto sparse disk-size file
GPT partition table identical
== ESP image fsck
fsck.fat 4.2 (2021-01-31)
/tmp/esp.img: 5 files, 221/129022 clusters
== rootfs extract + count
restored files+links: 188039 robot count: 188039 diff: 0
present boot/Image
present boot/initrd
present boot/extlinux/extlinux.conf
present etc/nv_boot_control.conf
present etc/hostname
present home/burgerbarn/.ssh/authorized_keys
present etc/ssh/sshd_config.d/10-local.conf
1000:1000 600 /g/restore-test/home/burgerbarn/.ssh/authorized_keys
0:0 4755 /g/restore-test/usr/bin/sudo
6
RESULT fail=0
Your key should read 1000:1000 600 and sudo should keep its setuid bit, 4755. The 6 is the line count of nv_boot_control.conf. RESULT fail=0 is the line that matters. A small diff in the file count doesn't fail the test, because the count is taken a moment before the archive while the system runs. Mine was 0.
Mine also printed seven warnings like tar: ./var/log/journal/.../user-1000.journal: Warning: Cannot acl_from_text: Invalid argument. Those journal files carry an access list that names your user, and the container has no user by that name, so they come back without it in the test. The test doesn't fail on that.
One more check shows why the saved table matters. Loaded onto a blank file, it gives back each partition's unique GUID, the thing the boot line depends on:
ssh yourpc 'docker run --rm -v /home/burgerbarn/rosorin-golden:/g:z jetson-flash:r36.4.3 bash -c "truncate -s \$((1000215216*512)) /tmp/d.img && sgdisk --load-backup=/g/20261012T1641Z/gpt.sgdisk /tmp/d.img >/dev/null && for n in 1 10 16; do sgdisk -i \$n /tmp/d.img | grep -E \"unique GUID|Partition name\" | tr -s \" \" | tr \"\n\" \" \"; echo; done; rm /tmp/d.img"'
On my robot it printed:
Partition unique GUID: 59FCA1C4-9E3E-406D-8532-CAD56C869912 Partition name: 'APP'
Partition unique GUID: 2929D5B9-C45C-40D3-8FB9-4E7464327232 Partition name: 'esp'
Partition unique GUID: EF01D088-5975-4263-B620-2D0F5137DFE1 Partition name: 'APP_new'
On my robot partition 1 was the running system and partition 16 the system I had before it, which the set doesn't copy. If you followed chapter 4, yours shows APP on partition 16 and APP_old on partition 1. Your GUIDs will be your own. What matters is that the GUID of the partition named APP matches the root=PARTUUID= in your /boot/extlinux/extlinux.conf, in lower case.
Make a new set at every milestone, and before any step you might want to undo, and run the restore test on any set you plan to rely on.
No set has ever been written back onto the robot. Everything above proves the pieces of a restore inside a container on the PC: the partition table comes back with its GUIDs, the system unpacks with its owners and modes and the right file count, and the EFI partition passes a read-only filesystem check. Booting the robot from a restored disk has not been done.
There are three written ways back, and none of them has been run, so they aren't steps in this guide. The first swaps the partition names so the robot boots the other system on the drive, the reverse of the swap in chapter 4. The second boots that other system and refills the system partition from a set over the network. The third takes the drive out, puts it in a USB enclosure on your PC and writes the whole set onto it. Until one has been run end to end and the robot booted from it, treat a set as a very good copy of your files, not as a proven way back.
The test also leaves one question open. The journal files that print the acl_from_text warning come back without their extra access entries inside the container. Whether a real restore, onto a system that has your user, keeps those entries hasn't been tested.
Whether turning Wi-Fi power save off stops the firmware hangs isn't proven either. The setting takes, and survives a reboot, but the hangs came about twice an hour, and an afternoon without one is too short to call it fixed. If the robot drops off Wi-Fi and the kernel log shows SER catches error: 0x1000, check iw dev wlP1p1s0 get power_save first.
You're ready for the next chapter when, after a reboot, /dev/lidar points to ttyUSB0 and streams tens of thousands of bytes in two seconds, ch341 and rtw89_8852ce_git both load from updates/, ssh rosorin-wifi hostname prints rosorin and power save reads off, Bluetooth is on rtk_btusb and UP RUNNING, /dev/ttyACM0 is in group dialout and the camera's device file in group video, and you have a set in ~/golden that passed its checksums on the robot, printed SHA256 OK 24 files on your PC, and ended its restore test with RESULT fail=0.