Skip to content

Commit

Permalink
Merge pull request #474 from d-loose/zfs-encryption
Browse files Browse the repository at this point in the history
feat(bootstrap): expose encrypted ZFS in advanced features dialog
  • Loading branch information
d-loose committed Mar 1, 2024
2 parents 6fbc3b0 + e01df98 commit b5dce80
Show file tree
Hide file tree
Showing 85 changed files with 917 additions and 417 deletions.
6 changes: 3 additions & 3 deletions ci/snap/bootstrap/snapcraft.yaml
Expand Up @@ -10,7 +10,7 @@ base: core22
architectures:
- build-on: amd64
- build-on: arm64

apps:
subiquity-server:
command: bin/subiquity-server
Expand Down Expand Up @@ -47,7 +47,7 @@ parts:
plugin: nil
source: https://git.launchpad.net/curtin
source-type: git
source-commit: 237053d9d18916dd72cf861280474d4df0e9fd24
source-commit: c3c4f42862b01e76ef6767e66b808707897aa558
override-pull: |
craftctl default
PACKAGED_VERSION="$(git describe --long --abbrev=9 --match=[0-9][0-9]*)"
Expand Down Expand Up @@ -175,7 +175,7 @@ parts:
cp -r snap/local/postinst.d $CRAFT_PART_INSTALL/etc/subiquity
mkdir -p $CRAFT_PART_INSTALL/usr/share/applications
cp snap/local/ubuntu-desktop-bootstrap.desktop $CRAFT_PART_INSTALL/usr/share/applications/
dart pub global activate melos
dart pub global run melos bootstrap
cd packages/ubuntu_bootstrap
Expand Down
Expand Up @@ -252,6 +252,81 @@ void main() {
);
});

testWidgets('ZFS encrypted', (tester) async {
const identity = Identity(
realname: 'User',
hostname: 'ubuntu',
username: 'user',
);

await tester.runApp(() => app.main(<String>[]));
await tester.pumpAndSettle();

await tester.testLocalePage();
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testAccessibilityPage();
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testKeyboardPage();
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testNetworkPage(mode: ConnectMode.none);
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testRefreshPage();
await tester.tapSkip();
await tester.pumpAndSettle();

await tester.testSourceSelectionPage();
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testCodecsAndDriversPage();
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testStoragePage(
type: StorageType.erase,
guidedCapability: GuidedCapability.ZFS_LUKS_KEYSTORE,
);
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testSecurityKeyPage(securityKey: 'password');
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testIdentityPage(identity: identity, password: 'password');
await tester.tapNext();
await tester.pumpAndSettle();
await expectIdentity(identity);

await tester.testTimezonePage();
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testConfirmPage();
await tester.tapConfirm();
await tester.pumpAndSettle();

await tester.testInstallPage();
await tester.pumpAndSettle();

final windowClosed = YaruTestWindow.waitForClosed();
await tester.tapContinueTesting();
await expectLater(windowClosed, completes);

await verifySubiquityConfig(
identity: identity,
capability: GuidedCapability.ZFS_LUKS_KEYSTORE,
);
});

