LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 03-11-2007, 03:12 AM   #1
bioe007
Member
 
Registered: Apr 2006
Location: lynnwood, wa - usa
Distribution: archlinux
Posts: 654

Rep: Reputation: 30
suspend to ram script, slack11 dell inspiron 8500


Having recently triumphed over my wirelss card (machine #1 in sig), many kudos to you helpful slackers, I decided to tackle ACPI sleep state 3.

Found an article and followed it. I had to insert some sudo commands (quite liberally) to get it to run without exiting due to permission errors.

As it is now:
Code:
#!/bin/sh

# discover video card's ID
ID=`/sbin/lspci | grep VGA | awk '{ print $1 }' | sed -e 's@0000:@@' -e 's@:@/@'`

# securely create a temporary file
TMP_FILE=`mktemp /var/tmp/video_state.XXXXXX`
trap 'rm -f $TMP_FILE' 0 1 15

# switch to virtual terminal 1 to avoid graphics
# corruption in X
sudo chvt 1

# write all unwritten data (just in case)
sudo sync

# dump current data from the video card to the
# temporary file
cat /proc/bus/pci/$ID > $TMP_FILE

# suspend
sudo echo -n mem > sudo /sys/power/state

# restore video card data from the temporary file
# on resume
sudo cat $TMP_FILE > sudo /proc/bus/pci/$ID

# switch back to virtual terminal 7 (running X)
sudo chvt 7

# remove temporary file
sudo rm -f $TMP_FILE
the script runs without any reported errors.

however, all it does (visibly) is switch virtual terms and come right back to where I started from. With no button pushing whatsoever. The way I understood the above article was that the script would suspend to ram, then when the power button was pushed again, the rest of the script would restore.

I'm now thinking I need to link some event to the second half of the script? (after the # suspend comment)

I did try entering these commands (sans variables) as my normal self; at the:
Code:
sudo echo -n mem > sudo /sys/power/state
nothing really happend. is this the wrong command? (syntax?) the 'double' sudo thing got me around yet another permission error.

tips/clues/suggestions/canned script/personal experiences/tidbits/torrential downpour of pity for me being so blatantly incompetent?

all of the above are welcome yet not equally so

thanks!
 
Old 03-11-2007, 10:53 AM   #2
XGizzmo
Member
 
Registered: Mar 2007
Distribution: Slackware
Posts: 264

Rep: Reputation: 68
I dont know exactly what you are trying to do but the this line looks wrong.
Quote:
sudo echo -n mem > sudo /sys/power/state
I think it should be:
Quote:
sudo echo -n "mem" > /sys/power/state
But thats about all I know to try maybe some other slacker has some better input.
 
Old 03-11-2007, 12:58 PM   #3
bioe007
Member
 
Registered: Apr 2006
Location: lynnwood, wa - usa
Distribution: archlinux
Posts: 654

Original Poster
Rep: Reputation: 30
thanks XGizzmo,

I tried your suggestion:

Code:
perry@hrgrv:~$ /usr/local/sbin/suspend.sh 
/usr/local/sbin/suspend.sh: line 22: /sys/power/state: Permission denied
perry@hrgrv:~$
so I reinserted the 'sudo':
Code:
sudo echo -n "mem" > sudo /sys/power/state
but it does the same thing (just cycles through the chvt 1 -> 7 commands.

I am pretty sure you are correct that is the line & syntax that is screwed up, because that is where the actual suspend to ram should be happening. Unfortunately I can not seem to get permission to echo "" > /sys/power/state w/o root permissions.

<more info>

So as root I can use the command:
Code:
echo -n mem > /sys/power/state
and the computer suspends properly. however when I press the power button to bring it back up I just get a black screen. Which is what the second half of the script is for, to restore the video card.

as root then I can run the script. but I get the same behavior trying to restore the machine. so there are two problems.

1: can't do the command: sudo -n mem > /sys/power/state # because of permissions

2: can't be sure if the script is properly restoring the video card. I can be sure that if I run it as root it does _not_ restore properly.

any help as always greatly appreciated

Last edited by bioe007; 03-11-2007 at 01:16 PM.
 
Old 03-11-2007, 01:24 PM   #4
bioe007
Member
 
Registered: Apr 2006
Location: lynnwood, wa - usa
Distribution: archlinux
Posts: 654

Original Poster
Rep: Reputation: 30
also some more stuff..

after I have tried this script a couple times now images seem a bit 'wonky'..

lots of flickering and occasionally gkrellm charts appear in boxes being updated by firefox. so I exit fluxbox and see this:

Code:
Logging to: /home/perry/.fluxbox/log
BScreen::BScreen: managing screen 0 using visual 0x23, depth 24
wmsetbg warning: could not open domain file /home/perry/GNUstep/Defaults/WindowMaker
which: no wxdfast in (/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.)
which: no gwget in (/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.)
which: no d4x in (/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.)
which: no nt in (/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.)
which: no aria in (/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.)
Flushing flashgot.net google.com googlesyndication.com hotmail.com informaction.com linuxquestions.org live.com maone.net mozilla.com mozilla.org mozillazine.org msn.com noscript.net passport.com passport.net passportimages.com yahoo.com yimg.com about:blank about:config about:credits about:neterror about:plugins chrome: file://flashgot.net file://google.com file://googlesyndication.com file://hotmail.com file://informaction.com file://linuxquestions.org file://live.com file://maone.net file://mozilla.com file://mozilla.org file://mozillazine.org file://msn.com file://noscript.net file://passport.com file://passport.net file://passportimages.com file://yahoo.com file://yimg.com http://flashgot.net http://google.com http://googlesyndication.com http://hotmail.com http://informaction.com http://linuxquestions.org http://live.com http://maone.net http://mozilla.com http://mozilla.org http://mozillazine.org http://msn.com http://noscript.net http://passport.com http://passport.net http://passportimages.com http://yahoo.com http://yimg.com https://flashgot.net https://google.com https://googlesyndication.com https://hotmail.com https://informaction.com https://linuxquestions.org https://live.com https://maone.net https://mozilla.com https://mozilla.org https://mozillazine.org https://msn.com https://noscript.net https://passport.com https://passport.net https://passportimages.com https://yahoo.com https://yimg.com resource:xscreensaver: 10:18:15: SIGHUP received: restarting...
xscreensaver: 10:18:15: running as perry/users (1000/100)
and also find in my Xorg.0.log:

Code:
(WW) RADEON(0): Option "VBERestore" is not used
am I outta luck? or is there an alternative to VBERestore? i'll need to read more about that, but if anyone already knows....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora - Wireless not working on DELL Inspiron 8500 kenrowe Linux - Laptop and Netbook 7 03-12-2006 10:15 AM
Linspire on a Dell Inspiron 8500 notebook filterfann Linux - Laptop and Netbook 1 12-26-2005 01:35 PM
Best Distro for Dell Inspiron 8500 spage0506 Fedora 1 06-25-2005 05:30 PM
Fedora C2 + Dell Inspiron 8500 1920x1200 resolution big_gie Linux - Laptop and Netbook 6 07-17-2004 11:52 PM
Is about ACPI for Dell Inspiron 8500 laptop chico58 Linux - Software 1 11-28-2003 02:01 PM


All times are GMT -5. The time now is 08:42 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration