Hello community, here is the log from the commit of package pm-utils for openSUSE:Factory checked in at 2012-09-13 00:05:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pm-utils (Old) and /work/SRC/openSUSE:Factory/.pm-utils.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pm-utils", Maintainer is "vdziewie...@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/pm-utils/pm-utils.changes 2012-07-10 14:05:07.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.pm-utils.new/pm-utils.changes 2012-09-13 00:06:08.000000000 +0200 @@ -1,0 +2,11 @@ +Wed Sep 12 12:02:50 UTC 2012 - vdziewie...@suse.com + +-Changed licence to GPL 2.0 (without +) - bnc#768867 + +------------------------------------------------------------------- +Wed Sep 12 11:41:09 UTC 2012 - vdziewie...@suse.com + +-Added Michael Chang's patch to fix grub2 menu shown after s2disk +(bnc#771587). + +------------------------------------------------------------------- Old: ---- pm-utils-1.4.1-suse-9.tar.bz2 New: ---- pm-utils-1.4.1-suse-10.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pm-utils.spec ++++++ --- /var/tmp/diff_new_pack.UB9tqO/_old 2012-09-13 00:06:09.000000000 +0200 +++ /var/tmp/diff_new_pack.UB9tqO/_new 2012-09-13 00:06:09.000000000 +0200 @@ -19,13 +19,13 @@ %define pm_libdir %{_prefix}/lib/%{name}/ %define pm_quirkdbdir %{pm_libdir}/video-quirks %define pm_sysconfdir %{_sysconfdir}/pm/config.d/ -%define gitversion 9 +%define gitversion 10 Name: pm-utils Version: 1.4.1 Release: 0 Summary: Tools to suspend and hibernate computers -License: GPL-2.0+ +License: GPL-2.0 Group: System/Base Url: http://pm-utils.freedesktop.org/wiki/ Source0: %{name}-%{version}-suse-%{gitversion}.tar.bz2 ++++++ pm-utils-1.4.1-suse-9.tar.bz2 -> pm-utils-1.4.1-suse-10.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pm-utils/pm/sleep.d/99Zgrub new/pm-utils/pm/sleep.d/99Zgrub --- old/pm-utils/pm/sleep.d/99Zgrub 2012-04-24 09:57:35.000000000 +0200 +++ new/pm-utils/pm/sleep.d/99Zgrub 2012-09-11 15:29:32.000000000 +0200 @@ -3,14 +3,38 @@ # 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" +prepare-parameters() +{ + eval `grep LOADER_TYPE= /etc/sysconfig/bootloader` + + if [ x"$LOADER_TYPE" = "xgrub" ]; then + GRUBONCE="/usr/sbin/grubonce" + GRUBDEFAULT="/boot/grub/default" + GRUBDEFSAVE="/var/run/suspend.grubonce.default" + getkernels="getkernels-grub" + elif [ x"$LOADER_TYPE" = "xgrub2" ]; then + GRUBONCE="/usr/sbin/grub2-once" + GRUBDEFAULT="/boot/grub2/grubenv" + GRUBDEFSAVE="/var/run/suspend.grubonce.default" + GRUB2EDITENV="/usr/bin/grub2-editenv" + GRUB2CONF="/boot/grub2/grub.cfg" + BLKID="/usr/sbin/blkid" + getkernels="getkernels-grub2" + elif [ x"$LOADER_TYPE" = "xgrub2-efi" ]; then + GRUBONCE="/usr/sbin/grub2-once" + GRUBDEFAULT="/boot/grub2-efi/grubenv" + GRUBDEFSAVE="/var/run/suspend.grubonce.default" + GRUB2EDITENV="/usr/bin/grub2-efi-editenv" + GRUB2CONF="/boot/grub2-efi/grub.cfg" + BLKID="/usr/sbin/blkid" + getkernels="getkernels-grub2" + fi +} ##################################################################### # 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() +getkernels-grub() { # DEBUG "Running getkernels()" INFO local MENU_LST="/boot/grub/menu.lst" @@ -68,6 +92,74 @@ done < $MENU_LST } +##################################################################### +# gets a list of available kernels from /boot/grub2/grub.cfg +# kernels are in the array $KERNELS, output to stdout to be eval-ed. +getkernels-grub2() +{ + 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 + + while read LINE; do + case $LINE in + menuentry\ *) + let J++ + ;; + set\ default*) + local DEFAULT=${LINE#*default=} + + if echo $DEFAULT | grep -q saved_entry ; then + local SAVED=`$GRUB2EDITENV list | sed -n s/^saved_entry=//p` + if [ -n "$SAVED" ]; then + DEFAULT_BOOT=$($GRUBONCE --show-mapped "$SAVED") + fi + fi + + ;; + linux*noresume*) + echo " Skipping grub entry #${J}, because it has the noresume option" >&2 + ;; + linux*root=*) + local ROOT + ROOT=${LINE#*root=} + DUMMY=($ROOT) + ROOT=${DUMMY[0]} + + if [ x"${ROOT:0:5}" = "xUUID=" ]; then + UUID=${ROOT#UUID=} + if [ -n "$UUID" ]; then + ROOT=$($BLKID -U $UUID) + fi + fi + + 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++ + ;; + linux*) + # a kernel without "root="? We better skip that one... + echo " Skipping grub entry #${J}, because it has no root= option" >&2 + ;; + *) ;; + esac + done < "$GRUB2CONF" +} + ############################################################# # runs grubonce from the grub package to select which kernel # to boot on next startup @@ -144,7 +236,8 @@ prepare-grub() { echo "INFO: running prepare-grub" - eval `getkernels` + prepare-parameters + eval `$getkernels` RUNNING=`uname -r` find-kernel-entry -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org