about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 17:28:12 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 18:47:43 +0100
commitd882e1966251880240599d3c1b31e060661506ee (patch)
tree340ce1356d65960a16b29040ac270953accbfc9d /nixos
parentbe5d3a59dd3684ffabf456728938ed0f6f3df59c (diff)
downloadnixlib-d882e1966251880240599d3c1b31e060661506ee.tar
nixlib-d882e1966251880240599d3c1b31e060661506ee.tar.gz
nixlib-d882e1966251880240599d3c1b31e060661506ee.tar.bz2
nixlib-d882e1966251880240599d3c1b31e060661506ee.tar.lz
nixlib-d882e1966251880240599d3c1b31e060661506ee.tar.xz
nixlib-d882e1966251880240599d3c1b31e060661506ee.tar.zst
nixlib-d882e1966251880240599d3c1b31e060661506ee.zip
Shut up "failed to resume" warning if there is no resume device
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/stage-1-init.sh2
-rw-r--r--nixos/modules/system/boot/stage-1.nix14
2 files changed, 9 insertions, 7 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh
index e3e07c085808..1f65026b5def 100644
--- a/nixos/modules/system/boot/stage-1-init.sh
+++ b/nixos/modules/system/boot/stage-1-init.sh
@@ -168,7 +168,7 @@ if test -e /sys/power/tuxonice/resume; then
     fi
 fi
 
-if test -e /sys/power/resume -a -e /sys/power/disk; then
+if test -n "@resumeDevice@" -a -e /sys/power/resume -a -e /sys/power/disk; then
     echo "@resumeDevice@" > /sys/power/resume 2> /dev/null || echo "failed to resume..."
     echo shutdown > /sys/power/disk
 fi
diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix
index 3836d639513e..71dc29feb2a8 100644
--- a/nixos/modules/system/boot/stage-1.nix
+++ b/nixos/modules/system/boot/stage-1.nix
@@ -229,12 +229,14 @@ in
   options = {
 
     boot.resumeDevice = mkOption {
-      default = "";
-      example = "0:0";
-      description = "
-        Device for manual resume attempt during boot. Looks like
-        major:minor. ls -l /dev/SWAP_PARTION shows them.
-      ";
+      type = types.nullOr types.str;
+      default = null;
+      example = "8:2";
+      description = ''
+        Device for manual resume attempt during boot, specified using
+        the device's major and minor number as
+        <literal><replaceable>major</replaceable>:<replaceable>minor</replaceable></literal>.
+      '';
     };
 
     boot.initrd.checkJournalingFS = mkOption {