LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (http://www.linuxquestions.org/questions/mandriva-30/)
-   -   2006 and suspend - needs vbetool to work (http://www.linuxquestions.org/questions/mandriva-30/2006-and-suspend-needs-vbetool-to-work-403355/)

grcore 01-14-2006 02:43 PM

2006 and suspend - needs vbetool to work
 
I need a bit of direction. I finally have the ACPI issues straightened out on my laptop, and have one more thing I need to do.

I need to use vbetool to store the video state prior to suspend to RAM, and restore it after the wake up. Problem is, I do not know how to implement it so its automatic.

I created a test script that works, so I know the vbetool utility is doing its job, I could just use a little direction on what scripts I need to edit to make it work.

Thanks

g

grcore 01-16-2006 05:47 PM

Ok, after looking through the scripts and folders that it should be running, this is what I found.

There is a script /usr/sbin/pmsuspend2 that starts the suspend process.

This calls the script /etc/sysconfig/suspend-scripts/suspend.control

which processes each script in
/etc/sysconfig/suspend-scripts/suspend.d

I created a script called video, using one of the other scipts as a template.
Code:

#!/bin/bash
# -*- Mode: shell-script -*-
# Copyright (C) 2003 by MandrakeSoft, Chmouel Boudjnah <chmouel@mandrakesoft.com>
# Redistribution of this file is permitted under the terms of the GNU
# Public License (GPL)
#
# resume: 20
#
 
ARG=$1
 
function suspend {
    /usr/bin/chvt 1
    /usr/sbin/vbetool vbestate save > /tmp/video-state
    true;
}
 
function resume {
    /usr/sbin/vbetool vbestate restore < /tmp/video-state
    /usr/bin/chvt 7
}
 
case $ARG in
    suspend)
suspend
;;
    resume)
resume
;;
esac

debugging it, I see that the resume function gets called, but the suspend function never gets run.

Suggestions? Or am I going about this the wrong way?

Thanks

g


All times are GMT -5. The time now is 10:59 AM.