Skip to content

Commit 7a09546

Browse files
install/composefs/uki: Write only staged + booted menuentry on upgrade
Instaed of writing all present menuentries, only write the menuentry for switch/upgrade and the menuentry for the currently booted deployment. Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
1 parent 645c93b commit 7a09546

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

crates/lib/src/install.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,9 +1995,10 @@ pub(crate) fn setup_composefs_uki_boot(
19951995
let mut str_buf = String::new();
19961996
let entries = get_sorted_uki_boot_entries(&mut str_buf)?;
19971997

1998-
for entry in entries {
1999-
buffer.write_all(entry.to_string().as_bytes())?;
2000-
}
1998+
// Write out only the currently booted entry, which should be the very first one
1999+
// Even if we have booted into the second menuentry "boot entry", the default will be the
2000+
// first one
2001+
buffer.write_all(entries[0].to_string().as_bytes())?;
20012002

20022003
grub_dir
20032004
.atomic_write(user_cfg_name, buffer)

0 commit comments

Comments
 (0)