summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2009-04-03 13:27:56 -0500
committerVictor Lowther <victor.lowther@gmail.com>2009-04-03 13:27:56 -0500
commit584f08dc12fada69dbe1948a61cfc4b179b40eda (patch)
tree2ec82f2b1e50e097fdf969b8a3992b4e2b11c6d0
parent4755f6754b1a80db775676f7d485da0ee725a0c1 (diff)
Move chvt handling into 99video
This prepares for adding kernel modesetting support.
-rwxr-xr-xpm/module.d/uswsusp1
-rwxr-xr-xpm/sleep.d/90chvt20
-rwxr-xr-xpm/sleep.d/99video22
-rw-r--r--pm/sleep.d/Makefile.am1
4 files changed, 19 insertions, 25 deletions
diff --git a/pm/module.d/uswsusp b/pm/module.d/uswsusp
index b9778af..53f304e 100755
--- a/pm/module.d/uswsusp
+++ b/pm/module.d/uswsusp
@@ -4,7 +4,6 @@
# s2ram and s2disk handle all this stuff internally.
uswsusp_hooks()
{
- disablehook 90chvt "disabled by uswsusp"
disablehook 99video "disabled by uswsusp"
}
diff --git a/pm/sleep.d/90chvt b/pm/sleep.d/90chvt
deleted file mode 100755
index 47a2c85..0000000
--- a/pm/sleep.d/90chvt
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-# Ensure we eare in text mode by switching to an unused vt.
-# Also avoids lots of ghastly suspend/resume errors due to trying
-# to suspend/resume while running in X.
-
-. "${PM_FUNCTIONS}"
-
-case "$1" in
- hibernate|suspend)
- fgconsole |savestate console
- chvt 63
- ;;
- thaw|resume)
- state_exists console || exit 1
- chvt $(restorestate console)
- deallocvt 63
- ;;
- *)
- ;;
-esac
diff --git a/pm/sleep.d/99video b/pm/sleep.d/99video
index 1fe54c2..23e56ef 100755
--- a/pm/sleep.d/99video
+++ b/pm/sleep.d/99video
@@ -28,6 +28,7 @@ for opt in $PM_CMDLINE; do
vga-mode3) QUIRK_VGA_MODE_3="true" ;;
no-fb) QUIRK_NOFB="true" ;;
pci-save) QUIRK_PCI_SAVE="true" ;;
+ no-chvt) QUIRK_NO_CHVT="true" ;;
none) QUIRK_NONE="true" ;;
*) continue ;;
esac
@@ -82,6 +83,20 @@ resume_fbcon()
done
}
+maybe_chvt()
+{
+ [ "$QUIRK_NO_CHVT" = "true" ] && return
+ fgconsole |savestate console
+ chvt 63
+}
+
+maybe_deallocvt()
+{
+ state_exists console || return
+ chvt $(restorestate console)
+ deallocvt 63
+}
+
# Some tiny helper functions for quirk handling
quirk() { [ "$1" = "true" ] && [ -z $QUIRK_NONE ]; }
@@ -187,17 +202,18 @@ help() {
}
case "$1" in
- suspend) suspend_video ;;
- hibernate)
+ suspend) maybe_chvt; suspend_video ;;
+ hibernate) maybe_chvt
if [ "$HIBERNATE_RESUME_POST_VIDEO" = "yes" ]; then
suspend_video
fi
;;
- resume) resume_video ;;
+ resume) resume_video; maybe_deallocvt;;
thaw)
if [ "${HIBERNATE_RESUME_POST_VIDEO}" = "yes" ]; then
resume_video
fi
+ maybe_deallocvt
;;
help) help ;;
esac
diff --git a/pm/sleep.d/Makefile.am b/pm/sleep.d/Makefile.am
index 226b66c..b367a17 100644
--- a/pm/sleep.d/Makefile.am
+++ b/pm/sleep.d/Makefile.am
@@ -8,7 +8,6 @@ sleep_SCRIPTS = \
49bluetooth \
55NetworkManager \
75modules \
- 90chvt \
90clock \
94cpufreq \
95led \