mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-09-11 15:08:33 +01:00
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.
This commit is contained in:
parent
e80b22369d
commit
a63ca1bf3d
|
@ -198,9 +198,10 @@ let
|
||||||
preLVMCommands preDeviceCommands postDeviceCommands postMountCommands preFailCommands kernelModules;
|
preLVMCommands preDeviceCommands postDeviceCommands postMountCommands preFailCommands kernelModules;
|
||||||
|
|
||||||
resumeDevices = map (sd: if sd ? device then sd.device else "/dev/disk/by-label/${sd.label}")
|
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
|
(filter (sd: hasPrefix "/dev/" sd.device && !sd.randomEncryption
|
||||||
# Don't include zram devices
|
# Don't include zram devices
|
||||||
&& !(hasPrefix "/dev/zram" sd.device)) config.swapDevices);
|
&& !(hasPrefix "/dev/zram" sd.device)
|
||||||
|
) config.swapDevices);
|
||||||
|
|
||||||
fsInfo =
|
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) ];
|
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) ];
|
||||||
|
|
Loading…
Reference in a new issue