From f865b4be86f4a2c4466e2df895a5fc1460f18a4d Mon Sep 17 00:00:00 2001 From: John Eckersberg Date: Tue, 22 Sep 2026 12:49:59 -0400 Subject: [PATCH] bootctl: explicitly disable systemd chroot detection Closes: #2486 Signed-off-by: John Eckersberg --- crates/lib/src/bootloader.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/lib/src/bootloader.rs b/crates/lib/src/bootloader.rs index 0a2836f88f..8b44c27b18 100644 --- a/crates/lib/src/bootloader.rs +++ b/crates/lib/src/bootloader.rs @@ -309,6 +309,14 @@ pub(crate) fn install_systemd_boot( // write it. Redirect into /tmp (a tmpfs mounted by MountedImageRoot) // so the write succeeds and is automatically discarded. .env("KERNEL_INSTALL_CONF_ROOT", KERNEL_INSTALL_CONF_ROOT) + // If systemd thinks it's inside of a chroot, it will fall + // back to "graceful" mode. This means that bootctl will exit + // 0 even if bootloader installation doesn't go as expected, + // and we don't want that. Explicitly disable chroot + // detection. + // + // See: https://github.com/bootc-dev/bootc/issues/2486 + .env("SYSTEMD_IN_CHROOT", "0") .log_debug() // Capture stderr so bootctl error messages appear in our error chain. .run_capture_stderr()?;