[Lunar-commits] <moonbase> libx86, uswsusp: Add new modules adding support for hybrid suspend.

Jannis Pohlmann jannis at xfce.org
Tue Jun 30 14:40:27 CEST 2009


commit 1b61ebab31b8eec7739991fd6deb38908d3acdc2
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Tue Jun 30 14:40:27 2009 +0200

    libx86, uswsusp: Add new modules adding support for hybrid suspend.
---
 kernel/uswsusp/BUILD     |    7 +++++++
 kernel/uswsusp/CONFIGURE |   43 +++++++++++++++++++++++++++++++++++++++++++
 kernel/uswsusp/DEPENDS   |    1 +
 kernel/uswsusp/DETAILS   |   45 +++++++++++++++++++++++++++++++++++++++++++++
 libs/libx86/DETAILS      |   17 +++++++++++++++++
 5 files changed, 113 insertions(+), 0 deletions(-)

diff --git a/kernel/uswsusp/BUILD b/kernel/uswsusp/BUILD
new file mode 100644
index 0000000..1e0e0f4
--- /dev/null
+++ b/kernel/uswsusp/BUILD
@@ -0,0 +1,7 @@
+(
+
+  sedit "s at resume device = .*@resume device = $HIBERNATE_PARTITION at g" conf/suspend.conf &&
+
+  default_build
+
+) > $C_FIFO 2>&1 
diff --git a/kernel/uswsusp/CONFIGURE b/kernel/uswsusp/CONFIGURE
new file mode 100644
index 0000000..755197f
--- /dev/null
+++ b/kernel/uswsusp/CONFIGURE
@@ -0,0 +1,43 @@
+select_partition()
+{
+  # Determine active swap partitions
+  SWAPS=`swapon -s | grep '^\/' | cut -d' ' -f1`
+
+  # Build items for the radio buttons
+  ITEMS=""
+  for SWAP in $SWAPS; do
+    ITEMS="$ITEMS $SWAP $SWAP $SWAP"
+  done
+  
+  # Define strings
+  BACKTITLE="Userspace Software Suspend"
+  TITLE="Select resume partition"
+  HELP="Select a partition to resume from after hibernate (s2disk or s2both)"
+
+  # Ask the user to select one of the partitions
+  echo $ITEMS | xargs \
+    dialog --backtitle "$BACKTITLE" \
+           --title     "$TITLE"     \
+           --stdout                 \
+           --radiolist "$HELP"      \
+           0 0 0
+}
+
+download_module uswsusp &&
+
+if ! grep -q CONFIGURED $MODULE_CONFIG; then
+  while [ -z "$PARTITION" ]; do
+    PARTITION=`select_partition`
+    if [[ "$?" != "0" ]]; then
+      echo
+      message "${PROBLEM_COLOR}You need to define a resume partition${DEFAULT_COLOR}!"
+      exit 1
+    fi
+  done
+
+  TEMP=`grep -v "HIBERNATE_PARTITION="         $MODULE_CONFIG`
+  echo "$TEMP"                               > $MODULE_CONFIG 
+  echo "HIBERNATE_PARTITION=\"$PARTITION\"" >> $MODULE_CONFIG
+
+  OPTS="$OPTS --with-resume-device=$PARTITION"
+fi
diff --git a/kernel/uswsusp/DEPENDS b/kernel/uswsusp/DEPENDS
new file mode 100644
index 0000000..938e383
--- /dev/null
+++ b/kernel/uswsusp/DEPENDS
@@ -0,0 +1 @@
+depends libx86
diff --git a/kernel/uswsusp/DETAILS b/kernel/uswsusp/DETAILS
new file mode 100644
index 0000000..0907c6f
--- /dev/null
+++ b/kernel/uswsusp/DETAILS
@@ -0,0 +1,45 @@
+          MODULE=uswsusp
+         VERSION=0.8
+          SOURCE=suspend-$VERSION.tar.gz
+SOURCE_DIRECTORY=$BUILD_DIRECTORY/suspend-$VERSION
+      SOURCE_URL=$SFORGE_URL/suspend/
+        WEB_SITE=http://suspend.sf.net
+         ENTERED=20090630
+         UPDATED=20090630
+           SHORT="Userspace Software Suspend"
+
+cat << EOF
+The goal of the project is to create a tool that can handle the so 
+called "suspend-to-both". Suspend to both means that prior putting the
+system in STR (suspend to ram) a snapshot of the running system is 
+taken and stored on disk (as suspend to disk); if for any reason (e.g.
+battery depleted) the state store in the RAM is lost the user can 
+resume from the disk without loosing data.
+
+Currenty suspend-to-ram and suspend-to-disk are handled by two 
+different program, s2ram and s2disk.
+
+s2ram is a wrapper around the kernel's suspend-to-RAM mechanism 
+allowing the user to perform some graphics adapter manipulations from
+the user land before suspending and after resuming that may help to 
+bring the graphics (and the entire system) back to life after the 
+resume. Incorporates the functionality of vbetool and radeontool as 
+well as some tricks of its own. Includes a list of working hardware 
+configurations along with the appropriate sets of operations to be 
+performed to resume them successfully.
+
+s2disk is the reference implementation of the userspace software 
+suspend (µswsusp); it coordinates the steps necessary to suspend the
+system (such as freezing the processes, preparing the swap space, 
+etc.) and handles image writing and reading. s2disk already supports
+compression and encryption of the image and other features (e.g. a 
+nice progress bar, saving the image on a remote disk, playing tetris
+while resuming, etc.) can be easily added.
+
+s2both combines the funtionalities of s2ram and s2disk and it's 
+very useful when the battery is almost depleted. s2both write 
+system snapshot to the swap (just like s2disk) but then put the 
+machine into STR (just like s2ram). If the battery has enough power
+left you can quickly resume from STR, otherwise you can still resume
+from disk without loosing your work. 
+EOF
diff --git a/libs/libx86/DETAILS b/libs/libx86/DETAILS
new file mode 100644
index 0000000..3322469
--- /dev/null
+++ b/libs/libx86/DETAILS
@@ -0,0 +1,17 @@
+      MODULE=libx86
+     VERSION=1.1
+      SOURCE=$MODULE-$VERSION.tar.gz
+  SOURCE_URL=http://www.codon.org.uk/~mjg59/libx86/downloads/
+    WEB_SITE=http://www.codon.org.uk/~mjg59/libx86/
+     ENTERED=20090630
+     UPDATED=20090630
+       SHORT="Library for executing real-mode x86 code"
+
+cat << EOF
+libx86 - a hardware-independent library for executing real-mode x86
+code. It's often useful to be able to make real-mode x86 BIOS calls 
+from userland. lrmi provides a simple interface to this for x86 
+machines, but this doesn't help on other platforms. libx86 provides
+the lrmi interface, but will also run on platforms such as amd64 and
+alpha. 
+EOF


More information about the Lunar-commits mailing list