5 # No point trying to support resume, if no swap partition exist
6 [[ $hostonly ]] ||
[[ $mount_needs ]] && {
7 for fs
in "${host_fs_types[@]}"; do
8 [[ $fs =~ ^
(swap|swsuspend|swsupend
)$
]] && return 0
20 for dev
in "${!host_fs_types[@]}"; do
21 [[ ${host_fs_types[$dev]} =~ ^
(swap|swsuspend|swsupend
)$
]] ||
continue
22 _resume
=$
(shorten_persistent_dev
"$(get_persistent_dev "$dev")")
23 [[ -n ${_resume} ]] && printf " resume=%s" "${_resume}"
31 if [[ $hostonly_cmdline == "yes" ]]; then
32 local _resumeconf
=$
(cmdline
)
33 [[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf"
36 # if systemd is included and has the hibernate-resume tool, use it and nothing else
37 if dracut_module_included
"systemd" && [[ -x $dracutsysrootdir$systemdutildir/systemd-hibernate-resume
]]; then
39 $systemdutildir/system-generators
/systemd-hibernate-resume-generator \
40 $systemdsystemunitdir/systemd-hibernate-resume@.service \
41 $systemdutildir/systemd-hibernate-resume
45 # Optional uswsusp support
46 for _bin
in /usr
/sbin
/resume
/usr
/lib
/suspend
/resume
/usr
/lib
/uswsusp
/resume
48 [[ -x "$dracutsysrootdir${_bin}" ]] && {
49 inst
"${_bin}" /usr
/sbin
/resume
50 [[ $hostonly ]] && [[ -f $dracutsysrootdir/etc
/suspend.conf
]] && inst
-H /etc
/suspend.conf
55 if ! dracut_module_included
"systemd"; then
56 inst_hook cmdline
10 "$moddir/parse-resume.sh"
58 inst_script
"$moddir/parse-resume.sh" /lib
/dracut
/parse-resume.sh
61 inst_script
"$moddir/resume.sh" /lib
/dracut
/resume.sh