nixos: check resumeDevice is absolute path and document

Fixes #5219 after merging #4995.

(cherry picked from commit 0681d61c37)
Signed-off-by: Domen Kožar <domen@dev.si>
This commit is contained in:
Vladimír Čunát 2014-12-10 11:49:25 +01:00 committed by Domen Kožar
parent 8bb494c170
commit 3bcd3ed017

View file

@ -240,8 +240,9 @@ in
example = "/dev/sda3";
description = ''
Device for manual resume attempt during boot. This should be used primarily
if you want to resume from file. Specify here the device where the file
resides. You should also use <varname>boot.kernelParams</varname> to specify
if you want to resume from file. If left empty, the swap partitions are used.
Specify here the device where the file resides.
You should also use <varname>boot.kernelParams</varname> to specify
<literal><replaceable>resume_offset</replaceable></literal>.
'';
};
@ -355,10 +356,17 @@ in
config = mkIf (!config.boot.isContainer) {
assertions = singleton
assertions = [
{ assertion = any (fs: fs.mountPoint == "/") (attrValues config.fileSystems);
message = "The fileSystems option does not specify your root file system.";
};
}
{ assertion = let inherit (config.boot) resumeDevice; in
resumeDevice == "" || builtins.substring 0 1 resumeDevice == "/";
message = "boot.resumeDevice has to be an absolute path."
+ " Old \"x:y\" style is no longer supported.";
}
];
system.build.bootStage1 = bootStage1;
system.build.initialRamdisk = initialRamdisk;