diff --git a/subiquity/server/controllers/install.py b/subiquity/server/controllers/install.py index 0a623474d..865b5d4f1 100644 --- a/subiquity/server/controllers/install.py +++ b/subiquity/server/controllers/install.py @@ -489,16 +489,16 @@ async def configure_rp_boot_grub(self, context, rp: Partition, casper_uuid: str) with open(self.tpath("etc/grub.d/99_reset"), "w") as fp: os.chmod(fp.fileno(), 0o755) fp.write(conf) - await run_curtin_command( - self.app, - context, - "in-target", - "-t", - self.tpath(), - "--", - "update-grub", - private_mounts=False, - ) + await run_curtin_command( + self.app, + context, + "in-target", + "-t", + self.tpath(), + "--", + "update-grub", + private_mounts=False, + ) @with_context(description="configuring UEFI menu entry for factory reset") async def configure_rp_boot_uefi(self, context, rp: Partition): @@ -547,7 +547,7 @@ async def configure_rp_boot_uefi(self, context, rp: Partition): cmd = [ "efibootmgr", "--bootorder", - ",".join(efi_state_before.order), + ",".join(efi_state_before.order + [new_bootnum]), ] rp_bootnum = new_bootnum await self.app.command_runner.run(cmd) @@ -579,7 +579,7 @@ async def maybe_configure_exiting_rp_boot(self, context): if rp_partuuid is None: # Most likely case: we are not running from an reset partition return - rp = self.app.base_model.partition_by_partuuid(rp_partuuid) + rp = self.app.base_model.filesystem.partition_by_partuuid(rp_partuuid) if rp is None: # This shouldn't happen, but don't crash. return diff --git a/subiquity/server/controllers/tests/test_install.py b/subiquity/server/controllers/tests/test_install.py index 645df605d..201975845 100644 --- a/subiquity/server/controllers/tests/test_install.py +++ b/subiquity/server/controllers/tests/test_install.py @@ -264,7 +264,7 @@ async def test_configure_rp_boot_uefi_add(self, m_get_efibootmgr): [ "efibootmgr", "--bootorder", - "0000,0002", + "0000,0002,0003", ] ), ] @@ -295,7 +295,14 @@ async def test_configure_rp_boot_uefi_bootnext(self, m_get_efibootmgr): [ "efibootmgr", "--bootorder", - "0000,0002", + "0000,0002,0003", + ] + ), + call( + [ + "efibootmgr", + "--bootnext", + "0003", ] ), ]