diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2014-12-10 11:49:25 +0100 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2014-12-12 11:11:57 +0100 |
commit | 3bcd3ed0178f8de1a8bdd9eaaeeaa513ae9c3c02 (patch) | |
tree | 04746fdc0d7ae15cb3ea923021fe0d70f54d03b0 /nixos | |
parent | 8bb494c1709c6481e82f03b0bca413d578e07ae4 (diff) | |
download | nixlib-3bcd3ed0178f8de1a8bdd9eaaeeaa513ae9c3c02.tar nixlib-3bcd3ed0178f8de1a8bdd9eaaeeaa513ae9c3c02.tar.gz nixlib-3bcd3ed0178f8de1a8bdd9eaaeeaa513ae9c3c02.tar.bz2 nixlib-3bcd3ed0178f8de1a8bdd9eaaeeaa513ae9c3c02.tar.lz nixlib-3bcd3ed0178f8de1a8bdd9eaaeeaa513ae9c3c02.tar.xz nixlib-3bcd3ed0178f8de1a8bdd9eaaeeaa513ae9c3c02.tar.zst nixlib-3bcd3ed0178f8de1a8bdd9eaaeeaa513ae9c3c02.zip |
nixos: check resumeDevice is absolute path and document
Fixes #5219 after merging #4995. (cherry picked from commit 0681d61c3730c686548df3af9a7dc1a59abaf371) Signed-off-by: Domen Kožar <domen@dev.si>
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/system/boot/stage-1.nix | 16 |
1 files changed, 12 insertions, 4 deletions
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 <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; |