From 3bcd3ed0178f8de1a8bdd9eaaeeaa513ae9c3c02 Mon Sep 17 00:00:00 2001 From: Vladimír Čunát Date: Wed, 10 Dec 2014 11:49:25 +0100 Subject: nixos: check resumeDevice is absolute path and document MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #5219 after merging #4995. (cherry picked from commit 0681d61c3730c686548df3af9a7dc1a59abaf371) Signed-off-by: Domen Kožar --- nixos/modules/system/boot/stage-1.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index cf2114046498..cd30ce1b7cef 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -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 boot.kernelParams 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 boot.kernelParams to specify resume_offset. ''; }; @@ -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; -- cgit 1.4.1