Hello community, here is the log from the commit of package pm-utils checked in at Thu Oct 26 20:29:28 CEST 2006. -------- --- pm-utils/pm-utils.changes 2006-10-23 18:01:23.000000000 +0200 +++ /mounts/work_src_done/STABLE/pm-utils/pm-utils.changes 2006-10-24 17:49:13.000000000 +0200 @@ -1,0 +2,7 @@ +Tue Oct 24 17:47:50 CEST 2006 - hmacht@suse.de + +- update to current CVS, some fixes incorporated upstream. +- add logging functionality +- add hook for ejecting pcmcia cards + +------------------------------------------------------------------- Old: ---- pm-utils-0.20.0.20061010-suse.diff pm-utils-0.20.0.20061010.tar.gz New: ---- pm-utils-0.20.0.20061024-suse.diff pm-utils-0.20.0.20061024.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pm-utils.spec ++++++ --- /var/tmp/diff_new_pack.p3jF5L/_old 2006-10-26 20:29:22.000000000 +0200 +++ /var/tmp/diff_new_pack.p3jF5L/_new 2006-10-26 20:29:22.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package pm-utils (Version 0.20.0.20061010) +# spec file for package pm-utils (Version 0.20.0.20061024) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -12,13 +12,13 @@ Name: pm-utils URL: http://webcvs.freedesktop.org/pm-utils/ -Version: 0.20.0.20061010 -Release: 8 +Version: 0.20.0.20061024 +Release: 1 Summary: Tools to suspend and hibernate computers. License: GNU General Public License (GPL) - all versions Group: System/Base Source: %{name}-%{version}.tar.gz -Patch0: pm-utils-0.20.0.20061010-suse.diff +Patch0: pm-utils-0.20.0.20061024-suse.diff Source1: pm-utils-suse.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build Prefix: /usr @@ -44,7 +44,7 @@ %build export CFLAGS="$RPM_OPT_FLAGS" -./configure --prefix=/usr --sysconfdir=/etc +./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man make %install @@ -68,6 +68,10 @@ %doc README COPYING ChangeLog AUTHORS %changelog -n pm-utils +* 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 - add hook to log lsmod and free * Wed Oct 11 2006 - seife@suse.de ++++++ pm-utils-0.20.0.20061010-suse.diff -> pm-utils-0.20.0.20061024-suse.diff ++++++ --- pm-utils/pm-utils-0.20.0.20061010-suse.diff 2006-10-11 22:32:57.000000000 +0200 +++ /mounts/work_src_done/STABLE/pm-utils/pm-utils-0.20.0.20061024-suse.diff 2006-10-24 18:01:12.000000000 +0200 @@ -1,22 +1,21 @@ --- pm/functions +++ pm/functions -@@ -5,27 +5,30 @@ +@@ -5,7 +5,7 @@ # default values go here HIBERNATE_RESUME_POST_VIDEO=no SUSPEND_MODULES="" +-RESUME_MODULES="" +INHIBIT=/var/run/pm-utils.inhibit -+S2DISK_BIN="/usr/sbin/s2disk" -+S2DISK_CONF="/var/lib/s2disk.conf" + LOGFILE=/var/log/pm-suspend.log [ -f /etc/pm/config ] && . /etc/pm/config - +@@ -19,21 +19,20 @@ # export them all here - export HIBERNATE_RESUME_POST_VIDEO - export SUSPEND_MODULES -+export INHIBIT S2DISK_BIN S2DISK_CONF - --GLOBAL_CONFIG_VARIABLES="HIBERNATE_RESUME_POST_VIDEO SUSPEND_MODULES" -+GLOBAL_CONFIG_VARIABLES="HIBERNATE_RESUME_POST_VIDEO SUSPEND_MODULES INHIBIT" + add_global HIBERNATE_RESUME_POST_VIDEO + add_global SUSPEND_MODULES +-add_global RESUME_MODULES ++add_global INHIBIT + add_global LOGFILE source_configs() { @@ -42,7 +41,7 @@ done } -@@ -49,7 +52,7 @@ +@@ -57,7 +56,7 @@ remove_suspend_lock() { @@ -51,23 +50,33 @@ chvt 1 chvt $VT openvt -- sh -c "usleep $1 ; rm -f /.suspended >/dev/null 2>&1 0<&1" >/dev/null 2>&1 0<&1 & -@@ -60,13 +63,14 @@ +@@ -68,7 +67,7 @@ [ -z "$1" ] && return 0 [ -f /var/run/pm-suspend ] && . /var/run/pm-suspend - rm -f /var/run/pm-suspend +# rm -f /var/run/pm-suspend - files="/etc/pm/hooks/*[^~]" - if [ "$2" = "reverse" ]; then - filea=($files) - filen=${#filea[*]} - while [ "$filen" -gt 0 ]; do -+ let filen-- + echo "$(date): running $1 hooks." + +@@ -80,14 +79,14 @@ + let filen-- file="${filea[$filen]}" - [ -x $file ] && $file $1 + if [ -x $file ]; then +- echo "$i" ++ echo "===== current hook: $file =====" + $file $1 + fi done -@@ -96,20 +100,53 @@ + else + for file in $files ; do + if [ -x $file ]; then +- echo "$i" ++ echo "===== current hook: $file =====" + $file $1 + fi + done +@@ -113,24 +112,59 @@ return $RETVAL } @@ -83,8 +92,13 @@ + pm_main() { - take_suspend_lock || exit 1 + if [ -n "$LOGFILE" ]; then + [ -f "$LOGFILE" ] && rm -f "$LOGFILE" + touch "$LOGFILE" + fi ++ [ -n "$LOGFILE" ] && exec > $LOGFILE 2>&1 + + take_suspend_lock || exit 1 + rm -f $INHIBIT + run_hooks "$1" @@ -100,6 +114,7 @@ + pm-pmu --suspend || do_suspend + run_hooks resume reverse + fi ++ ;; hibernate) - echo -n "platform" > /sys/power/disk @@ -125,72 +140,23 @@ run_hooks thaw reverse ;; esac -@@ -119,13 +156,47 @@ - return 0 - } - -+# this recursively unloads the given modules and all that depend on it -+# first parameter is the module to be unloaded - modunload() - { -- lsmod 2>/dev/null | grep -q "$1" -- if [ "$?" == "0" ]; then -- echo "export ${1}_MODULE_LOAD=yes" >> /var/run/pm-suspend -- modprobe -r "$1" >/dev/null 2>&1 -- fi -+ local MOD D C USED MODS I -+ local UNL=$1 RET=1 -+ # RET is the return code. If at least one module was unloaded, return 0. -+ # if the module was not loaded, also return 0 since this is no error. -+ # if no module was unloaded successfully, return 1 -+ while read MOD D C USED D; do -+ [ "$MOD" != "$UNL" ] && continue -+ if [ "$USED" == "-" ]; then -+ if [ $C -eq 0 ]; then -+ if modprobe -r $UNL > /dev/null 2>&1; then -+ echo "export RESUME_MODULES=\"$UNL \$RESUME_MODULES\"" \ -+ >> /var/run/pm-suspend -+ RET=0 -+ else -+ echo "## could not unload '$UNL', usage count was 0" \ -+ >> /var/run/pm-suspend -+ fi -+ else -+ echo "## could not unload '$UNL', usage count: $C" \ -+ >> /var/run/pm-suspend -+ fi -+ else -+ USED=${USED//,/ } -+ MODS=($USED) -+ # it seems slightly more likely to rmmod in one pass, if we try backwards. -+ for I in `seq $[${#MODS[@]}-1] -1 0`; do -+ MOD=${MODS[$I]} -+ modunload $MOD && RET=0 -+ done -+ # if we unloaded at least one module, then let's try again! -+ [ $RET -eq 0 ] && modunload $UNL -+ RET=$? -+ fi -+ return $RET -+ done < /proc/modules -+ # if we came this far, there was nothing to do, the module is no longer loaded. -+ return 0 - } - - modreload() --- pm/hooks/50modules +++ pm/hooks/50modules -@@ -13,9 +13,8 @@ - - resume_modules() +@@ -6,6 +6,7 @@ { -- [ -z "$SUSPEND_MODULES" ] && return 0 -- for x in $SUSPEND_MODULES ; do -- modreload $x -+ for x in $RESUME_MODULES ; do -+ modprobe $x > /dev/null 2>&1 + [ -z "$SUSPEND_MODULES" ] && return 0 + for x in $SUSPEND_MODULES ; do ++ echo "trying to unload: $x" + modunload $x done return 0 +@@ -15,6 +16,7 @@ + { + [ -z "$RESUME_MODULES" ] && return 0 + for x in $RESUME_MODULES ; do ++ echo "trying to reload: $x" + modprobe $x + done } --- pm/hooks/94cpufreq +++ pm/hooks/94cpufreq @@ -199,7 +165,7 @@ savestate ${x}_governor $(cat $x/cpufreq/scaling_governor) - sh -c "echo userspace > $x/cpufreq/scaling_governor" >/dev/null 2>&1 -+ echo performance > $x/cpufreq/scaling_governor 2>/dev/null ++ sh -c "echo performance > $x/cpufreq/scaling_governor" >/dev/null 2>&1 done popd >/dev/null 2>&1 } ++++++ pm-utils-0.20.0.20061010.tar.gz -> pm-utils-0.20.0.20061024.tar.gz ++++++ ++++ 9117 lines of diff (skipped) ++++++ pm-utils-suse.tar.gz ++++++ 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 1970-01-01 01:00:00.000000000 +0100 +++ new/pm-utils-suse/hooks/01logging 2006-10-24 17:44:30.000000000 +0200 @@ -0,0 +1,31 @@ +#!/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 1970-01-01 01:00:00.000000000 +0100 +++ new/pm-utils-suse/hooks/06autofs 2006-10-11 21:43:27.000000000 +0200 @@ -0,0 +1,16 @@ +#!/bin/bash + +. /etc/pm/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 1970-01-01 01:00:00.000000000 +0100 +++ new/pm-utils-suse/hooks/30s2disk-check 2006-10-11 22:21:08.000000000 +0200 @@ -0,0 +1,100 @@ +#!/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() +{ + 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 + # DEBUG "no resume parameter" + echo "no resume parameter on kernel commandline" >> $INHIBIT + return 1 + fi + + # 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 + # DEBUG "resume partition '$RESUME' not swapon'ed" + echo "resume partition '$RESUME' not active" >> $INHIBIT + return 1 + fi + + if [ "$HIBERNATE" = "kernel" ]; then + read DEV < /sys/power/resume + if [ "$DEV" = "0:0" ]; then + # DEBUG "no resume partition set" + # 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=$(echo $X) + if [ "$DEV" != "$RDEV" ]; then + echo "/sys/power/resume disagrees with resume= parameter" >> \ + $INHIBIT + return 1 + fi + if [ -n "$IMAGE_SIZE" -a -w /sys/power/image_size ]; then + echo "$IMAGE_SIZE" > /sys/power/image_size 2>/dev/null + fi + fi + + if [ "$HIBERNATE" = "userspace" ]; then + rm -f $S2DISK_CONF + echo "resume device = $RESUME" >> $S2DISK_CONF + if [ -n "$IMAGE_SIZE" ]; then + 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 + 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 "$S2DISK_BIN" -a -c /dev/snapshot ]; then + HIBERNATE="userspace" + else + HIBERNATE="kernel" + fi +fi + +if ! checkhibernate; then + 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 1970-01-01 01:00:00.000000000 +0100 +++ new/pm-utils-suse/hooks/45pcmcia 2006-10-24 17:56:34.000000000 +0200 @@ -0,0 +1,21 @@ +#!/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 1970-01-01 01:00:00.000000000 +0100 +++ new/pm-utils-suse/hooks/80acpi-fan 2006-10-11 20:52:21.000000000 +0200 @@ -0,0 +1,29 @@ +#!/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 -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 1970-01-01 01:00:00.000000000 +0100 +++ new/pm-utils-suse/hooks/80videobios 2006-10-11 20:53:28.000000000 +0200 @@ -0,0 +1,27 @@ +#!/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..." >> $LOGFILE + [ -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/99Zgrub new/pm-utils-suse/hooks/99Zgrub --- old/pm-utils-suse/hooks/99Zgrub 1970-01-01 01:00:00.000000000 +0100 +++ new/pm-utils-suse/hooks/99Zgrub 2006-10-11 20:57:57.000000000 +0200 @@ -0,0 +1,172 @@ +#!/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" +# LOGFILE="/var/log/suspend.log" + +##################################################################### +# 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 + declare -i I=0 J=-1 + + # 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*) + 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++ + ;; + *) ;; + 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" >> $LOGFILE + cp "$GRUBDEFAULT" "$GRUBDEFSAVE" + fi + # echo "running '$GRUBONCE $1'" >> $LOGFILE + $GRUBONCE $1 + # else + # echo "$GRUBONCE not found, not preparing bootloader" >> $LOGFILE + fi +} + +############################################################# +# restore grub default after (eventually failed) resume +grub-once-restore() +{ + rm -f "$GRUBDEFAULT" + if [ -e "$GRUBDEFSAVE" ]; then + # echo "restoring original $GRUBDEFAULT" >> $LOGFILE + 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]} + # DEBUG "running kernel is grub menu entry $NEXT_BOOT" DIAG + # DEBUG "kernel filename: '${KERNELS[$I]}'" DIAG + # echo "running kernel is grub menu entry $NEXT_BOOT (${KERNELS[$I]})" >> $LOGFILE + 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 + # DEBUG "no kernelfile matching the running kernel found" WARN + # echo "no kernelfile matching the running kernel found" >> $LOGFILE + # 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() +{ + 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'" >> $LOGFILE + if [ "$BOOTING" != "$RUNNING" ]; then + # echo "kernel version mismatch, cannot suspend to disk" >> $LOGFILE + 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" >> $LOGFILE + #T1=`date +"%s%N"` + sync; sync; sync # this is needed to speed up grub-once on reiserfs + #T2=`date +"%s%N"` + grub-once $NEXT_BOOT > /dev/null 2>&1 + #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." >> $LOGFILE + fi + + return $RET +} + + +###### main() + +case $1 in + hibernate) + prepare-grub + ;; + thaw) + grub-once-restore + ;; +esac ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@suse.de