Enable resume module if hibernation's enabled on the host

Ref: 34b56de12a
Fixes https://github.com/dracutdevs/dracut/issues/496
master
nabijaczleweli 2019-12-13 07:59:59 +01:00 committed by Daniel Molkentin
parent c7403700df
commit 38c8fed48a
1 changed files with 2 additions and 5 deletions

View File

@ -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