Skip to content

Commit 3490acc

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 1b55337 commit 3490acc

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
@@ -2028,9 +2028,10 @@ pub(crate) fn setup_composefs_uki_boot(
20282028
let mut str_buf = String::new();
20292029
let entries = get_sorted_uki_boot_entries(&mut str_buf)?;
20302030

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

20352036
grub_dir
20362037
.atomic_write(user_cfg_name, buffer)

0 commit comments

Comments
 (0)