Description: Fix option names for s2ram and apply s2ram options to s2both.
Bug-Debian: http://bugs.debian.org/505410
Origin: vendor, http://bugs.debian.org/505410#5
Last-Update: 2012-05-01

diff --git a/scriptlets.d/ususpend b/scriptlets.d/ususpend
index 25d9aa5..edf801e 100644
--- a/scriptlets.d/ususpend
+++ b/scriptlets.d/ususpend
@@ -33,10 +33,7 @@ USuspendConfigEnabler() {
     case "$1" in
 	ususpendmethod)
 	    case "$2" in
-		disk|both) USUSPEND_PROG=s2$2;;
-		ram)
-		    USUSPEND_PROG=s2ram
-		    ;;
+		disk|both|ram) USUSPEND_PROG=s2$2;;
 		*)
 		    vecho 1 "$EXE: Invalid value fo USuspendMethod."
 		    return 2
@@ -104,13 +101,13 @@ USuspendOptionHandler() {
 DoUSuspend() {
     if [ -z "$USUSPEND_NO_SUSPEND" ] ; then
 	ARGS=
-	if [ "$USUSPEND_PROG" = s2ram ]; then
-	    [ $USUSPEND_RAM_FORCE -eq 1 ] && ARGS="$ARGS -f"
-	    [ $USUSPEND_RAM_VBESAVE -eq 1 ] && ARGS="$ARGS -s"
-	    [ $USUSPEND_RAM_VBEPOST -eq 1 ] && ARGS="$ARGS -p"
-	    [ $USUSPEND_RAM_RADEONTOOL -eq 1 ] && ARGS="$ARGS -r"
-	    [ $USUSPEND_RAM_VBEMODE -eq 1 ] && ARGS="$ARGS -m"
-	    [ $USUSPEND_RAM_ACPISLEEP -ne 0 ] && ARGS="$ARGS -a $USUSPEND_RAM_ACPISLEEP"
+	if [ "$USUSPEND_PROG" = s2ram -o "$USUSPEND_PROG" = s2both ]; then
+	    [ $USUSPEND_RAM_FORCE -eq 1 ] && ARGS="$ARGS --force"
+	    [ $USUSPEND_RAM_VBESAVE -eq 1 ] && ARGS="$ARGS --vbe_save"
+	    [ $USUSPEND_RAM_VBEPOST -eq 1 ] && ARGS="$ARGS --vbe_post"
+	    [ $USUSPEND_RAM_RADEONTOOL -eq 1 ] && ARGS="$ARGS --radeontool"
+	    [ $USUSPEND_RAM_VBEMODE -eq 1 ] && ARGS="$ARGS --vbe_mode"
+	    [ $USUSPEND_RAM_ACPISLEEP -ne 0 ] && ARGS="$ARGS --acpi_sleep $USUSPEND_RAM_ACPISLEEP"
 	    [ $USUSPEND_RAM_PCISAVE -eq 1 ] && ARGS="$ARGS -v"
 	fi
 	vecho 1 "$EXE: Running $USUSPEND_PROG_PATH $ARGS..."
