Skip to content

Commit

Permalink
Merge pull request #1758 from mwhudson/bootnext-rp
Browse files Browse the repository at this point in the history
preserve old loaders, and set bootnext to rp
  • Loading branch information
mwhudson authored Aug 8, 2023
2 parents bdde2c1 + b2d1126 commit b0f1030
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions subiquity/models/subiquity.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ def render(self):
"terminal": "unmodified",
"probe_additional_os": True,
"reorder_uefi": False,
"remove_old_uefi_loaders": False,
},
"install": {
"unmount": "disabled",
Expand Down
17 changes: 13 additions & 4 deletions subiquity/server/controllers/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit b0f1030

Please sign in to comment.