Skip to content

Commit

Permalink
mount rp at predictable path and leave it mounted
Browse files Browse the repository at this point in the history
I have a use case for wanting to manipulate the rp contents in a late-command.
  • Loading branch information
mwhudson committed Jul 21, 2023
1 parent a9828ed commit 825ae8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/autoinstall/reset-only.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ storage:
reset-partition: yes
reset-partition-only: yes
late-commands:
- ['true']
- ['sleep', '10m']
13 changes: 7 additions & 6 deletions subiquity/server/controllers/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,13 @@ async def run_curtin_step(name, stages, step_config, source=None):
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, 'rp')
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")
Expand Down

0 comments on commit 825ae8c

Please sign in to comment.