diff --git a/subiquity/server/controllers/install.py b/subiquity/server/controllers/install.py index 16f0e607..6f64be06 100644 --- a/subiquity/server/controllers/install.py +++ b/subiquity/server/controllers/install.py @@ -162,7 +162,8 @@ class InstallController(SubiquityController): generate_config_yaml(str(config_file), config) def acquire_generic_config(self, - step: CurtinInstallStep) -> Dict[str, Any]: + step: CurtinInstallStep, + **kw) -> Dict[str, Any]: """ Return a dictionary object to be used as the configuration of a generic curtin install step. """ config = self.model.render() @@ -170,6 +171,7 @@ class InstallController(SubiquityController): config["install"]["log_file_append"] = True config["install"]["error_tarfile"] = str(step.error_file) config["install"]["resume_data"] = str(step.resume_data_file) + config.update(kw) return config def acquire_initial_config(self, @@ -285,6 +287,17 @@ class InstallController(SubiquityController): acquire_config=self.acquire_generic_config, ).run, self.create_core_boot_classic_fstab, + make_curtin_step( + name="swap", stages=["swap"], + acquire_config=functools.partial( + self.acquire_generic_config, + swap_commands={ + 'subiquity': [ + 'curtin', 'swap', + '--fstab', self.tpath('etc/fstab'), + ], + }), + ).run, fs_controller.finish_install, self.setup_target, ]) diff --git a/subiquity/server/curtin.py b/subiquity/server/curtin.py index 88789d82..6907aa66 100644 --- a/subiquity/server/curtin.py +++ b/subiquity/server/curtin.py @@ -135,6 +135,7 @@ class _DryRunCurtinCommand(_CurtinCommand): ("partitioning",): "examples/curtin-events-partitioning.json", ("extract",): "examples/curtin-events-extract.json", ("curthooks",): "examples/curtin-events-curthooks.json", + ("swap",): "examples/curtin-events-curthooks.json", # hack } def make_command(self, command, *args, config=None):