I’m trying to update a Jetson Xavier AGX devkit using the image-based over the air update mechanism as described in the online Linux for Tegra documentation.
The AGX is flashed with L4T 32.6.1, and I wish to update it to the latest release L4T 35.3.1.
I have successfully generated the ota payload by following the steps in the documentation, however when running the nv_ota_start script on the Jetson, I am met with this error:
Command: ./nv_ota_start.sh /ota/ota_payload_package.tar.gz cd ../ r
Current rootfs is on /dev/nvme0n1
init_ota_log /ota_log/ota/Linux_for_Tegra/tools/ota_tools$ cd version_upgrade/tools/ota_tools/
Create log file at /ota_log/ota_20230704-131753.log_tools/version_upgrade$ cd ver
OTA_LOG_FILE=/ota_log/ota_20230704-131753.log
Extract /ota/ota_payload_package.tar.gz
update_nv_boot_control_in_rootfs /ota_work
2888-400-0001-E.0-1-2-jetson-agx-xavier-devkit-
check_prerequisites
decompress_ota_package ota_package.tar /ota_work
decompress_ota_package: start at Tue Jul 4 13:18:27 UTC 2023
Sha1 checksum for /ota_work/ota_package.tar (b2c5266465f2e2f7a8e537d210e6dcf8076590cf) matches
decompress_ota_package: end at Tue Jul 4 13:18:47 UTC 2023
nv_ota_update_with_layout_change.sh /dev/nvme0n1
Command: nv_ota_update_with_layout_change.sh /dev/nvme0n1
duplicate_bct_copy
cat: /sys/class/mtd/mtd0/erasesize: No such file or directory
mtd_debug: error!: open()
Failed to read bct from /dev/mtd0
Failed to run "dupclicate_bct_copy"
It seems the ota scripts are trying to read some information from /dev/mtd0, which is not present on my L4T 32.6.1 Jetson AGX Xavier, with no modifications to the rootfs.
I don’t believe it has to do with the OTA payload generation, as the issue is with a script that is part of the OTA tools. I traced the error back to these lines within nv_ota_update_with_layout_change.sh
# Create the redundant copy of BCT in case it is not in place
if [ "${OTA_DEVICE}" != "${SDMMC_USER_DEVICE}" ]; then
ota_log "duplicate_bct_copy"
if ! duplicate_bct_copy; then
ota_log "Failed to run \"dupclicate_bct_copy\""
exit 1
fi
fi
Which then calls this function from nv_ota_common.func
duplicate_bct_copy()
{
# Duplicate the BCT image from the first erasable block
# to the second erasable block.
# Usage:
# duplicate_bct_copy
local erase_size=
local mtd_dev="${_MTD_DEVICE}"
local bct_tmp="/tmp/bct.bin.tmp"
erase_size="$(cat /sys/class/mtd/mtd0/erasesize)"
if ! mtd_debug read "${mtd_dev}" 0 "${erase_size}" "${bct_tmp}"; then
ota_log "Failed to read bct from ${mtd_dev}"
return 1
fi
.
.
.
and
_MTD_DEVICE="/dev/mtd0"
Seems this function will always be called if the current rootfs is not on the internal eMMC, as is in my scenario.
I just checked the document and script, and found this:
<external_device> specifies the external device to be upgraded, and nvme0n1 is the supported device. This option is only valid when <target_board> is set to jetson-xavier-nx-devkit-emmc.
So looks like you won’t be able to do OTA with an NVMe drive on AGX Xavier.
For anyone encountering this, I got around this issue by adding a script to rsync the contents of the APP partition on the eMMC to the NVMe drive, after the OTA process has been completed, and modify extlinux.conf to set nvme0n1p1 as my root device.
This involved the addition of the script, adding the script to the OTA_TASKS variable in nv_ota_customer.conf, and adding in rsync and its required libraries in nv_ota_customer.conf
I am able to do this as in my scenario, the nvme contains only my rootfs.