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.
This commit is contained in:
Michael Hudson-Doyle 2023-07-21 15:24:07 +12:00
parent 2a8f1cf191
commit 3e2c8be86b
1 changed files with 8 additions and 7 deletions

View File

@ -395,13 +395,14 @@ class InstallController(SubiquityController):
rp = fs_controller.reset_partition rp = fs_controller.reset_partition
if rp is not None: if rp is not None:
mounter = Mounter(self.app) mounter = Mounter(self.app)
async with mounter.mounted(rp.path) as mp: rp_target = os.path.join(self.app.root, "factory-reset")
await run_curtin_step( mp = await mounter.mount(rp.path, mountpoint=rp_target)
name="populate recovery", await run_curtin_step(
stages=["extract"], name="populate recovery",
step_config=self.rp_config(logs_dir, mp.p()), stages=["extract"],
source="cp:///cdrom", step_config=self.rp_config(logs_dir, mp.p()),
) source="cp:///cdrom",
)
await self.create_rp_boot_entry(context=context, rp=rp) await self.create_rp_boot_entry(context=context, rp=rp)
@with_context(description="creating boot entry for reset partition") @with_context(description="creating boot entry for reset partition")