Files
disko/tests/bcachefs.nix
T
nothingnesses ca27b88c88 Add bcachefs type with encryption and multi-disk support
This update introduces a bcachefs type with encryption support and advanced formatting options.
It includes a new example (`examples/bcachefs-multi-disk.nix`) to demonstrate multi-disk setups and available options.

Key changes:

- Deterministic UUID generation.
- Addressed limitations with multi-disk root setups due to bcachefs and systemd issues.
- Provided a systemd-mount alternative for fileSystems configuration.
- Added subvolume support and updated scripts for clarity and functionality.

---------

Co-authored-by: Jonas Heinrich <onny@project-insanity.org>
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
Co-authored-by: Kyle Petryszak <6314611+ProjectInitiative@users.noreply.github.com>

Update
* Add examples
* Improve descriptions

Remove debugging

Remove comment

Use `unique` to dedup lists
2025-04-24 13:41:42 +00:00

46 lines
1.4 KiB
Nix

{
pkgs ? import <nixpkgs> { },
diskoLib ? pkgs.callPackage ../lib { },
}:
diskoLib.testLib.makeDiskoTest {
inherit pkgs;
name = "bcachefs";
disko-config = ../example/bcachefs.nix;
enableOCR = true;
extraTestScript = ''
machine.succeed("mountpoint /");
# @todo Verify all devices are part of the filesystem.
# @todo Check device labels and group assignments.
# Verify mount options were applied.
machine.succeed("mount | grep ' / ' | grep -q 'compression=lz4'");
machine.succeed("mount | grep ' / ' | grep -q 'background_compression=lz4'");
# @todo Verify mountpoint dependency order was respected.
# @todo Add tests for subvolumes.
# Print debug information.
machine.succeed("lsblk >&2");
machine.succeed("lsblk -f >&2");
machine.succeed("mount >&2");
'';
# extraSystemConfig = { pkgs, ... }: {
# # @todo Do we need to add any attributes here?
# boot = {
# supportedFilesystems = [ "bcachefs" ];
# initrd = {
# supportedFilesystems = [ "bcachefs" ];
# # systemd.enable = false;
# };
# };
# environment.systemPackages = [
# pkgs.bcachefs-tools
# pkgs.util-linux
# ];
# };
# extraInstallerConfig = {
# # @todo Do we need to add any attributes here?
# };
bootCommands = ''
machine.wait_for_text("enter passphrase for");
machine.send_chars("secretsecret\n");
'';
}