From 3e2c8be86b30682fde2345fdd646e63e7c029042 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 21 Jul 2023 15:24:07 +1200 Subject: [PATCH] mount rp at predictable path and leave it mounted I have a use case for wanting to manipulate the rp contents in a late-command. --- subiquity/server/controllers/install.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/subiquity/server/controllers/install.py b/subiquity/server/controllers/install.py index d82657a4..4590bfdf 100644 --- a/subiquity/server/controllers/install.py +++ b/subiquity/server/controllers/install.py @@ -395,13 +395,14 @@ class InstallController(SubiquityController): rp = fs_controller.reset_partition if rp is not None: mounter = Mounter(self.app) - async with mounter.mounted(rp.path) as mp: - await run_curtin_step( - name="populate recovery", - stages=["extract"], - step_config=self.rp_config(logs_dir, mp.p()), - source="cp:///cdrom", - ) + rp_target = os.path.join(self.app.root, "factory-reset") + mp = await mounter.mount(rp.path, mountpoint=rp_target) + await run_curtin_step( + name="populate recovery", + stages=["extract"], + step_config=self.rp_config(logs_dir, mp.p()), + source="cp:///cdrom", + ) await self.create_rp_boot_entry(context=context, rp=rp) @with_context(description="creating boot entry for reset partition")