From: Harald Hoyer Date: Thu, 18 Jul 2013 12:41:31 +0000 (+0200) Subject: resume: do not include in hostonly, if no swap is present X-Git-Tag: 031~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=34b56de12aad622d602d6e3bd434e02c840f1cd0;p=thirdparty%2Fdracut.git resume: do not include in hostonly, if no swap is present --- diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh index 2f647931e..7f810499f 100755 --- a/modules.d/95resume/module-setup.sh +++ b/modules.d/95resume/module-setup.sh @@ -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