Debian Codegraph @

scripts/local-premount/resume

raw
1 #!/bin/sh
2
3 PREREQ=""
4
5 prereqs()
6 {
7 echo "$PREREQ"
8 }
9
10 case $1 in
11 # get pre-requisites
12 prereqs)
13 prereqs
14 exit 0
15 ;;
16 esac
17
18 if [ -z "${resume?}" ] || [ ! -e /sys/power/resume ]; then
19 exit 0
20 fi
21
22 . /scripts/functions
23 . /scripts/local
24
25 if ! local_device_setup "${resume}" "suspend/resume device" false; then
26 exit 0
27 fi
28
29 if [ "$(get_fstype "${DEV}")" = suspend ] &&
30 command -v plymouth >/dev/null &&
31 plymouth --ping; then
32 plymouth display-message --text="Resuming from hibernation"
33
34 # The above command does not wait for a framebuffer update to
35 # complete, so the kernel can freeze the framebuffer before
36 # the message is even visible. Wait just a moment to make
37 # that less likely.
38 sleep 0.1
39 fi
40
41 # hardcode path, uswsusp ships an resume binary too
42 if [ -n "${resume_offset?}" ]; then
43 /bin/resume "${DEV}" "${resume_offset}"
44 else
45 /bin/resume "${DEV}"
46 fi