Skip to content

Commit

Permalink
set bootnext to RP in reset-partition-only case
Browse files Browse the repository at this point in the history
  • Loading branch information
mwhudson committed Aug 8, 2023
1 parent d2fb4cf commit b2d1126
Showing 1 changed file with 13 additions and 4 deletions.
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 b2d1126

Please sign in to comment.