[Pm-utils] pm-utls version

Victor Lowther victor.lowther at gmail.com
Mon Feb 11 14:47:29 PST 2008


On Mon, Feb 11, 2008 at 11:03:41PM +0100, Michael Biebl wrote:
> 2008/2/11, Richard Hughes <hughsient at gmail.com>:
> > Okay, I would like to make a release some time soon. The version number
> > of pm-utils is currently 0.99.4
> >
> > I feel we've done so much work, and changed the internals enough to
> > declare a 1.1.0 release - i.e. still unstable, but > 1.0.0.
> >
> > Comments?
> 
> I'd like to work on the uswsusp support and fix some outstanding
> issues with PMU support.

Well, adding basic uswsusp support should be dead simple now -- I
whacked up a 30 line file that is completly untested (due to not using
uswsusp on my primary machine).

 pm/module.d/Makefile.am |    3 ++-
 pm/module.d/uswsusp     |   30 ++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletions(-)
 create mode 100644 pm/module.d/uswsusp

diff --git a/pm/module.d/Makefile.am b/pm/module.d/Makefile.am
index 6efd24d..0f8add5 100644
--- a/pm/module.d/Makefile.am
+++ b/pm/module.d/Makefile.am
@@ -2,7 +2,8 @@ moduledir = $(libdir)/pm-utils/module.d
 
 dist_module_SCRIPTS =	\
 	kernel		\
-	tuxonice
+	tuxonice	\
+	uswsusp
 
 clean-local :
 	rm -f *~
diff --git a/pm/module.d/uswsusp b/pm/module.d/uswsusp
new file mode 100644
index 0000000..8c0d4a4
--- /dev/null
+++ b/pm/module.d/uswsusp
@@ -0,0 +1,30 @@
+check_suspend() {
+	grep -q mem /sys/power/state && command_exists s2ram
+}
+
+do_suspend()
+{
+        s2ram -f
+}
+
+check_hibernate() {
+	[ -f /sys/power/disk ] && \
+	grep -q disk /sys/power/state && \
+	command_exists s2disk	
+}
+
+do_hibernate()
+{
+	s2disk
+}
+
+check_suspend_hybrid() {
+	grep -q mem /sys/power/state && \
+	command_exists s2both && \
+	check_hibernate
+}
+
+do_suspend_hybrid()
+{
+        s2both -f
+}

PMU support is rather outside my scope -- the only powerpc-based machine
I had was stolen three years ago (and I am still bitter about it).

-- 
Victor Lowther
Ubuntu Certified Professional


More information about the Pm-utils mailing list