Skip to content

Commit f02c8c4

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 2ecf487 commit f02c8c4

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
@@ -2019,9 +2019,10 @@ pub(crate) fn setup_composefs_uki_boot(
20192019
let mut str_buf = String::new();
20202020
let entries = get_sorted_uki_boot_entries(&mut str_buf)?;
20212021

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

20262027
grub_dir
20272028
.atomic_write(user_cfg_name, buffer)

0 commit comments

Comments
 (0)