tryboot automatic rollback behavior after failed kernel upgrade
0 reputation · 02 Mar 2025, 09:28 UTC
0 reputation · 02 Mar 2025, 09:28 UTC
The Raspberry Pi bootloader's tryboot feature (introduced in 2022) allows switching between two bootloader configurations, but its ability to automatically roll back a failed kernel or firmware update remains unclear. The mechanism requires a pre-staged alternate boot partition and manual intervention to activate, neither of which are configured by default in Raspberry Pi OS.
Without an A/B root filesystem scheme or snapshot support, a partially applied kernel upgrade can leave the system unbootable while the root filesystem remains on the newer, potentially incompatible package set. Documentation indicates tryboot only switches bootloader configuration—not the root filesystem—so a mismatch between kernel modules and userspace packages may persist even after reverting the boot partition.
Determine whether tryboot can be integrated into an unattended upgrade pipeline to provide genuine rollback safety, or whether it remains a manual recovery tool requiring operator presence.
tryboot be configured to automatically detect a failed boot and revert to the previous bootloader configuration without user input?tryboot to function?tryboot with dpkg transaction state for a complete rollback?34775 reputation · 02 Mar 2025, 15:13 UTC
The tryboot feature cannot provide genuine, unattended rollback safety for kernel upgrades in its default state. It is a bootloader-level mechanism for switching configurations, not a system-wide atomic update tool. Without a coordinated A/B root filesystem or snapshotting mechanism, tryboot alone is a manual recovery tool rather than an automated safety net.
The tryboot flag instructs the bootloader to attempt booting from an alternate configuration. However, the following gaps prevent it from functioning as an automatic rollback system for standard Raspberry Pi OS updates:
tryboot flag was set. To automate this, a hardware watchdog timer must be configured to trigger a reboot if the system fails to reach a "healthy" state.tryboot switches the kernel and boot config, but not the root filesystem. If a kernel upgrade also updated /lib/modules or critical userspace libraries, rolling back the kernel via tryboot will result in a version mismatch, likely leading to a failure to mount the rootfs or a failure to load essential drivers.To transform tryboot into a functional part of an unattended upgrade pipeline, you would need to implement the following tooling:
RAUC or a custom LUKS/LVM snapshot system to ensure the root filesystem version matches the kernel version being booted.dpkg or apt that:
tryboot flag.To verify your current bootloader configuration and check if tryboot is active, use:
# View current bootloader configuration
vcgencmd bootloader_config
Note: If you are using a custom rootfs overlay or a read-only filesystem, please specify the implementation, as this changes how the transaction state must be coordinated.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.