From 3716f1259ff134289d8b72a4f66bb7753274a94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yao=20Wei=20=28=E9=AD=8F=E9=8A=98=E5=BB=B7=29?= Date: Mon, 14 Aug 2023 17:45:36 +0800 Subject: [PATCH 1/3] fix: fix calling partition_by_partuuid --- subiquity/server/controllers/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subiquity/server/controllers/install.py b/subiquity/server/controllers/install.py index 2e0ad9c9..c2a80269 100644 --- a/subiquity/server/controllers/install.py +++ b/subiquity/server/controllers/install.py @@ -435,7 +435,7 @@ class InstallController(SubiquityController): casper_uuid = fp.read().strip() rp_partuuid = self.app.kernel_cmdline.get("rp-partuuid") if casper_uuid is not None and rp_partuuid is not None: - rp = self.app.base_model.partition_by_partuuid(rp_partuuid) + rp = self.app.base_model.filesystem.partition_by_partuuid(rp_partuuid) if rp is not None: await self.configure_rp_boot( context=context, rp=rp, casper_uuid=casper_uuid From e0e2515eb58bbfa3e1a70ea95b0f13b7f372ba39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yao=20Wei=20=28=E9=AD=8F=E9=8A=98=E5=BB=B7=29?= Date: Mon, 14 Aug 2023 17:46:13 +0800 Subject: [PATCH 2/3] fix: put EFI boot entry of recovery partition last of boot order --- subiquity/server/controllers/install.py | 2 +- subiquity/server/controllers/tests/test_install.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/subiquity/server/controllers/install.py b/subiquity/server/controllers/install.py index c2a80269..8661710d 100644 --- a/subiquity/server/controllers/install.py +++ b/subiquity/server/controllers/install.py @@ -557,7 +557,7 @@ class InstallController(SubiquityController): 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) diff --git a/subiquity/server/controllers/tests/test_install.py b/subiquity/server/controllers/tests/test_install.py index 645df605..20197584 100644 --- a/subiquity/server/controllers/tests/test_install.py +++ b/subiquity/server/controllers/tests/test_install.py @@ -264,7 +264,7 @@ class TestInstallController(unittest.IsolatedAsyncioTestCase): [ "efibootmgr", "--bootorder", - "0000,0002", + "0000,0002,0003", ] ), ] @@ -295,7 +295,14 @@ class TestInstallController(unittest.IsolatedAsyncioTestCase): [ "efibootmgr", "--bootorder", - "0000,0002", + "0000,0002,0003", + ] + ), + call( + [ + "efibootmgr", + "--bootnext", + "0003", ] ), ] From 9c37efd534f71d6a1bbae14e35b73bb6691b9e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yao=20Wei=20=28=E9=AD=8F=E9=8A=98=E5=BB=B7=29?= Date: Mon, 14 Aug 2023 17:46:55 +0800 Subject: [PATCH 3/3] fix: call update-grub after closing 99_reset --- subiquity/server/controllers/install.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/subiquity/server/controllers/install.py b/subiquity/server/controllers/install.py index 8661710d..fb6faf11 100644 --- a/subiquity/server/controllers/install.py +++ b/subiquity/server/controllers/install.py @@ -499,16 +499,16 @@ class InstallController(SubiquityController): 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):