From d2fb4cfa8084b196594a80cea079565d4094847d Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 8 Aug 2023 21:20:41 +1200 Subject: [PATCH 1/2] do not remove old UEFI loaders --- subiquity/models/subiquity.py | 1 + 1 file changed, 1 insertion(+) diff --git a/subiquity/models/subiquity.py b/subiquity/models/subiquity.py index 0741d728b..d97dba615 100644 --- a/subiquity/models/subiquity.py +++ b/subiquity/models/subiquity.py @@ -468,6 +468,7 @@ def render(self): "terminal": "unmodified", "probe_additional_os": True, "reorder_uefi": False, + "remove_old_uefi_loaders": False, }, "install": { "unmount": "disabled", From b2d112667fdf7cedda4ae1f54b1b229060e819a7 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 8 Aug 2023 21:25:26 +1200 Subject: [PATCH 2/2] set bootnext to RP in reset-partition-only case --- subiquity/server/controllers/install.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/subiquity/server/controllers/install.py b/subiquity/server/controllers/install.py index 8eee0e294..f17f4e845 100644 --- a/subiquity/server/controllers/install.py +++ b/subiquity/server/controllers/install.py @@ -473,24 +473,33 @@ async def create_rp_boot_entry(self, context, rp): return new_bootnum = new_bootnums.pop() new_entry = efi_state_after.entries[new_bootnum] - was_dup = False - for entry in efi_state_before.entries.values(): + orig_num = None + for num, entry in efi_state_before.entries.items(): if entry.path == new_entry.path and entry.name == new_entry.name: - was_dup = True - if was_dup: + orig_num = num + if orig_num is not None: cmd = [ "efibootmgr", "--delete-bootnum", "--bootnum", new_bootnum, ] + rp_bootnum = orig_num else: cmd = [ "efibootmgr", "--bootorder", ",".join(efi_state_before.order), ] + rp_bootnum = new_bootnum await self.app.command_runner.run(cmd) + if not fs_controller.reset_partition_only: + cmd = [ + "efibootmgr", + "--bootnext", + rp_bootnum, + ] + await self.app.command_runner.run(cmd) @with_context(description="creating fstab") async def create_core_boot_classic_fstab(self, *, context):