From: nabijaczleweli Date: Fri, 13 Dec 2019 06:59:59 +0000 (+0100) Subject: Enable resume module if hibernation's enabled on the host X-Git-Tag: 050~9 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fdracut.git;a=commitdiff_plain;h=38c8fed48afb0e0b99ca85f137324df2c4bd05f3 Enable resume module if hibernation's enabled on the host Ref: https://github.com/dracutdevs/dracut/commit/34b56de12aad622d602d6e3bd434e02c840f1cd0 Fixes https://github.com/dracutdevs/dracut/issues/496 --- diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh index 6ddc7259b..cb06b567d 100755 --- a/modules.d/95resume/module-setup.sh +++ b/modules.d/95resume/module-setup.sh @@ -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