summaryrefslogtreecommitdiff
path: root/modules.d
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-07-18 14:41:31 +0200
committerHarald Hoyer <harald@redhat.com>2013-07-18 14:41:31 +0200
commit34b56de12aad622d602d6e3bd434e02c840f1cd0 (patch)
tree9adca2239d01fa892db96e3af9917d739e2e1263 /modules.d
parent951cedf8cb2228dc3064d5fde727543d96d23e5b (diff)
downloaddracut-34b56de12aad622d602d6e3bd434e02c840f1cd0.tar.gz
dracut-34b56de12aad622d602d6e3bd434e02c840f1cd0.tar.bz2
dracut-34b56de12aad622d602d6e3bd434e02c840f1cd0.zip
resume: do not include in hostonly, if no swap is present
Diffstat (limited to 'modules.d')
-rwxr-xr-xmodules.d/95resume/module-setup.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
index 2f647931..7f810499 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