Skip to content

Commit 08b1cad

Browse files
Johan-Liebert1cgwalters
authored andcommitted
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 <[email protected]>
1 parent a53ca13 commit 08b1cad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/lib/src/install.rs

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

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

20442045
grub_dir
20452046
.atomic_write(user_cfg_name, buffer)

0 commit comments

Comments
 (0)