Skip to content

Commit ea5896f

Browse files
committed
status: Check ostree version before enabling soft reboot
Add ostree version check to has_soft_reboot_capability() to ensure soft reboot is only enabled when ostree 2025.7 or later is present. This prevents attempting soft reboots on older ostree versions that have a bug when validating kargs during a factory reset. The check happens before the systemd and deployment capability checks, providing a fast path return for incompatible versions. Signed-off-by: ckyrouac <[email protected]>
1 parent c3bf2ad commit ea5896f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/lib/src/status.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ impl From<ImageReference> for OstreeImageReference {
9595

9696
/// Check if a deployment has soft reboot capability
9797
fn has_soft_reboot_capability(sysroot: &SysrootLock, deployment: &ostree::Deployment) -> bool {
98+
// this version fixes a bug when validating kargs during a factory reset
99+
if !ostree::check_version(2025, 7) {
100+
return false;
101+
}
102+
98103
ostree_ext::systemd_has_soft_reboot() && sysroot.deployment_can_soft_reboot(deployment)
99104
}
100105

0 commit comments

Comments
 (0)