Skip to content

Commit 59f7fff

Browse files
henrywangclaude
andcommitted
composefs: Skip boot entry duplicate check during fresh installs
The find_vmlinuz_initrd_duplicates function looks at the host's /sysroot/state/deploy directory to find existing deployments that share the same kernel/initrd. However, during a fresh install to a target disk (e.g., via --via-loopback), this causes a failure: 1. The host has existing deployments in /sysroot/state/deploy 2. find_vmlinuz_initrd_duplicates returns those entries 3. The code tries to find matching boot entries in the target's /boot 4. The target's /boot is empty → "Shared boot binaries not found" Fix this by only checking for duplicates during upgrades (is_upgrade == true). For fresh installs, the target boot partition is empty anyway, and the duplicate check looks at the wrong state directory (host vs target). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
1 parent e4b2f22 commit 59f7fff

File tree

1 file changed

+11
-1
lines changed
  • crates/lib/src/bootc_composefs

1 file changed

+11
-1
lines changed

crates/lib/src/bootc_composefs/boot.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,17 @@ pub(crate) fn setup_composefs_bls_boot(
694694
options: Some(cmdline_refs),
695695
});
696696

697-
match find_vmlinuz_initrd_duplicates(&boot_digest)? {
697+
// Only check for duplicate boot entries during upgrades.
698+
// For fresh installs, the target boot partition is empty, so there's
699+
// nothing to share. Additionally, find_vmlinuz_initrd_duplicates looks
700+
// at the host's /sysroot/state/deploy, not the target's state.
701+
let duplicates = if is_upgrade {
702+
find_vmlinuz_initrd_duplicates(&boot_digest)?
703+
} else {
704+
None
705+
};
706+
707+
match duplicates {
698708
Some(shared_entries) => {
699709
// Multiple deployments could be using the same kernel + initrd, but there
700710
// would be only one available

0 commit comments

Comments
 (0)