From a968b485237aea3603d7a9be2df1ebe909ce7e8a Mon Sep 17 00:00:00 2001 From: Ryan Mounce Date: Wed, 1 Mar 2023 15:19:44 +1030 Subject: [PATCH] Support LUKS with 'lvm' autoinstall storage layout Resolves: https://bugs.launchpad.net/subiquity/+bug/1913986 --- documentation/autoinstall-reference.md | 7 +++++++ subiquity/server/controllers/filesystem.py | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/documentation/autoinstall-reference.md b/documentation/autoinstall-reference.md index 1f364be0..9386445a 100644 --- a/documentation/autoinstall-reference.md +++ b/documentation/autoinstall-reference.md @@ -302,6 +302,13 @@ By default these will install to the largest disk in a system, but you can suppl (you can just say "`match: {}`" to match an arbitrary disk) +When using the "lvm" layout, LUKS encryption can be enabled by supplying a password. + + storage: + layout: + name: lvm + password: LUKS_PASSPHRASE + The default is to use the lvm layout. #### action-based config diff --git a/subiquity/server/controllers/filesystem.py b/subiquity/server/controllers/filesystem.py index 9c361ed2..3ce1a12b 100644 --- a/subiquity/server/controllers/filesystem.py +++ b/subiquity/server/controllers/filesystem.py @@ -912,7 +912,9 @@ class FilesystemController(SubiquityController, FilesystemManipulator): log.info(f'autoinstall: running guided {name} install in mode {mode} ' f'using {target}') use_lvm = name == 'lvm' - self.guided(GuidedChoiceV2(target=target, use_lvm=use_lvm)) + password = layout.get('password', None) + self.guided(GuidedChoiceV2(target=target, use_lvm=use_lvm, + password=password)) def validate_layout_mode(self, mode): if mode not in ('reformat_disk', 'use_gap'):