testWidgets('tpm', (tester) async {
const identity = Identity(
realname: 'User',
Expand Down Expand Up @@ -653,6 +728,12 @@ Future<void> verifySubiquityConfig({
expect(actualStorage.where((config) => config['type'] == 'zpool'),
isNotEmpty);
break;
case GuidedCapability.ZFS_LUKS_KEYSTORE:
expect(actualStorage.where((config) => config['type'] == 'zpool'),
isNotEmpty);
expect(actualStorage.where((config) => config['type'] == 'dm_crypt'),
isNotEmpty);
break;
case GuidedCapability.CORE_BOOT_ENCRYPTED:
expect(
actualStorage
Expand Down
12 changes: 8 additions & 4 deletions packages/ubuntu_bootstrap/lib/l10n/ubuntu_bootstrap_en.arb
Expand Up @@ -234,21 +234,25 @@
},
"installationTypeLVMSelected": "LVM selected",
"@installationTypeLVMSelected": {},
"installationTypeLVMEncryptionSelected": "LVM and encryption selected",
"@installationTypeLVMEncryptionSelected": {},
"installationTypeEncrypt": "Encrypt the new {RELEASE} installation for security",
"@installationTypeEncrypt": {
"installationTypeLVMEncryption": "Use LVM and encryption with the new {RELEASE} installation",
"@installationTypeLVMEncryption": {
"type": "text",
"placeholders": {
"RELEASE": {}
}
},
"installationTypeLVMEncryptionSelected": "LVM and encryption selected",
"@installationTypeLVMEncryptionSelected": {},
"installationTypeEncryptInfo": "You will choose a security key in the next step.",
"@installationTypeEncryptInfo": {},
"installationTypeZFS": "EXPERIMENTAL: Erase disk and use ZFS",
"@installationTypeZFS": {},
"installationTypeZFSEncryption": "EXPERIMENTAL: Erase disk and use ZFS with encryption",
"@installationTypeZFSEncryption": {},
"installationTypeZFSSelected": "ZFS selected",
"@installationTypeZFSSelected": {},
"installationTypeZFSEncryptionSelected": "ZFS and encryption selected",
"@installationTypeZFSEncryptionSelected": {},
"installationTypeTPM": "EXPERIMENTAL: Enable hardware-backed full disk encryption",
"@installationTypeTPM": {},
"installationTypeTPMWarning": "<font color=\"{color}\">Warning:</font> This feature is only supported on certain hardware configurations and may not support upgrading to future Ubuntu releases. Please read the <a href=\"{url}\">release notes</a> before enabling.",
Expand Down
Expand Up @@ -651,17 +651,17 @@ abstract class UbuntuBootstrapLocalizations {
/// **'LVM selected'**
String get installationTypeLVMSelected;

/// No description provided for @installationTypeLVMEncryptionSelected.
/// No description provided for @installationTypeLVMEncryption.
///
/// In en, this message translates to:
/// **'LVM and encryption selected'**
String get installationTypeLVMEncryptionSelected;
/// **'Use LVM and encryption with the new {RELEASE} installation'**
String installationTypeLVMEncryption(Object RELEASE);

/// No description provided for @installationTypeEncrypt.
/// No description provided for @installationTypeLVMEncryptionSelected.
///
/// In en, this message translates to:
/// **'Encrypt the new {RELEASE} installation for security'**
String installationTypeEncrypt(Object RELEASE);
/// **'LVM and encryption selected'**
String get installationTypeLVMEncryptionSelected;

/// No description provided for @installationTypeEncryptInfo.
///
Expand All @@ -675,12 +675,24 @@ abstract class UbuntuBootstrapLocalizations {
/// **'EXPERIMENTAL: Erase disk and use ZFS'**
String get installationTypeZFS;

/// No description provided for @installationTypeZFSEncryption.
///
/// In en, this message translates to:
/// **'EXPERIMENTAL: Erase disk and use ZFS with encryption'**
String get installationTypeZFSEncryption;

/// No description provided for @installationTypeZFSSelected.
///
/// In en, this message translates to:
/// **'ZFS selected'**
String get installationTypeZFSSelected;

/// No description provided for @installationTypeZFSEncryptionSelected.
///
/// In en, this message translates to:
/// **'ZFS and encryption selected'**
String get installationTypeZFSEncryptionSelected;

/// No description provided for @installationTypeTPM.
///
/// In en, this message translates to:
Expand Down
Expand Up @@ -250,22 +250,28 @@ class UbuntuBootstrapLocalizationsAm extends UbuntuBootstrapLocalizations {
String get installationTypeLVMSelected => 'LVM selected';

@override
String get installationTypeLVMEncryptionSelected => 'LVM and encryption selected';
String installationTypeLVMEncryption(Object RELEASE) {
return 'Use LVM and encryption with the new $RELEASE installation';
}

@override
String installationTypeEncrypt(Object RELEASE) {
return 'Encrypt the new $RELEASE installation for security';
}
String get installationTypeLVMEncryptionSelected => 'LVM and encryption selected';

@override
String get installationTypeEncryptInfo => 'You will choose a security key in the next step.';

@override
String get installationTypeZFS => 'EXPERIMENTAL: Erase disk and use ZFS';

@override
String get installationTypeZFSEncryption => 'EXPERIMENTAL: Erase disk and use ZFS with encryption';

@override
String get installationTypeZFSSelected => 'ZFS selected';

@override
String get installationTypeZFSEncryptionSelected => 'ZFS and encryption selected';

@override
String get installationTypeTPM => 'EXPERIMENTAL: Enable hardware-backed full disk encryption';

Expand Down
Expand Up @@ -250,22 +250,28 @@ class UbuntuBootstrapLocalizationsAr extends UbuntuBootstrapLocalizations {
String get installationTypeLVMSelected => 'حُدد LVM';

@override
String get installationTypeLVMEncryptionSelected => 'حُدد LVM مع التشفير';
String installationTypeLVMEncryption(Object RELEASE) {
return 'Use LVM and encryption with the new $RELEASE installation';
}

@override
String installationTypeEncrypt(Object RELEASE) {
return 'Encrypt the new $RELEASE installation for security';
}
String get installationTypeLVMEncryptionSelected => 'حُدد LVM مع التشفير';

@override
String get installationTypeEncryptInfo => 'ستختار مفتاح أمان في الخطوة التالية.';

@override
String get installationTypeZFS => 'تجريبي:أمحُ القرص واستخدم ZFS';

@override
String get installationTypeZFSEncryption => 'EXPERIMENTAL: Erase disk and use ZFS with encryption';

@override
String get installationTypeZFSSelected => 'حُدد ZFS';

@override
String get installationTypeZFSEncryptionSelected => 'ZFS and encryption selected';

@override
String get installationTypeTPM => 'EXPERIMENTAL: Enable hardware-backed full disk encryption';

Expand Down
Expand Up @@ -250,22 +250,28 @@ class UbuntuBootstrapLocalizationsBe extends UbuntuBootstrapLocalizations {
String get installationTypeLVMSelected => 'LVM selected';

@override
String get installationTypeLVMEncryptionSelected => 'LVM and encryption selected';
String installationTypeLVMEncryption(Object RELEASE) {
return 'Use LVM and encryption with the new $RELEASE installation';
}

@override
String installationTypeEncrypt(Object RELEASE) {
return 'Encrypt the new $RELEASE installation for security';
}
String get installationTypeLVMEncryptionSelected => 'LVM and encryption selected';

@override
String get installationTypeEncryptInfo => 'You will choose a security key in the next step.';

@override
String get installationTypeZFS => 'EXPERIMENTAL: Erase disk and use ZFS';

@override
String get installationTypeZFSEncryption => 'EXPERIMENTAL: Erase disk and use ZFS with encryption';

@override
String get installationTypeZFSSelected => 'ZFS selected';

@override
String get installationTypeZFSEncryptionSelected => 'ZFS and encryption selected';

@override
String get installationTypeTPM => 'EXPERIMENTAL: Enable hardware-backed full disk encryption';

Expand Down
Expand Up @@ -250,22 +250,28 @@ class UbuntuBootstrapLocalizationsBg extends UbuntuBootstrapLocalizations {
String get installationTypeLVMSelected => 'LVM selected';

@override
String get installationTypeLVMEncryptionSelected => 'LVM and encryption selected';
String installationTypeLVMEncryption(Object RELEASE) {
return 'Use LVM and encryption with the new $RELEASE installation';
}

@override
String installationTypeEncrypt(Object RELEASE) {
return 'Encrypt the new $RELEASE installation for security';
}
String get installationTypeLVMEncryptionSelected => 'LVM and encryption selected';

@override
String get installationTypeEncryptInfo => 'You will choose a security key in the next step.';

@override
String get installationTypeZFS => 'EXPERIMENTAL: Erase disk and use ZFS';

@override
String get installationTypeZFSEncryption => 'EXPERIMENTAL: Erase disk and use ZFS with encryption';

@override
String get installationTypeZFSSelected => 'ZFS selected';

@override
String get installationTypeZFSEncryptionSelected => 'ZFS and encryption selected';

@override
String get installationTypeTPM => 'EXPERIMENTAL: Enable hardware-backed full disk encryption';

Expand Down
Expand Up @@ -250,22 +250,28 @@ class UbuntuBootstrapLocalizationsBn extends UbuntuBootstrapLocalizations {
String get installationTypeLVMSelected => 'LVM selected';

@override
String get installationTypeLVMEncryptionSelected => 'LVM and encryption selected';
String installationTypeLVMEncryption(Object RELEASE) {
return 'Use LVM and encryption with the new $RELEASE installation';
}

@override
String installationTypeEncrypt(Object RELEASE) {
return 'Encrypt the new $RELEASE installation for security';
}
String get installationTypeLVMEncryptionSelected => 'LVM and encryption selected';

@override
String get installationTypeEncryptInfo => 'You will choose a security key in the next step.';

@override
String get installationTypeZFS => 'EXPERIMENTAL: Erase disk and use ZFS';

@override
String get installationTypeZFSEncryption => 'EXPERIMENTAL: Erase disk and use ZFS with encryption';

@override
String get installationTypeZFSSelected => 'ZFS selected';

@override
String get installationTypeZFSEncryptionSelected => 'ZFS and encryption selected';

@override
String get installationTypeTPM => 'EXPERIMENTAL: Enable hardware-backed full disk encryption';

Expand Down

0 comments on commit b5dce80

Please sign in to comment.