summaryrefslogtreecommitdiffstats
path: root/hooks/resume
blob: a5dee6efd514014a283fec0a3d78e619bf32d45f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# vim:set ft=sh:
# TODO encrypted swap partition if resume2 begins with 'swap:'
run_hook ()
{
    fmtdevice () { echo "${1}:${2}"; }
    if [ -e "/sys/power/resume" -a -e "${resume}" ]; then
        dev_t=$( /bin/parseblock "${resume}" )
        fmtdevice ${dev_t} > /sys/power/resume
    fi
    if [ -e "/proc/suspend2" -a "x${resume2}" != "x" ]; then
        echo ${resume2} > /proc/suspend2/resume2
        echo "" > /proc/suspend2/do_resume
    fi
}