mirror of
https://github.com/nix-community/disko.git
synced 2026-12-01 05:23:28 +01:00
bugfix: Detached headers idempotence check (#1286)
## Summary Detached LUKS headers were not handled correctly by the `_create` idempotence check in `lib/types/luks.nix`. The old logic still probed `config.device`. For detached-header setups, that meant rerun could mis-detect an already-initialized LUKS device and fall back into luksFormat. ## Fix Probe the actual LUKS header target instead of the payload device, and make the create guard depend only on `cryptsetup isLuks` for that target. ## Test Add a detached-header regression test that exercises the direct-mode idempotence path.
This commit is contained in:
3 files changed
+63
-1
No files matched your search
@@ -0,0 +1,17 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
diskoLib ? pkgs.callPackage ../lib { },
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
name = "luks-detached-header";
|
||||
disko-config = ../example/luks-detached-header.nix;
|
||||
testMode = "direct";
|
||||
testBoot = false;
|
||||
extraTestScript = ''
|
||||
machine.succeed("${pkgs.cryptsetup}/bin/cryptsetup isLuks /dev/disk/by-partlabel/disk-main-luks-header");
|
||||
machine.fail("${pkgs.cryptsetup}/bin/cryptsetup isLuks /dev/disk/by-partlabel/disk-main-crypt");
|
||||
machine.succeed("mountpoint /mnt");
|
||||
machine.succeed("test -e /mnt/home/testfile");
|
||||
'';
|
||||
}
|
||||
Reference in new issue
Block a user