suspend problems ubuntu gusty and thinkpad r31

Solaris, RedHat, FreeBSD and the like
Post Reply
Message
Author
awong
Freshman Member
Posts: 78
Joined: Thu Jul 26, 2007 2:05 pm
Location: Tampa, Florida
Contact:

suspend problems ubuntu gusty and thinkpad r31

#1 Post by awong » Wed Dec 05, 2007 3:13 pm

I've had this issue since feisty and still with gusty, with my suspend/ when I do FN+F4, basically I have problems with my suspend to come back up all I get is a black screen, I can not reproduce the issue, but it seems to be from suspending from extended periods of time, b/c I can suspend between classes walk to class and it comes back up, but a drive home from school 30-45min I try to restore and I can not get it back up and running.

I was looking at thinkwiki and saw this,
http://www.thinkwiki.org/wiki/Problem_w ... ter_resume
and I believe my r31 has an i830 or i830mg
Solution for ThinkPads with Intel I830 Chipset

The following solution worked for me on an X30 with I830M chipset with kernel >= 2.6.16.

* this works with vesafb and also with intelfb frambuffer support.

The following example /etc/acpi/actions/sleep.sh script shows how to integrate the according lines.

#!/bin/bash

FGCONSOLE=`fgconsole`
chvt 8
sync
hwclock --systohc

echo -n "mem" > /sys/power/state

hwclock --hctosys
vbetool post

if [ "$FGCONSOLE" -ge "7" ] ; then
chvt $FGCONSOLE
else
chvt 7
chvt $FGCONSOLE
fi
how am I supposed to integrate this into script for ubuntu, confused about this since I really want t oget this fixed

lightweight
Sophomore Member
Posts: 234
Joined: Sat Jun 30, 2007 10:56 pm
Location: L. A.

#2 Post by lightweight » Tue Dec 18, 2007 4:53 am

Before changing your ACPI scripts, you can first test that script to see if it does what you want. Save this in your home directory as a file called sleep.sh

Code: Select all

#!/bin/bash

FGCONSOLE=`fgconsole`
chvt 8
sync
hwclock --systohc

echo -n "mem" > /sys/power/state

hwclock --hctosys
vbetool post

if [ "$FGCONSOLE" -ge "7" ] ; then
chvt $FGCONSOLE
else
chvt 7
chvt $FGCONSOLE
fi 
Then open a terminal and test with

Code: Select all

bash ~/sleep.sh
Now, this script looks like it sleeps (echoing only mem into /sys/power/state) and wakes up by switching you to the 7th virtual term. You should be able to do the same by pressing Ctrl, Alt, and F7 simultaneously (changing to virtual term 7) when the screen is black after resume. But maybe the magic is in the vbetool line.

Anyway, if the script is in fact what you want, you'll need to edit the acpi scripts. Unlike the distribution used in that Think Wiki excerpt, Debian-based distributions (like Ubuntu) keep their acpi scripts in /etc/acpi.

Your current /etc/acpi/sleep.sh should look something like this:

Code: Select all

 #!/bin/sh

test -f /usr/share/acpi-support/power-funcs || exit 0

. /etc/default/acpi-support
. /usr/share/acpi-support/power-funcs
. /usr/share/acpi-support/device-funcs
. /usr/share/acpi-support/policy-funcs

DeviceConfig;

if [ x$ACPI_SLEEP != xtrue ] && [ x$1 != xforce ]; then
  exit;
fi

# If gnome-power-manager or klaptopdaemon are running, let them handle policy
if [ x$1 != xforce ] && [ x$1 != xsleep ] && [ `CheckPolicy` = 0 ]; then
    exit;
fi

if [ x$LOCK_SCREEN = xtrue ]; then
    if pidof xscreensaver > /dev/null; then 
        for x in /tmp/.X11-unix/*; do
            displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
            getXuser;
            if [ x"$XAUTHORITY" != x"" ]; then      
                export DISPLAY=":$displaynum"
                . /usr/share/acpi-support/screenblank
            fi
        done
    fi
fi

# Generic preparation code
. /etc/acpi/prepare.sh

if [ x$DISABLE_DMA = xtrue ] && [ -b /dev/hda ]; then
  hdparm -d 0 /dev/hda
fi

echo -n $ACPI_SLEEP_MODE >/sys/power/state

if [ x$RESET_DRIVE = xtrue ] && [ -b /dev/hda ]; then
    hdparm -w /dev/hda
    hdparm -C /dev/hda
    hdparm -C /dev/hda
    hdparm -C /dev/hda
    hdparm -d 1 /dev/hda
fi

if [ x$DISABLE_DMA = xtrue ] && [ -b /dev/hda ]; then
  hdparm -d 1 /dev/hda
fi

# Generic wakeup code
. /etc/acpi/resume.sh
You could change it to something like this :

(simplified and with changes commented with ##. You do not need the original's if loops if you are never past the 7th virtual terminal with regular use, and you're probably not.)

Code: Select all

#!/bin/sh

test -f /usr/share/acpi-support/power-funcs || exit 0

. /etc/default/acpi-support
. /usr/share/acpi-support/power-funcs
. /usr/share/acpi-support/device-funcs
. /usr/share/acpi-support/policy-funcs

DeviceConfig;

if [ x$ACPI_SLEEP != xtrue ] && [ x$1 != xforce ]; then
  exit;
fi

# If gnome-power-manager or klaptopdaemon are running, let them handle policy
if [ x$1 != xforce ] && [ x$1 != xsleep ] && [ `CheckPolicy` = 0 ]; then
    exit;
fi

if [ x$LOCK_SCREEN = xtrue ]; then
    if pidof xscreensaver > /dev/null; then 
        for x in /tmp/.X11-unix/*; do
            displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
            getXuser;
            if [ x"$XAUTHORITY" != x"" ]; then      
                export DISPLAY=":$displaynum"
                . /usr/share/acpi-support/screenblank
            fi
        done
    fi
fi

# Generic preparation code
. /etc/acpi/prepare.sh

if [ x$DISABLE_DMA = xtrue ] && [ -b /dev/hda ]; then
  hdparm -d 0 /dev/hda
fi

echo -n $ACPI_SLEEP_MODE >/sys/power/state


if [ x$RESET_DRIVE = xtrue ] && [ -b /dev/hda ]; then
    hdparm -w /dev/hda
    hdparm -C /dev/hda
    hdparm -C /dev/hda
    hdparm -C /dev/hda
    hdparm -d 1 /dev/hda
fi

if [ x$DISABLE_DMA = xtrue ] && [ -b /dev/hda ]; then
  hdparm -d 1 /dev/hda
fi

## per ThinkWiki article
vbetool post

## force virtual term 7 (GUI) per ThinkWiki article
chvt 7

# Generic wakeup code
. /etc/acpi/resume.sh
Alternatively you could stick those changes in resume.sh

Hope this helps.
Have: x60s ultralight 1705-CTO, Debian SiD, Linux 2.6.25-2 | x61s ultralight 7668-CTO, Debian SiD/Experimental, Linux 2.6.27-git5 | Model M 1391401, white label, 07-17-91
Had: x22, Debian Testing/SiD, Linux 2.6.18-22

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “Linux Questions”

Who is online

Users browsing this forum: No registered users and 0 guests