nixos/stage-1-systemd: Implement hibernation + test

This commit is contained in:
Janne Heß 2022-04-13 12:48:20 +01:00
parent ffb320378b
commit aeb75b3b69
No known key found for this signature in database
GPG Key ID: 69165158F05265DF
3 changed files with 10 additions and 0 deletions

View File

@ -503,5 +503,8 @@ in {
];
};
};
boot.kernelParams = lib.mkIf (config.boot.resumeDevice != "") [ "resume=${config.boot.resumeDevice}" ];
};
}

View File

@ -208,6 +208,7 @@ in
# hibernation. This test happens to work on x86_64-linux but
# not on other platforms.
hibernate = handleTestOn ["x86_64-linux"] ./hibernate.nix {};
hibernate-systemd-stage-1 = handleTestOn ["x86_64-linux"] ./hibernate.nix { systemdStage1 = true; };
hitch = handleTest ./hitch {};
hledger-web = handleTest ./hledger-web.nix {};
hocker-fetchdocker = handleTest ./hocker-fetchdocker {};

View File

@ -3,6 +3,7 @@
{ system ? builtins.currentSystem
, config ? {}
, pkgs ? import ../.. { inherit system config; }
, systemdStage1 ? false
}:
with import ../lib/testing-python.nix { inherit system pkgs; };
@ -29,6 +30,11 @@ let
"/".device = "/dev/vda2";
};
swapDevices = mkOverride 0 [ { device = "/dev/vda1"; } ];
boot.resumeDevice = mkIf systemdStage1 "/dev/vda1";
boot.initrd.systemd = mkIf systemdStage1 {
enable = true;
emergencyAccess = true;
};
};
installedSystem = (import ../lib/eval-config.nix {
inherit system;