Package: hibernate
Version: 1.91-2
Severity: normal
Tags: patch

This patch adds support for mkinitramfs to create initrd's that allow
resuming.  Suspending is rather useless if you cannot resume...

The scripts are taken from
http://wiki.suspend2.net/DistroAndHardwareSetup/Ubuntu_Breezy_Badger and
slightly modified.

As stated in bug 320617, this might go better in a kernel-patch-suspend2
or linux-patch-suspend2 package.  But these packages seem to be badly
out of date which is why I am submitting this here.

You still need to compile in support for lzf compression for this to
work.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-rc4-k8-turion
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages hibernate depends on:
ii  console-tools              1:0.2.3dbs-62 Linux console and font utilities

Versions of packages hibernate recommends:
ii  hdparm                        6.6-1      tune hard disk parameters for high
pn  vlock                         <none>     (no description available)

-- no debconf information
diff -ruN hibernate-1.91.orig/debian/hibernate.dirs 
hibernate-1.91.new/debian/hibernate.dirs
--- hibernate-1.91.orig/debian/hibernate.dirs   2006-06-06 22:19:41.000000000 
-0500
+++ hibernate-1.91.new/debian/hibernate.dirs    2006-06-06 22:03:54.000000000 
-0500
@@ -1,2 +1,4 @@
 etc/hibernate/scriptlets.d
+etc/mkinitramfs/hooks
+etc/mkinitramfs/scripts/local-premount
 usr/share/hibernate/examples
diff -ruN hibernate-1.91.orig/debian/hibernate.install 
hibernate-1.91.new/debian/hibernate.install
--- hibernate-1.91.orig/debian/hibernate.install        2006-06-06 
22:19:41.000000000 -0500
+++ hibernate-1.91.new/debian/hibernate.install 2006-06-06 22:19:07.000000000 
-0500
@@ -6,3 +6,4 @@
 common.conf                    /etc/hibernate/
 blacklisted-modules            /etc/hibernate/
 scriptlets.d/                  /usr/share/hibernate/
+mkinitramfs/                   /etc/
diff -ruN hibernate-1.91.orig/mkinitramfs/hooks/suspend2 
hibernate-1.91.new/mkinitramfs/hooks/suspend2
--- hibernate-1.91.orig/mkinitramfs/hooks/suspend2      1969-12-31 
18:00:00.000000000 -0600
+++ hibernate-1.91.new/mkinitramfs/hooks/suspend2       2006-06-06 
22:17:08.000000000 -0500
@@ -0,0 +1,23 @@
+#!/bin/sh
+PREREQ=""
+
+prereqs()
+{
+        echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+        prereqs
+        exit 0
+        ;;
+esac
+
+. /usr/share/initramfs-tools/hook-functions
+
+if [ -x /usr/sbin/suspend2ui_text ];
+then
+        mkdir --parents ${DESTDIR}/usr/sbin 2>/dev/null || true
+        copy_exec /usr/sbin/suspend2ui_text usr/sbin
+fi
diff -ruN hibernate-1.91.orig/mkinitramfs/scripts/local-premount/suspend2 
hibernate-1.91.new/mkinitramfs/scripts/local-premount/suspend2
--- hibernate-1.91.orig/mkinitramfs/scripts/local-premount/suspend2     
1969-12-31 18:00:00.000000000 -0600
+++ hibernate-1.91.new/mkinitramfs/scripts/local-premount/suspend2      
2006-06-06 22:17:31.000000000 -0500
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+PREREQ=""
+
+prereqs()
+{
+        echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+        prereqs
+        exit 0
+        ;;
+esac
+
+if [ -d /proc/suspend2 ]; then
+  echo > /proc/suspend2/do_resume
+elif [ -d /proc/software_suspend ]; then
+  echo > /proc/software_suspend/do_resume
+fi

Reply via email to