]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
resume: do not include in hostonly, if no swap is present
authorHarald Hoyer <harald@redhat.com>
Thu, 18 Jul 2013 12:41:31 +0000 (14:41 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 18 Jul 2013 12:41:31 +0000 (14:41 +0200)
modules.d/95resume/module-setup.sh

index 2f647931ee58464731c047c0382e624f88e1753c..7f810499fb46d1a9fdbb407769b0d39e08d20c26 100755 (executable)
@@ -2,6 +2,18 @@
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 
+check() {
+    # No point trying to support resume, if no swap partition exist
+    [[ $hostonly ]] || [[ $mount_needs ]] && {
+        for fs in "${host_fs_types[@]}"; do
+            [[ $fs = swap ]] && return 0
+        done
+        return 255
+    }
+
+    return 0
+}
+
 install() {
     local _bin
     # Optional uswsusp support