# No point trying to support resume, if no swap partition exist
[[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in "${host_fs_types[@]}"; do
[[ $fs =~ ^(swap|swsuspend|swsupend)$ ]] && return 0
for dev in "${!host_fs_types[@]}"; do
[[ ${host_fs_types[$dev]} =~ ^(swap|swsuspend|swsupend)$ ]] || continue
_resume=$(shorten_persistent_dev "$(get_persistent_dev "$dev")")
[[ -n ${_resume} ]] && printf " resume=%s" "${_resume}"
if [[ $hostonly_cmdline == "yes" ]]; then
local _resumeconf=$(cmdline)
[[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf"
# if systemd is included and has the hibernate-resume tool, use it and nothing else
if dracut_module_included "systemd" && [[ -x $systemdutildir/systemd-hibernate-resume ]]; then
$systemdutildir/system-generators/systemd-hibernate-resume-generator \
$systemdsystemunitdir/systemd-hibernate-resume@.service \
$systemdutildir/systemd-hibernate-resume
# Optional uswsusp support
for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib/uswsusp/resume
inst "${_bin}" /usr/sbin/resume
[[ $hostonly ]] && [[ -f /etc/suspend.conf ]] && inst -H /etc/suspend.conf
if ! dracut_module_included "systemd"; then
inst_hook cmdline 10 "$moddir/parse-resume.sh"
inst_script "$moddir/parse-resume.sh" /lib/dracut/parse-resume.sh
inst_script "$moddir/resume.sh" /lib/dracut/resume.sh