Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../lib/dracut/modules..../95resume
File: module-setup.sh
#!/bin/bash
[0] Fix | Delete
[1] Fix | Delete
# called by dracut
[2] Fix | Delete
check() {
[3] Fix | Delete
# No point trying to support resume, if no swap partition exist
[4] Fix | Delete
[[ $hostonly ]] || [[ $mount_needs ]] && {
[5] Fix | Delete
for fs in "${host_fs_types[@]}"; do
[6] Fix | Delete
[[ $fs =~ ^(swap|swsuspend|swsupend)$ ]] && return 0
[7] Fix | Delete
done
[8] Fix | Delete
return 255
[9] Fix | Delete
}
[10] Fix | Delete
[11] Fix | Delete
return 0
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
# called by dracut
[15] Fix | Delete
cmdline() {
[16] Fix | Delete
local _resume
[17] Fix | Delete
[18] Fix | Delete
for dev in "${!host_fs_types[@]}"; do
[19] Fix | Delete
[[ ${host_fs_types[$dev]} =~ ^(swap|swsuspend|swsupend)$ ]] || continue
[20] Fix | Delete
_resume=$(shorten_persistent_dev "$(get_persistent_dev "$dev")")
[21] Fix | Delete
[[ -n ${_resume} ]] && printf " resume=%s" "${_resume}"
[22] Fix | Delete
done
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
# called by dracut
[26] Fix | Delete
install() {
[27] Fix | Delete
local _bin
[28] Fix | Delete
[29] Fix | Delete
if [[ $hostonly_cmdline == "yes" ]]; then
[30] Fix | Delete
local _resumeconf=$(cmdline)
[31] Fix | Delete
[[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf"
[32] Fix | Delete
fi
[33] Fix | Delete
[34] Fix | Delete
# if systemd is included and has the hibernate-resume tool, use it and nothing else
[35] Fix | Delete
if dracut_module_included "systemd" && [[ -x $systemdutildir/systemd-hibernate-resume ]]; then
[36] Fix | Delete
inst_multiple -o \
[37] Fix | Delete
$systemdutildir/system-generators/systemd-hibernate-resume-generator \
[38] Fix | Delete
$systemdsystemunitdir/systemd-hibernate-resume@.service \
[39] Fix | Delete
$systemdutildir/systemd-hibernate-resume
[40] Fix | Delete
return 0
[41] Fix | Delete
fi
[42] Fix | Delete
[43] Fix | Delete
# Optional uswsusp support
[44] Fix | Delete
for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib/uswsusp/resume
[45] Fix | Delete
do
[46] Fix | Delete
[[ -x "${_bin}" ]] && {
[47] Fix | Delete
inst "${_bin}" /usr/sbin/resume
[48] Fix | Delete
[[ $hostonly ]] && [[ -f /etc/suspend.conf ]] && inst -H /etc/suspend.conf
[49] Fix | Delete
break
[50] Fix | Delete
}
[51] Fix | Delete
done
[52] Fix | Delete
[53] Fix | Delete
if ! dracut_module_included "systemd"; then
[54] Fix | Delete
inst_hook cmdline 10 "$moddir/parse-resume.sh"
[55] Fix | Delete
else
[56] Fix | Delete
inst_script "$moddir/parse-resume.sh" /lib/dracut/parse-resume.sh
[57] Fix | Delete
fi
[58] Fix | Delete
[59] Fix | Delete
inst_script "$moddir/resume.sh" /lib/dracut/resume.sh
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
[63] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function