Skip to content

Commit 1e73eaa

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 <[email protected]>
1 parent 4c31ddf commit 1e73eaa

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
@@ -2031,9 +2031,10 @@ pub(crate) fn setup_composefs_uki_boot(
20312031
let mut str_buf = String::new();
20322032
let entries = get_sorted_uki_boot_entries(&mut str_buf)?;
20332033

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

20382039
grub_dir
20392040
.atomic_write(user_cfg_name, buffer)

0 commit comments

Comments
 (0)