summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-1-init.sh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-05-11 17:32:53 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-22 12:24:06 +0200
commit0ab320a884f93fb98939a3f0ccc5ce8bd9d25da9 (patch)
tree6e25b120678cfb4097a9d4baf2737245054dede3 /nixos/modules/system/boot/stage-1-init.sh
parentec82157ac5b36560c7edae4acfe47edb57133991 (diff)
downloadnixlib-0ab320a884f93fb98939a3f0ccc5ce8bd9d25da9.tar
nixlib-0ab320a884f93fb98939a3f0ccc5ce8bd9d25da9.tar.gz
nixlib-0ab320a884f93fb98939a3f0ccc5ce8bd9d25da9.tar.bz2
nixlib-0ab320a884f93fb98939a3f0ccc5ce8bd9d25da9.tar.lz
nixlib-0ab320a884f93fb98939a3f0ccc5ce8bd9d25da9.tar.xz
nixlib-0ab320a884f93fb98939a3f0ccc5ce8bd9d25da9.tar.zst
nixlib-0ab320a884f93fb98939a3f0ccc5ce8bd9d25da9.zip
stage-1: Shut up warnings about swap devices that don't exist yet
(cherry picked from commit 388dac478d21b743946362294043b83da4852721)
Diffstat (limited to 'nixos/modules/system/boot/stage-1-init.sh')
-rw-r--r--nixos/modules/system/boot/stage-1-init.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh
index e8d276920a83..26cf7f06c9ed 100644
--- a/nixos/modules/system/boot/stage-1-init.sh
+++ b/nixos/modules/system/boot/stage-1-init.sh
@@ -182,9 +182,9 @@ if test -e /sys/power/resume -a -e /sys/power/disk; then
         for sd in @resumeDevices@; do
             # Try to detect resume device. According to Ubuntu bug:
             # https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/923326/comments/1
-            # When there are multiple swap devices, we can't know where will hibernate
-            # image reside. We can check all of them for swsuspend blkid.
-            resumeInfo="$(udevadm info -q property "$sd" )"
+            # when there are multiple swap devices, we can't know where the hibernate
+            # image will reside. We can check all of them for swsuspend blkid.
+            resumeInfo="$(test -e "$d" && udevadm info -q property "$sd")"
             if [ "$(echo "$resumeInfo" | sed -n 's/^ID_FS_TYPE=//p')" = "swsuspend" ]; then
                 resumeDev="$sd"
                 break