Orin AGX: how to mark partition bootable

In testing OTA updates, I purposefully corrupted the A_kernel partition (having disabled extlinux) when the Orin is booting from slot_A.
As expected, the L4T tried 3 times to boot from A_kernel and then switched to slot B.
Having booted from slot B, I now get this output as expected:

nvbootctrl -t rootfs dump-slots-info
Current rootfs slot: B
Active rootfs slot: B
num_slots: 2
slot: 0, retry_count: 0, status: unbootable
slot: 1, retry_count: 3, status: normal

I restored the rootfs partitions on slot A and did a capsule update which was successful, but slot 0 is still marked as ‘unbootable’, so how do I clear the status bit so that the partition appears bootable again?

After some digging around I came across nv_ota_common.func which contains the following function to update EFI variable RootfsStatusSlotA/B.

Pity this variable is not documented here, it would have made tracking this done easier… It would also be useful to understand what value it takes.

reset_rootfs_chain_status()
{
local chain=“${1}”
local uefi_var=“RootfsStatusSlot${chain}-781e084c-a330-417c-b678-38e696380cb9”
local value=“\x07\x00\x00\x00\x00\x00\x00\x00”

# Mount efivarfs
mount_uefi_variables

ota_log "Clean chain status for rootfs(${chain}) by writing ${value} to UEFI variable ${uefi_var}"
if ! write_uefi_variable "${uefi_var}" "${value}"; then
	ota_log "Failed to clean rootfs chain status"
	return 1
fi
return 0

}

hello jeanphilippe.arnaud,

you should follow below stesp to restore corrupted rootfs slot via UEFI.
(1) Upon booting-up, Press ESC to enter UEFI Menu
(2) Choose Device Manager → NVIDIA Configuration → L4T Configuration
(3) OS chain A status: The value is Unbootable if UEFI attempts recovery kernel, choose Normal
(4) Save and exit, reboot, UEFI will try Direct Boot

Hi Jerry,

Thanks for getting back to me. I will try those steps for an “in-person” recovery.

However I am working on OTA updates, where the system must somehow recover without human intervention when something goes wrong (e.g. power cut during the update, causing data corruption).

If the system is currently running from slot A and I am performing an update (so copying files to slot B), but B is somehow marked as unbootable, I need to be able to clear the unbootable flag somehow. Can you confirm that clearing EFI variable ‘RootfsStatusSlot${chain}’ is sufficient and what Nvidia expects its customers to do?

hello jeanphilippe.arnaud,

yes, it’s mentioned by developer guide as well,
for instance, Set the System to Normal Boot from the Recovery Kernel Boot.

Hi Jerry,

Thanks, this answers my question. I had skimmed over the recovery section as I’m not putting the platform in that mode.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.