From a63ca1bf3de482e6cb0cf0e3ce55ececc608b04b Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sat, 24 Sep 2016 13:06:27 +0300 Subject: [PATCH] stage-1 module: remove check that swap device has a label All swap device option sets "have" a label, it's just that sometimes it's undefined. Because we set a `device` attribute when we have a label anyway it's ok to just check device prefix. Fixes #18891. --- nixos/modules/system/boot/stage-1.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index 513c121347b1..40e67fa5f8d2 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -198,9 +198,10 @@ let preLVMCommands preDeviceCommands postDeviceCommands postMountCommands preFailCommands kernelModules; resumeDevices = map (sd: if sd ? device then sd.device else "/dev/disk/by-label/${sd.label}") - (filter (sd: (sd ? label || hasPrefix "/dev/" sd.device) && !sd.randomEncryption - # Don't include zram devices - && !(hasPrefix "/dev/zram" sd.device)) config.swapDevices); + (filter (sd: hasPrefix "/dev/" sd.device && !sd.randomEncryption + # Don't include zram devices + && !(hasPrefix "/dev/zram" sd.device) + ) config.swapDevices); fsInfo = let f = fs: [ fs.mountPoint (if fs.device != null then fs.device else "/dev/disk/by-label/${fs.label}") fs.fsType (builtins.concatStringsSep "," fs.options) ];