Merge pull request #202132 from ElvishJerricco/systemd-stage-1-tests-hibernate

nixos: ext fixes with systemd-initrd
This commit is contained in:
Janne Heß 2022-11-21 10:38:19 +01:00 committed by GitHub
commit c107fb66da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -3,13 +3,14 @@
let
inInitrd = lib.any (fs: fs == "ext2" || fs == "ext3" || fs == "ext4") config.boot.initrd.supportedFilesystems;
inSystem = lib.any (fs: fs == "ext2" || fs == "ext3" || fs == "ext4") config.boot.supportedFilesystems;
in
{
config = {
system.fsPackages = lib.mkIf (config.boot.initrd.systemd.enable -> inInitrd) [ pkgs.e2fsprogs ];
system.fsPackages = lib.mkIf (config.boot.initrd.systemd.enable -> (inInitrd || inSystem)) [ pkgs.e2fsprogs ];
# As of kernel 4.3, there is no separate ext3 driver (they're also handled by ext4.ko)
boot.initrd.availableKernelModules = lib.mkIf (config.boot.initrd.systemd.enable -> inInitrd) [ "ext2" "ext4" ];

View File

@ -26,8 +26,9 @@ let
powerManagement.resumeCommands = "systemctl --no-block restart backdoor.service";
fileSystems = {
"/".device = "/dev/vda2";
fileSystems."/" = {
device = "/dev/vda2";
fsType = "ext3";
};
swapDevices = mkOverride 0 [ { device = "/dev/vda1"; } ];
boot.resumeDevice = mkIf systemdStage1 "/dev/vda1";