diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2019-02-05 00:04:25 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-02-05 02:19:07 +0000 |
commit | 49139ca2c372b28c37773154c2fbbf2b3811ad46 (patch) | |
tree | 7458b1e744dfce7dd20f6e6d569483b272a66d87 /scripts | |
parent | 2e5e389adac846f3c791b7046909471f9a9ad28b (diff) |
scripts/local-premount/resume: Report when we are resuming
Resuming can be quite slow on a hard drive, and if plymouth is used
then the output of /bin/resume won't be seen. Show a message in
plymouth, then hide it if /bin/resume returns. Roughly based on a
patch by Mario Limonciello.
Thanks: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/local-premount/resume | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 88abd86..bf23baf 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -26,9 +26,26 @@ if ! local_device_setup "${resume}" "suspend/resume device" false; then exit 0 fi +use_plymouth=false +if command -v plymouth >/dev/null && plymouth --ping; then + use_plymouth=true + plymouth display-message --text="Resuming from hibernation" + + # The above command does not wait for a framebuffer update to + # complete, so the kernel can freeze the framebuffer before + # the message is even visible. Wait just a moment to make + # that less likely. + sleep 0.1 +fi + # hardcode path, uswsusp ships an resume binary too if [ -n "${resume_offset?}" ]; then /bin/resume "${DEV}" "${resume_offset}" else /bin/resume "${DEV}" fi + +if "$use_plymouth"; then + # plymouth hide-message does not work yet + plymouth display-message --text="" +fi |