diff --git a/meta-balena-common/recipes-core/initrdscripts/files/migrate b/meta-balena-common/recipes-core/initrdscripts/files/migrate old mode 100644 new mode 100755 index fab61c86b1..4f20f85cfa --- a/meta-balena-common/recipes-core/initrdscripts/files/migrate +++ b/meta-balena-common/recipes-core/initrdscripts/files/migrate @@ -96,7 +96,9 @@ migrate_enabled() { migrate_run() { # Find the raw image in the rootfs partition image=$(find "${ROOTFS_DIR}" -xdev -type f -name "${BALENA_IMAGE}") - kernel_images=$(find "${ROOTFS_DIR}" -xdev -type f -name "@@KERNEL_IMAGETYPE@@*") + kernel_images=$(find "${ROOTFS_DIR}" -xdev -type f -name "Image*") + jetson_orin_capsule=$(find "${ROOTFS_DIR}" -xdev -type f -name "TEGRA_BL_*Cap*") + jetson_orin_boot_artifact=$(find "${ROOTFS_DIR}" -xdev -type f -name "boot0.img.gz") if [ -n "${image}" ]; then EXTERNAL_DEVICE_BOOT_PART_MOUNTPOINT="${BALENA_BOOT_MOUNTPOINT}" if findmnt "${FLASH_BOOT_MOUNT}" > /dev/null; then @@ -120,6 +122,21 @@ migrate_run() { # shellcheck disable=SC2086 cp -a ${kernel_images} "/tmp" + # If this is a Jetson Orin device, the flasher image contains + # a compressed boot blob as well as a UEFI capsule. + # If the QSPI is accessible, it will be written directly, + # otherwise a capsule update will be triggered on the next boot + # after provisioning + if [ -f "${jetson_orin_capsule}" ]; then + cp "${jetson_orin_capsule}" "/tmp/" + info "Copied ${jetson_orin_capsule}" + fi + + if [ -f "${jetson_orin_boot_artifact}" ]; then + cp "${jetson_orin_boot_artifact}" "/tmp/" + info "Copied ${jetson_orin_boot_artifact}" + fi + # Need to source this again to set CONFIG_PATH correctly unset CONFIG_PATH # shellcheck disable=SC1091