Hello community,
here is the log from the commit of package pm-utils
checked in at Mon Apr 28 16:22:27 CEST 2008.
--------
--- pm-utils/pm-utils.changes 2007-11-28 18:47:48.000000000 +0100
+++ /mounts/work_src_done/STABLE/pm-utils/pm-utils.changes 2008-04-28 14:41:25.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Apr 28 14:40:26 CEST 2008 - hmacht@suse.de
+
+- add script 'iwl-pm.sh' to power.d/ for enabling iwl* power
+ management
+
+-------------------------------------------------------------------
New:
----
pm-utils-0.99.3-add-iwl-pm.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ pm-utils.spec ++++++
--- /var/tmp/diff_new_pack.E22505/_old 2008-04-28 16:22:05.000000000 +0200
+++ /var/tmp/diff_new_pack.E22505/_new 2008-04-28 16:22:05.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package pm-utils (Version 0.99.3.20070618)
#
-# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@@ -10,10 +10,11 @@
# norootforbuild
+
Name: pm-utils
Url: http://webcvs.freedesktop.org/pm-utils/
Version: 0.99.3.20070618
-Release: 26
+Release: 51
%define pm_utils_suse_version 20070724
Summary: Tools to suspend and hibernate computers
License: GPL v2 or later
@@ -23,6 +24,7 @@
Patch2: pm-utils-0.99.3-uswsusp-support.diff
Patch3: pm-utils-0.99.3-comment-configfile.diff
Patch4: pm-utils-0.99.3-README-fix.diff
+Patch5: pm-utils-0.99.3-add-iwl-pm.diff
Patch99: pm-utils-0.99.3-suse.diff
Source1: pm-utils-suse-%{pm_utils_suse_version}.tar.bz2
Source2: README.upstream-hooks
@@ -51,6 +53,7 @@
%patch2 -p0
%patch3 -p0
%patch4 -p0
+%patch5 -p0
%patch99 -p0
%build
@@ -67,7 +70,8 @@
cp %{S:2} hooks
cp %{S:3} $RPM_BUILD_ROOT/etc/pm/
cd ../pm-utils-suse
-cp hooks/* $RPM_BUILD_ROOT/usr/lib/pm-utils/sleep.d/
+cp hooks/sleep.d/* $RPM_BUILD_ROOT/usr/lib/pm-utils/sleep.d/
+cp hooks/power.d/* $RPM_BUILD_ROOT/usr/lib/pm-utils/power.d/
mkdir -p $RPM_BUILD_ROOT/var/log/
touch $RPM_BUILD_ROOT/var/log/pm-suspend.log
@@ -86,50 +90,53 @@
%ghost %verify(not md5 size mtime) /var/log/pm-suspend.log
%changelog
-* Wed Nov 28 2007 - lrupp@suse.de
+* Mon Apr 28 2008 hmacht@suse.de
+- add script 'iwl-pm.sh' to power.d/ for enabling iwl* power
+ management
+* Wed Nov 28 2007 lrupp@suse.de
- touch %%ghost file in %%install and add %%verify(not md5 size mtime)
- bzip the source
-* Tue Nov 27 2007 - seife@suse.de
+* Tue Nov 27 2007 seife@suse.de
- add the logfile to the filelist (novell bug 280475)
-* Mon Sep 24 2007 - seife@suse.de
+* Mon Sep 24 2007 seife@suse.de
- add README.update in /etc/pm and fix the README in the documen-
tation to no longer mention /etc/pm/config but the correct paths
(novell bug 327828).
-* Thu Aug 16 2007 - hmacht@suse.de
+* Thu Aug 16 2007 hmacht@suse.de
- remove '-s' option from openvt (00clear hook) to avoid flickering
before suspend to disk
-* Wed Jul 25 2007 - hmacht@suse.de
+* Wed Jul 25 2007 hmacht@suse.de
- do not switch to console and back in pm-utils. Suspend tools are
doing this in any case and splashy looks nicer this way
-* Tue Jul 24 2007 - seife@suse.de
+* Tue Jul 24 2007 seife@suse.de
- update to current CVS:
- our export-variables patch included
- minor build system tweaks
- fix reading of multiple configuration files
- removed docker hook, is now in dockutils
-* Wed Apr 04 2007 - seife@suse.de
+* Wed Apr 04 2007 seife@suse.de
- use long options for s2disk/s2both, short options will be depre-
cated
- fix suspend to disk for HIBERNATE_METHOD=userspace
-* Mon Mar 26 2007 - seife@suse.de
+* Mon Mar 26 2007 seife@suse.de
- update to current CVS (version 0.99.3)
- fix source_configs so it doesn't throw an error when the config
dir is empty.
- rework userspace-suspend support
- fix exporting of variables
-* Tue Mar 20 2007 - seife@suse.de
+* Tue Mar 20 2007 seife@suse.de
- update to current CVS
- module unloading and config handling fix integrated upstream
- pm-utils-suse: be more careful selecting the kernel for resume
(bug 256105)
-* Fri Mar 16 2007 - seife@suse.de
+* Fri Mar 16 2007 seife@suse.de
- fix module unloading, pm-utils-0.99.2-fix-modunload.diff
-* Fri Mar 16 2007 - seife@suse.de
+* Fri Mar 16 2007 seife@suse.de
- update to current CVS
- pm-utils-0.99.2-fix-stopservice.diff integrated upstream
- fix the handling of config files in /etc/pm/config.d/ (they were
simply ignored before)
-* Wed Mar 14 2007 - seife@suse.de
+* Wed Mar 14 2007 seife@suse.de
- update to version 0.99.2+ (CVS as of today)
- move the executables from /etc/pm to /usr/lib/pm-utils
- config file from /etc/pm/config to /usr/lib/pm-utils/defaults
@@ -140,57 +147,57 @@
- use bash for scripts, not sh
- fix module load/unload problems with module names that have
"-" and "_".
-* Wed Feb 28 2007 - seife@suse.de
+* Wed Feb 28 2007 seife@suse.de
- fix cpufreq problem on multicore CPUs after resume (bug 227854)
-* Tue Feb 20 2007 - seife@suse.de
+* Tue Feb 20 2007 seife@suse.de
- update to current CVS
- add pm-reset-swap to reset the swap signature after failed
suspend to disk
- some of our fixed incorporated upstream, patches dropped
- no longer unload the button module, kernel is fixed
-* Sun Feb 18 2007 - seife@suse.de
+* Sun Feb 18 2007 seife@suse.de
- support suspend to swap on LVM/EVMS (or generally if the resume
parameter points to a symlink).
-* Wed Dec 20 2006 - seife@suse.de
+* Wed Dec 20 2006 seife@suse.de
- fix resume problems if the "Failsafe" kernel is listed before
the "good" kernel in /boot/grub/menu.lst (bug 223722)
- package the disabled hooks in the documentation directory
- disable the 49blutetooth hook
-* Tue Dec 05 2006 - seife@suse.de
+* Tue Dec 05 2006 seife@suse.de
- fix 30s2disk-check hook, so that suspend with the kernel method
works again (fixes bug 226115)
-* Thu Nov 30 2006 - seife@suse.de
+* Thu Nov 30 2006 seife@suse.de
- fix on_ac_power on desktops with battery powered mice
(bug 221999)
- make running the hooks slightly more verbose
-* Wed Nov 22 2006 - seife@suse.de
+* Wed Nov 22 2006 seife@suse.de
- fix dualcore cpufreq problem after suspend (bug 223164)
- mark the configfile as "noreplace"
- print "resuming..." during resume
-* Mon Nov 20 2006 - seife@suse.de
+* Mon Nov 20 2006 seife@suse.de
- sync with current CVS, some of our patches went upstream
- print "Preparing suspend..." so the user has some feedback
-* Thu Nov 16 2006 - seife@suse.de
+* Thu Nov 16 2006 seife@suse.de
- comment the available variables in the configuration file
-* Wed Nov 08 2006 - seife@suse.de
+* Wed Nov 08 2006 seife@suse.de
- update to current CVS, some of our fixes incorporated upstream
- increase the logging output of the pm-utils-suse hooks
-* Mon Nov 06 2006 - hmacht@suse.de
+* Mon Nov 06 2006 hmacht@suse.de
- add 23dock hook to undock before suspend and redock after resume
-* Mon Oct 30 2006 - seife@suse.de
+* Mon Oct 30 2006 seife@suse.de
- update to current CVS, some of our fixes incorporated upstream
-* Fri Oct 27 2006 - hmacht@suse.de
+* Fri Oct 27 2006 hmacht@suse.de
- readd lost S2DISK_BIN and S2DISK_CONF variables
-* Tue Oct 24 2006 - hmacht@suse.de
+* Tue Oct 24 2006 hmacht@suse.de
- update to current CVS, some fixes incorporated upstream.
- add logging functionality
- add hook for ejecting pcmcia cards
-* Mon Oct 23 2006 - hmacht@suse.de
+* Mon Oct 23 2006 hmacht@suse.de
- add hook to log lsmod and free
-* Wed Oct 11 2006 - seife@suse.de
+* Wed Oct 11 2006 seife@suse.de
- small fixes, disable not yet ready logging code
-* Tue Oct 10 2006 - seife@suse.de
+* Tue Oct 10 2006 seife@suse.de
- update to current CVS, our fixes incorporated upstream.
- some additional hooks, converted from powersaved.
-* Fri Oct 06 2006 - seife@suse.de
+* Fri Oct 06 2006 seife@suse.de
- initial submission
++++++ pm-utils-0.99.3-add-iwl-pm.diff ++++++
--- pm/defaults
+++ pm/defaults
@@ -21,3 +21,9 @@
# defaults to "autodetect" ("userspace" if s2disk is available, "kernel" otherwise)
# (do not change unless you kow what you are doing)
HIBERNATE_METHOD=""
+
+# IWL power management
+# 6: Radio always on, default AC
+# 7: Default BATTERY level
+# Empty string is meant for not touching any power management features at all
+IWL_PM="7"
++++++ pm-utils-suse-20070724.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-utils-suse/hooks/01logging new/pm-utils-suse/hooks/01logging
--- old/pm-utils-suse/hooks/01logging 2006-10-24 17:44:30.000000000 +0200
+++ new/pm-utils-suse/hooks/01logging 1970-01-01 01:00:00.000000000 +0100
@@ -1,31 +0,0 @@
-#!/bin/bash
-
-case "$1" in
- hibernate|suspend)
- # save the old loglevel
- read KERNEL_LOGLEVEL DUMMY < /proc/sys/kernel/printk
- echo "export KERNEL_LOGLEVEL=$KERNEL_LOGLEVEL" >> /var/run/pm-suspend
- # set the loglevel so we see the progress bar.
- # if the level is higher than needed, we leave it alone.
- if [ $KERNEL_LOGLEVEL -lt 5 ]; then
- echo 5 > /proc/sys/kernel/printk
- fi
-
- echo "$1 initiated: `date`"
- echo
- echo "`lsmod`"
- echo
- echo "`free`"
- echo
- ;;
- thaw|resume)
- if [ -n "$KERNEL_LOGLEVEL" ] ; then
- echo $KERNEL_LOGLEVEL > /proc/sys/kernel/printk
- fi
- ;;
- *)
- ;;
-esac
-
-
-exit 0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-utils-suse/hooks/06autofs new/pm-utils-suse/hooks/06autofs
--- old/pm-utils-suse/hooks/06autofs 2007-03-14 21:18:23.000000000 +0100
+++ new/pm-utils-suse/hooks/06autofs 1970-01-01 01:00:00.000000000 +0100
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-. /usr/lib/pm-utils/functions
-
-case "$1" in
- hibernate|suspend)
- stopservice autofs
- ;;
- thaw|resume)
- restartservice autofs
- ;;
- *)
- ;;
-esac
-
-exit $?
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-utils-suse/hooks/30s2disk-check new/pm-utils-suse/hooks/30s2disk-check
--- old/pm-utils-suse/hooks/30s2disk-check 2007-04-04 13:06:19.000000000 +0200
+++ new/pm-utils-suse/hooks/30s2disk-check 1970-01-01 01:00:00.000000000 +0100
@@ -1,115 +0,0 @@
-#!/bin/bash
-#
-# Stefan Seyfried, SUSE Linux Products GmbH, 2006
-# mostly taken from the powersave project
-
-# sanity check the environment if resume will be possible after hibernate
-checkhibernate()
-{
- echo "INFO: checking for suspend-to-disk prerequisites..."
- if [ -z "$IMAGE_SIZE" ]; then
- IMAGE_SIZE="`awk '/^MemTotal:/ { print int($2*1024*.45) }' /proc/meminfo`"
- fi
-
- read CMDLINE < /proc/cmdline
- for CMD in $CMDLINE; do
- case $CMD in
- resume=*) RESUME=${CMD#*=}
- break ;;
- esac
- done
- if [ -z "$RESUME" ]; then
- echo "ERROR: no resume parameter on kernel commandline, can not suspend"
- echo "no resume parameter on kernel commandline" >> $INHIBIT
- return 1
- fi
-
- # the resume device can be a symlink, e.g. with LVM/EVMS or with
- # /dev/disk/by-id/foo
- RESUME=$(readlink -f $RESUME)
-
- # suspend to / resume from swap files is not yet handled.
- while read DEV TYPE SIZE USED PRI; do
- [ "$TYPE" != "partition" ] && continue
- [ "$DEV" != "$RESUME" ] && continue
- FREE=$[($SIZE-$USED)*1024] # get free space on DEV
- if [ $FREE -lt $IMAGE_SIZE ]; then
- IMAGE_SIZE=$[$FREE-10*1024*1024]
- fi
- break # we found the partition, no need to look further
- done < /proc/swaps
-
- if [ -z "$DEV" ]; then
- echo "ERROR: resume partition '$RESUME' not active, can not suspend"
- echo "resume partition '$RESUME' not active" >> $INHIBIT
- return 1
- fi
-
- if [ "$HIBERNATE" = "kernel" ]; then
- echo " using kernel suspend method"
- read DEV < /sys/power/resume
- if [ "$DEV" = "0:0" ]; then
- echo "ERROR: no resume partition set up in /sys/power/resume"
- # maybe "resume=..." was given, but initrd did not set up
- # /sys/power/resume correctly.
- echo "resume device not correctly setup in /sys/power/resume" >> \
- $INHIBIT
- return 1
- fi
- X=$(stat -Lc '$((0x%t)):$((0x%T))' $RESUME)
- RDEV=$(eval echo $X)
- if [ "$DEV" != "$RDEV" ]; then
- echo "ERROR: /sys/power/resume ($DEV) disagrees with resume= parameter ($RDEV)"
- echo " can not suspend."
- echo "/sys/power/resume disagrees with resume= parameter" >> \
- $INHIBIT
- return 1
- fi
- if [ -n "$IMAGE_SIZE" -a -w /sys/power/image_size ]; then
- echo " setting image size to $IMAGE_SIZE"
- echo "$IMAGE_SIZE" > /sys/power/image_size 2>/dev/null
- fi
- fi
-
- if [ "$HIBERNATE" = "userspace" ]; then
- echo " using userspace suspend method"
- rm -f $S2DISK_CONF
- echo " setting resume device to $RESUME"
- echo "resume device = $RESUME" >> $S2DISK_CONF
- if [ -n "$IMAGE_SIZE" ]; then
- echo " setting image size to $IMAGE_SIZE"
- echo "image size = $IMAGE_SIZE" >> $S2DISK_CONF
- fi
- # add the parameters from /etc/suspend.conf to /var/lib/s2disk.conf
- if [ -e /etc/suspend.conf ]; then
- echo "# parameters taken from /etc/suspend.conf:" >> $S2DISK_CONF
- sed '/^[[:space:]]*\(#\|$\)/d;' /etc/suspend.conf >> $S2DISK_CONF
- echo " adding these parameters from /etc/suspend.conf:"
- sed '/^[[:space:]]*\(#\|$\)/d;s/^/ /;' /etc/suspend.conf
- fi
- fi
- return 0
-}
-
-# this only makes sense on hibernate
-if [ "$1" != "hibernate" ]; then
- exit 0
-fi
-
-[ -e /etc/pm/config.d/$1 ] && . /etc/pm/config.d/$1
-
-if [ -z "$HIBERNATE" ]; then
- if [ -x /usr/sbin/s2disk -a -c /dev/snapshot ]; then
- HIBERNATE="userspace"
- else
- HIBERNATE="kernel"
- fi
-fi
-
-if ! checkhibernate; then
- echo "WARNING: $INHIBIT will be created to prevent suspending!"
- touch $INHIBIT
- exit 1
-fi
-
-exit 0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-utils-suse/hooks/45pcmcia new/pm-utils-suse/hooks/45pcmcia
--- old/pm-utils-suse/hooks/45pcmcia 2006-10-24 17:56:34.000000000 +0200
+++ new/pm-utils-suse/hooks/45pcmcia 1970-01-01 01:00:00.000000000 +0100
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-case "$1" in
- hibernate|suspend)
- if [ -x "/sbin/pccardctl" ]; then
- echo "ejecting PCMCIA cards..."
- /sbin/pccardctl eject
- fi
- ;;
- thaw|resume)
- if [ -x "/sbin/pccardctl" ]; then
- echo "inserting PCMCIA cards..."
- /sbin/pccardctl insert
- fi
- ;;
- *)
- ;;
-esac
-
-
-exit 0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-utils-suse/hooks/80acpi-fan new/pm-utils-suse/hooks/80acpi-fan
--- old/pm-utils-suse/hooks/80acpi-fan 2006-11-08 13:46:06.000000000 +0100
+++ new/pm-utils-suse/hooks/80acpi-fan 1970-01-01 01:00:00.000000000 +0100
@@ -1,30 +0,0 @@
-#!/bin/bash
-#
-# Stefan Seyfried, SUSE Linux Products GmbH, 2006
-# mostly taken from the powersave project
-
-#############################################################
-# triggers the ACPI fan(s) after resume. Since ACPI drivers
-# have no suspend support, this is sometimes necessary.
-# see http://article.gmane.org/gmane.linux.acpi.devel/16643
-kick-fan()
-{
- local FAN DUMMY STATE
- for FAN in /proc/acpi/fan/*/state; do
- [ ! -e $FAN ] && continue
- read DUMMY STATE < $FAN
- if [ "$STATE" = "on" ]; then
- echo "kicking $FAN"
- echo -n 3 > $FAN
- echo -n 0 > $FAN
- fi
- done
-}
-
-case $1 in
- thaw|resume)
- kick-fan
- ;;
-esac
-
-exit 0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-utils-suse/hooks/80videobios new/pm-utils-suse/hooks/80videobios
--- old/pm-utils-suse/hooks/80videobios 2006-11-08 13:46:33.000000000 +0100
+++ new/pm-utils-suse/hooks/80videobios 1970-01-01 01:00:00.000000000 +0100
@@ -1,27 +0,0 @@
-#!/bin/bash
-#
-# Stefan Seyfried, SUSE Linux Products GmbH, 2006
-# mostly taken from the powersave project
-
-#############################################################################
-# if the system is configured for 855resolution, we first patch the BIOS
-# to avoid that the X server crashes after switching back to X
-patch-bios()
-{
- if [ -e /etc/sysconfig/videobios ]; then
- . /etc/sysconfig/videobios
- if [ "$VIDEOBIOS_PATCH" = "yes" ]; then
- BIOS_INIT="/etc/init.d/boot.videobios"
- echo "patching video bios..."
- [ -x $BIOS_INIT ] && $BIOS_INIT start >/dev/null 2>&1
- fi
- fi
-}
-
-case $1 in
- thaw)
- patch-bios
- ;;
-esac
-
-exit 0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-utils-suse/hooks/99info new/pm-utils-suse/hooks/99info
--- old/pm-utils-suse/hooks/99info 2006-11-22 17:20:06.000000000 +0100
+++ new/pm-utils-suse/hooks/99info 1970-01-01 01:00:00.000000000 +0100
@@ -1,11 +0,0 @@
-#!/bin/sh
-#
-# be nice to the user and tell him that something is going on...
-
-case "$1" in
- thaw|resume)
- echo "resuming..." > /dev/tty0
- ;;
- *)
- ;;
-esac
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-utils-suse/hooks/99Zgrub new/pm-utils-suse/hooks/99Zgrub
--- old/pm-utils-suse/hooks/99Zgrub 2007-03-20 17:01:48.000000000 +0100
+++ new/pm-utils-suse/hooks/99Zgrub 1970-01-01 01:00:00.000000000 +0100
@@ -1,195 +0,0 @@
-#!/bin/bash
-#
-# Stefan Seyfried, SUSE Linux Products GmbH 2006, GPL v2
-# mostly taken from the powersave project.
-
-GRUBONCE="/usr/sbin/grubonce"
-GRUBDEFAULT="/boot/grub/default"
-GRUBDEFSAVE="/var/run/suspend.grubonce.default"
-
-#####################################################################
-# gets a list of available kernels from /boot/grub/menu.lst
-# kernels are in the array $KERNELS, output to stdout to be eval-ed.
-getkernels()
-{
- # DEBUG "Running getkernels()" INFO
- local MENU_LST="/boot/grub/menu.lst"
- local I DUMMY MNT ROOTDEV
- declare -i I=0 J=-1
-
- # we need the root partition later to decide if this is the kernel to select
- while read ROOTDEV MNT DUMMY; do
- [ "$ROOTDEV" = "rootfs" ] && continue # not what we are searching for
- if [ "$MNT" = "/" ]; then
- break
- fi
- done < /proc/mounts
-
- # build an array KERNELS with all the kernels in /boot/grub/menu.lst
- # the array MENU_ENTRIES contains the corresponding menu entry numbers
- # DEFAULT_BOOT contains the default entry.
- while read LINE; do
- case $LINE in
- title*)
- let J++ # increase for every menu entry, even for non-linux
- # DEBUG "Found grub menu entry #${J}: '${LINE}'" INFO
- ;;
- default*)
- DUMMY=($LINE) # "default 0 #maybe a comment"
- echo "DEFAULT_BOOT=${DUMMY[1]}" # ^^[0]^^ 1 ^^[2]^ 3 ^^[4]^^
- # DEBUG "Default boot entry is '${DUMMY[1]}'" INFO
- ;;
- kernel*noresume*)
- # we probably found the "failsafe" kernel that won't resume...
- echo " Skipping grub entry #${J}, because it has the noresume option" >&2
- ;;
- kernel*root=*)
- local ROOT
- ROOT=${LINE#*root=}
- DUMMY=($ROOT)
- ROOT=${DUMMY[0]}
- if [ "$(stat -Lc '%t:%T' $ROOT)" != "$(stat -Lc '%t:%T' $ROOTDEV)" ]; then
- echo " Skipping grub entry #${J}, because its root= parameter ($ROOT)" >&2
- echo " does not match the current root device ($ROOTDEV)." >&2
- continue
- fi
- DUMMY=($LINE) # kernel (hd0,1)/boot/vmlinuz-ABC root=/dev/hda2
- echo "KERNELS[$I]='${DUMMY[1]##*/}'" # vmlinuz-ABC
- echo "MENU_ENTRIES[$I]=$J"
- # DEBUG "Found kernel entry #${I}: '${DUMMY[1]##*/}'" INFO
- let I++
- ;;
- kernel*)
- # a kernel without "root="? We better skip that one...
- echo " Skipping grub entry #${J}, because it has no root= option" >&2
- ;;
- *) ;;
- esac
- done < $MENU_LST
-}
-
-#############################################################
-# runs grubonce from the grub package to select which kernel
-# to boot on next startup
-grub-once()
-{
- if [ -x "$GRUBONCE" ]; then
- rm -f "$GRUBDEFSAVE"
- if [ -e "$GRUBDEFAULT" ]; then
- echo " saving original $GRUBDEFAULT"
- cp "$GRUBDEFAULT" "$GRUBDEFSAVE"
- fi
- echo " running '$GRUBONCE $1'"
- $GRUBONCE $1
- else
- echo "WARNING: $GRUBONCE not found, not preparing bootloader"
- fi
-}
-
-#############################################################
-# restore grub default after (eventually failed) resume
-grub-once-restore()
-{
- echo "INFO: running grub-once-restore"
- rm -f "$GRUBDEFAULT"
- if [ -e "$GRUBDEFSAVE" ]; then
- echo " restoring original $GRUBDEFAULT"
- mv "$GRUBDEFSAVE" "$GRUBDEFAULT"
- fi
-}
-
-#############################################################################
-# try to find a kernel image that matches the actually running kernel.
-# We need this, if more than one kernel is installed. This works reasonably
-# well with grub, if all kernels are named "vmlinuz-`uname -r`" and are
-# located in /boot. If they are not, good luck ;-)
-find-kernel-entry()
-{
- NEXT_BOOT=-1
- ARCH=`uname -m`
- declare -i I=0
- # DEBUG "running kernel: $RUNNING" DIAG
- while [ -n "${KERNELS[$I]}" ]; do
- BOOTING="${KERNELS[$I]}"
- if IMAGE=`readlink /boot/$BOOTING` && [ -e "/boot/${IMAGE##*/}" ]; then
- # DEBUG "Found kernel symlink $BOOTING => $IMAGE" INFO
- BOOTING=$IMAGE
- fi
- case $ARCH in
- ppc*) BOOTING="${BOOTING#*vmlinux-}" ;;
- *) BOOTING="${BOOTING#*vmlinuz-}" ;;
- esac
- if [ "$RUNNING" == "$BOOTING" ]; then
- NEXT_BOOT=${MENU_ENTRIES[$I]}
- echo " running kernel is grub menu entry $NEXT_BOOT (${KERNELS[$I]})"
- break
- fi
- let I++
- done
- # if we have not found a kernel, issue a warning.
- # if we have found a kernel, we'll do "grub-once" later, after
- # prepare_suspend finished.
- if [ $NEXT_BOOT -eq -1 ]; then
- echo "WARNING: no kernelfile matching the running kernel found"
- fi
-}
-
-#############################################################################
-# if we did not find a kernel (or BOOT_LOADER is not GRUB) check,
-# if the running kernel is still the one that will (probably) be booted for
-# resume (default entry in menu.lst or, if there is none, the kernel file
-# /boot/vmlinuz points to.)
-# This will only work, if you use "original" SUSE kernels.
-# you can always override with the config variable set to "yes"
-prepare-grub()
-{
- echo "INFO: running prepare-grub"
- eval `getkernels`
- RUNNING=`uname -r`
- find-kernel-entry
-
- RET=0
-
- if [ $NEXT_BOOT -eq -1 ]; then
- # which kernel is booted with the default entry?
- BOOTING="${KERNELS[$DEFAULT_BOOT]}"
- # if there is no default entry (no menu.lst?) we fall back to
- # the default of /boot/vmlinuz.
- [ -z "$BOOTING" ] && BOOTING="vmlinuz"
- if IMAGE=`readlink /boot/$BOOTING` && [ -e "/boot/${IMAGE##*/}" ]; then
- BOOTING=$IMAGE
- fi
- BOOTING="${BOOTING#*vmlinuz-}"
- echo "running kernel: '$RUNNING', probably booting kernel: '$BOOTING'"
- if [ "$BOOTING" != "$RUNNING" ]; then
- echo "ERROR: kernel version mismatch, cannot suspend to disk"
- echo "running: $RUNNING booting: $BOOTING" >> $INHIBIT
- RET=1
- fi
- else
- # set the bootloader to the running kernel
- echo " preparing boot-loader: selecting entry $NEXT_BOOT, kernel /boot/$BOOTING"
- T1=`date +"%s%N"`
- sync; sync; sync # this is needed to speed up grub-once on reiserfs
- T2=`date +"%s%N"`
- echo " grub-once: `grub-once $NEXT_BOOT`"
- T3=`date +"%s%N"`
- S=$(((T2-T1)/100000000)); S="$((S/10)).${S:0-1}"
- G=$(((T3-T2)/100000000)); G="$((G/10)).${G:0-1}"
- echo " time needed for sync: $S seconds, time needed for grub: $G seconds."
- fi
-
- return $RET
-}
-
-
-###### main()
-
-case $1 in
- hibernate)
- prepare-grub
- ;;
- thaw)
- grub-once-restore
- ;;
-esac
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-utils-suse/hooks/power.d/iwl-pm new/pm-utils-suse/hooks/power.d/iwl-pm
--- old/pm-utils-suse/hooks/power.d/iwl-pm 1970-01-01 01:00:00.000000000 +0100
+++ new/pm-utils-suse/hooks/power.d/iwl-pm 2008-04-28 14:28:31.000000000 +0200
@@ -0,0 +1,37 @@
+#!/bin/bash
+#
+# Script to set the power mode for the iwl drivers
+#
+# Copyright (C) 2008 Holger Macht