On Sat, Jul 14, 2007 at 11:08:30AM +0200, martin f krafft wrote: > also sprach Andrew Pimlott <[EMAIL PROTECTED]> [2007.07.13.2224 +0200]: > > One solution would be for hibernate to recognize the 0x20 exit status > > from "s2ram -n". There could be an option "USuspendRamUnsureOk yes" > > that tells hibernate to proceed in this case, and not pass -f to s2ram. > > Just an idea, maybe you know a better way. > > Good idea. I've implemented this; does the following patch work for > you?
Not quite--the unsure check should be in EnsureUSuspendCapable, since "-n" mode is the only place where s2ram exits with a non-zero status for "unsure" systems. Here is an alternative, that I've quickly tested, but be warned that I don't do much shell scripting. Andrew --- ususpend.bak 2007-07-16 21:09:42.000000000 -0700 +++ ususpend 2007-07-16 23:03:21.000000000 -0700 @@ -6,6 +6,7 @@ AddConfigHelp "USuspendMethod <disk|ram|both>" "Enables use of the uswsusp suspend method of newer kernels (>= 2.6.17rc1)" AddConfigHelp "USuspendRamForce <boolean>" "Passes the -f flag to s2ram to force suspending even if the machine is not recognised" +AddConfigHelp "USuspendRamUnsureOk <boolean>" "Instructs s2ram to continue when it's unsure about the system type, thus not requiring -f to be passed" AddConfigHelp "USuspendRamVbeSave <boolean>" "Passes the -s flag to s2ram to save VBE state before suspending and restore after resume" AddConfigHelp "USuspendRamVbePost <boolean>" "Passes the -p flag to s2ram to VBE POST the graphics card after resume" AddConfigHelp "USuspendRamVbeMode <boolean>" "Passes the -m flag to s2ram to get VBE mode before suspend and set it after resume" @@ -18,6 +19,7 @@ USUSPEND_DEVICE=/dev/snapshot USUSPEND_PROG=s2disk USUSPEND_RAM_FORCE=0 +USUSPEND_RAM_UNSUREOK=0 USUSPEND_RAM_VBESAVE=0 USUSPEND_RAM_VBEPOST=0 USUSPEND_RAM_VBEMODE=0 @@ -49,6 +51,9 @@ ususpendramforce) BoolIsOn "$1" "$2" && USUSPEND_RAM_FORCE=1 || return 0 ;; + ususpendramunsureok) + BoolIsOn "$1" "$2" && USUSPEND_RAM_UNSUREOK=1 || return 0 + ;; ususpendramvbesave) BoolIsOn "$1" "$2" && USUSPEND_RAM_VBESAVE=1 || return 0 ;; @@ -110,10 +115,21 @@ vecho 0 "$USUSPEND_PROG not installed." return 2 fi - if [ "$USUSPEND_PROG" = s2ram ] && [ $USUSPEND_RAM_FORCE -eq 0 ] \ - && ! $USUSPEND_PROG -n >/dev/null; then - vecho 0 "$USUSPEND_PROG: unknown machine, see s2ram(8) and the USuspendRamForce option" - return 2 + if [ "$USUSPEND_PROG" = s2ram ] && [ $USUSPEND_RAM_FORCE -eq 0 ]; then + $USUSPEND_PROG -n >/dev/null + ret=$? + case "$ret/$USUSPEND_RAM_UNSUREOK" in + 0/*) :;; + 32/1) :;; # unsure, but USuspendRamUnsureOk passed + 32/*) + vecho 0 "$USUSPEND_PROG: unsure about your machine, see the USuspendRamUnsureOk option" + return 2 + ;; + *) + vecho 0 "$USUSPEND_PROG: unknown machine, see s2ram(8) and the USuspendRamForce option" + return 2 + ;; + esac fi if ! test -f $USUSPEND_STATE_FILE ; then vecho 0 "Your kernel does not have power management built in." -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]