![](https://seccdn.libravatar.org/avatar/af22e20b6884acbc89be6d7736c43e92.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package pm-utils checked in at Mon Oct 23 18:56:59 CEST 2006. -------- --- pm-utils/pm-utils.changes 2006-10-11 21:14:12.000000000 +0200 +++ /mounts/work_src_done/STABLE/pm-utils/pm-utils.changes 2006-10-23 18:01:23.000000000 +0200 @@ -1,0 +2,5 @@ +Mon Oct 23 18:00:58 CEST 2006 - hmacht@suse.de + +- add hook to log lsmod and free + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pm-utils.spec ++++++ --- /var/tmp/diff_new_pack.StLmWh/_old 2006-10-23 18:56:18.000000000 +0200 +++ /var/tmp/diff_new_pack.StLmWh/_new 2006-10-23 18:56:18.000000000 +0200 @@ -13,9 +13,9 @@ Name: pm-utils URL: http://webcvs.freedesktop.org/pm-utils/ Version: 0.20.0.20061010 -Release: 3 +Release: 8 Summary: Tools to suspend and hibernate computers. -License: GPL +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 @@ -68,6 +68,8 @@ %doc README COPYING ChangeLog AUTHORS %changelog -n pm-utils +* Mon Oct 23 2006 - hmacht@suse.de +- add hook to log lsmod and free * Wed Oct 11 2006 - seife@suse.de - small fixes, disable not yet ready logging code * Tue Oct 10 2006 - seife@suse.de ++++++ pm-utils-suse.tar.gz ++++++ 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 2006-10-11 21:43:27.000000000 +0200 +++ new/pm-utils-suse/hooks/06autofs 1970-01-01 01:00:00.000000000 +0100 @@ -1,16 +0,0 @@ -#!/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 2006-10-11 22:21:08.000000000 +0200 +++ new/pm-utils-suse/hooks/30s2disk-check 1970-01-01 01:00:00.000000000 +0100 @@ -1,100 +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() -{ - 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/80acpi-fan new/pm-utils-suse/hooks/80acpi-fan --- old/pm-utils-suse/hooks/80acpi-fan 2006-10-11 20:52:21.000000000 +0200 +++ new/pm-utils-suse/hooks/80acpi-fan 1970-01-01 01:00:00.000000000 +0100 @@ -1,29 +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 -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-10-11 20:53:28.000000000 +0200 +++ 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..." >> $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 2006-10-11 20:57:57.000000000 +0200 +++ new/pm-utils-suse/hooks/99Zgrub 1970-01-01 01:00:00.000000000 +0100 @@ -1,172 +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" -# 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