]> git.ipfire.org Git - thirdparty/dracut.git/blobdiff - modules.d/95resume/module-setup.sh
Enable resume module if hibernation's enabled on the host
[thirdparty/dracut.git] / modules.d / 95resume / module-setup.sh
index 6ddc7259b623d571eaf43724392a2f3fce72d444..cb06b567d3e35cd1fbcd6c8219b0ce640504c591 100755 (executable)
@@ -2,12 +2,9 @@
 
 # called by dracut
 check() {
-    # No point trying to support resume, if no swap partition exist
+    # Only support resume if hibernation is currently on
     [[ $hostonly ]] || [[ $mount_needs ]] && {
-        for fs in "${host_fs_types[@]}"; do
-            [[ $fs =~ ^(swap|swsuspend|swsupend)$ ]] && return 0
-        done
-        return 255
+        [[ "$(cat /sys/power/resume)" == "0:0" ]] && return 255
     }
 
     return 0