Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 133743 - sys-apps/hal - broken handling of hibernate vs. suspend
Summary: sys-apps/hal - broken handling of hibernate vs. suspend
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Project Gentopia
URL:
Whiteboard:
Keywords:
: 141694 152163 152829 158004 158178 158527 161131 162325 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-18 21:54 UTC by BDKoepke
Modified: 2007-02-03 21:40 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to add real suspend capability to gnome-power-manager (hal-system-power-suspend.patch,463 bytes, patch)
2006-06-05 03:14 UTC, Gilles Dartiguelongue (RETIRED)
Details | Diff
revised suspend patch for hibernate-script (hal-0.5.7.1-hibernate.patch,461 bytes, patch)
2006-09-23 02:27 UTC, Huanwen Qu
Details | Diff
hal-0.5.7-hald-scripts.patch (hal-0.5.7-hald-scripts.patch,8.65 KB, patch)
2007-01-18 21:59 UTC, Gilles Dartiguelongue (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BDKoepke 2006-05-18 21:54:35 UTC
/usr/share/hal/hal-system-power-suspend needs detection script for either vbe tool 
or for hibernate-ram. (For advanced hibernation configuration). Works with gnome-power-manager. (deleted other configuration added lines /usr/sbin/hibernate-ram)
Comment 1 BDKoepke 2006-05-18 22:39:22 UTC
(In reply to comment #0)
> /usr/share/hal/hal-system-power-suspend needs detection script for either vbe
> tool 
> or for hibernate-ram. (For advanced hibernation configuration). Works with
> gnome-power-manager. (deleted other configuration added lines
> /usr/sbin/hibernate-ram)
> should have added script
elseif [ -x "/usr/sbin/hibernate-ram" ] ; then
/usr/sbin/hibernate-ram
RET=$?

Comment 2 BDKoepke 2006-05-22 16:18:13 UTC
gnome-power-manager does not auto reload config on boot. 
To fix it added 
> elseif [ -x "/usr/sbin/hibernate-ram" ] ; then
> /usr/sbin/hibernate-ram
> killall gnome-power-manager 
>RET=$?
> gnome-power-manager
now it reloads with the correct ammount of power (normally shows empty)


Comment 3 Doug Goldstein (RETIRED) gentoo-dev 2006-05-27 20:33:47 UTC
DBKoepke,

You're really not being clear on what the issue is... what needs to be changed. etc.
Comment 4 BDKoepke 2006-05-28 16:53:37 UTC
basically the file /usr/share/hal/hal-system-power-suspend needs a detection script for hibernate-ram, on my system and probably many others, suspend only works with the hibernate-script, or vbetool. If you could add vbetool support to the hald scripts than that would work, however it would be easier if you just added the lines above so then it will execute 'hibernate-ram' instead of 'echo "mem" > /sys/power/state' (which is the default). This is really only important for those people who have to use the suspend2-sources kernel for suspend. 
Comment 5 Gilles Dartiguelongue (RETIRED) gentoo-dev 2006-06-05 03:14:14 UTC
Created attachment 88413 [details, diff]
patch to add real suspend capability to gnome-power-manager

here is the patch, tested and working here, please consider adding it to the gnome-power-manager ebuild.
Comment 6 Saleem Abdulrasool (RETIRED) gentoo-dev 2006-06-05 20:39:22 UTC
The issue is with HAL, not gnome-power-manager
Comment 7 BDKoepke 2006-06-05 21:11:51 UTC
I agree, I should have directed this towards HAL and not gnome as this is a global HAL problem. 
Comment 8 Saleem Abdulrasool (RETIRED) gentoo-dev 2006-06-05 21:58:48 UTC
Fixed the patch and added it.
Comment 9 Gilles Dartiguelongue (RETIRED) gentoo-dev 2006-06-05 22:49:12 UTC
shall we report upstream as a patch for supporting gentoo ?
Comment 10 BDKoepke 2006-06-06 10:30:59 UTC
this is just a patch for people that have to use the hibernate-script in order to suspend to ram. This is not a gentoo specific problem, anyone that uses the hibernate script (even under another distrobution) will have the same problem. It may be better to report this directly to the HAL project, however I do not know if the hibernate-script is part of another distrobution or not. If someone else agrees that this is neccesairy, then I will report it directly to hal, and not as a gentoo-specific patch. 
Comment 11 BDKoepke 2006-06-06 17:43:57 UTC
At the moment, the patch doesn't work. I should have mentioned, the script must go before is detects the raw kernel interface otherwise it will always run echo mem /sys/power/state. 
it should look like this:
	elif [ -x "/usr/sbin/hibernate-ram" ] ; then
           # Use hibernate-ram if detected
	   /usr/sbin/hibernate-ram
	   RET=$?
	elif [ -w "/sys/power/state" ] ; then
	    # Use the raw kernel sysfs interface
	    echo "mem" > /sys/power/state
	    RET=$?
	else
	    # TODO: add other scripts support
	    unsupported
	    fi
sorry for the mix up
Comment 12 Gilles Dartiguelongue (RETIRED) gentoo-dev 2006-06-12 21:58:28 UTC
isn't it in hal-0.5.7-r3 already ?
Comment 13 BDKoepke 2006-06-12 22:10:01 UTC
(In reply to comment #12)
> isn't it in hal-0.5.7-r3 already ?

yes it is, however because it is placed after :
        elif [ -w "/sys/power/state" ] ; then
            # Use the raw kernel sysfs interface
            echo "mem" > /sys/power/state
            RET=$?
hibernate-ram never runs because the HAL always detects the raw kernel system interface and executes echo "mem" > /sys/power/state. (in order for suspend2 to work, you have to also have "mem" in /sys/power/state). The only way this will work is if the hibernate-ram detection is placed before the raw kernel interface is detected. 
Comment 14 Huanwen Qu 2006-09-22 16:24:48 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > isn't it in hal-0.5.7-r3 already ?
> 
> yes it is, however because it is placed after :
>         elif [ -w "/sys/power/state" ] ; then
>             # Use the raw kernel sysfs interface
>             echo "mem" > /sys/power/state
>             RET=$?
> hibernate-ram never runs because the HAL always detects the raw kernel system
> interface and executes echo "mem" > /sys/power/state. (in order for suspend2 to
> work, you have to also have "mem" in /sys/power/state). The only way this will
> work is if the hibernate-ram detection is placed before the raw kernel
> interface is detected. 
> 

I'm very supprised that this bug is still there:(

Nobody cares about it?

Comment 15 Huanwen Qu 2006-09-23 02:27:27 UTC
Created attachment 97825 [details, diff]
revised suspend patch for hibernate-script
Comment 16 Joseph Pingenot 2006-10-08 19:14:10 UTC
Can we please patch the existing, stable (x86) package, and push it out?  It's BROKEN for me on may laptop (#@%$! ATI).  This should fix the problem, since I *must* use hibernate-ram to have a shot at having anything but funky lines show up on my screen after suspend.
Comment 17 Jakub Moc (RETIRED) gentoo-dev 2006-10-26 00:24:00 UTC
*** Bug 141694 has been marked as a duplicate of this bug. ***
Comment 18 Jakub Moc (RETIRED) gentoo-dev 2006-10-26 00:24:16 UTC
*** Bug 152829 has been marked as a duplicate of this bug. ***
Comment 19 John N. Laliberte (RETIRED) gentoo-dev 2006-10-30 11:38:53 UTC
*** Bug 152163 has been marked as a duplicate of this bug. ***
Comment 20 Jakub Moc (RETIRED) gentoo-dev 2006-12-13 03:23:26 UTC
*** Bug 158004 has been marked as a duplicate of this bug. ***
Comment 21 Jakub Moc (RETIRED) gentoo-dev 2006-12-14 17:26:38 UTC
*** Bug 158178 has been marked as a duplicate of this bug. ***
Comment 22 Jakub Moc (RETIRED) gentoo-dev 2007-01-09 18:40:25 UTC
*** Bug 161131 has been marked as a duplicate of this bug. ***
Comment 23 Jakub Moc (RETIRED) gentoo-dev 2007-01-10 08:52:30 UTC
*** Bug 161131 has been marked as a duplicate of this bug. ***
Comment 24 Laurento Frittella (mrfree) 2007-01-10 09:01:57 UTC
I think hibernate-ram was wrongly added to hal-system-power-hibernate too.

I noticed the new script /usr/share/hal/scripts/hal-system-power-hibernate in
sys-apps/hal-0.5.7.1-r2 contains (before the "hibernate section"):

[...]
elif [ -x "/usr/sbin/hibernate-ram" ] ; then
  /usr/sbin/hibernate-ram
  RET=$?
[...]

We need to drop them out from the hibernate script (and leave it only in the suspend script).
For example, with the actual version, if I try to hibernate the system from the
gnome-power-manager my pc going to suspend.
Comment 25 Jakub Moc (RETIRED) gentoo-dev 2007-01-16 07:42:13 UTC
*** Bug 162325 has been marked as a duplicate of this bug. ***
Comment 26 Jon Howell 2007-01-16 19:13:08 UTC
Note that the two patches here are almost identical but different in an important way: the older patch tries hibernate-ram *after* the dumb kernel suspend, which means hibernate-ram never gets used. We want the second patch, instead.
Comment 27 Gilles Dartiguelongue (RETIRED) gentoo-dev 2007-01-16 21:12:22 UTC
Comment on attachment 88413 [details, diff]
patch to add real suspend capability to gnome-power-manager

To make this crystal clear, I'm marking my patch as obsolete.
Comment 28 Doug Goldstein (RETIRED) gentoo-dev 2007-01-18 05:25:11 UTC
Fixed in hal-0.5.7.1-r3
Comment 29 Santiago Gala 2007-01-18 11:26:28 UTC
The ebuild, as of now, fails to unpack:

 * Failed Patch: hal-0.5.7.1-hibernate-fix-r1.patch !
 *  ( /usr/portage/sys-apps/hal/files/hal-0.5.7.1-hibernate-fix-r1.patch )
Comment 30 Doug Goldstein (RETIRED) gentoo-dev 2007-01-18 14:20:20 UTC
Well since neither of the patches actually apply to anything, you guys are going to have to deal with it broken for some more time. Until someone can provide a working patch.
Comment 31 Martin von Gagern 2007-01-18 20:59:57 UTC
Notice bug 162624 about the fact that the patch from comment 15 won't apply.
There is a conflict between that one and hal-0.5.7-hald-scripts.patch.
So if this patch is what you want, make those two patches play nice.

Should hibernate-ram be before or after this block?

elif  [ "$HAL_PROP_POWER_MANAGEMENT_TYPE" = "pmu" ]; then
  #PMU systems cannot use /sys/power/state yet, so use a helper to issue an ioctl
  hal-system-power-pmu sleep
Comment 32 Gilles Dartiguelongue (RETIRED) gentoo-dev 2007-01-18 21:59:39 UTC
Created attachment 107396 [details, diff]
hal-0.5.7-hald-scripts.patch

Drop in replacement for current hal-0.5.7-hald-scripts.patch, this one should do the right thing (tm),

you should remove :
hal-0.5.7-hibernate.patch
hal-0.5.7.1-hibernate-fix.patch

which are either obsoleted by this patch or don't do what they are supposed to do.
Comment 33 Serge Gavrilov 2007-01-21 09:41:06 UTC
It seems this trivial bug will never be fixed :(
Comment 34 Doug Goldstein (RETIRED) gentoo-dev 2007-01-22 00:46:22 UTC
I've attempted to fix it 4 times. I don't use hibernate support at all, unfortunately, NO one can provide a functional patch ever.

I will try Gilles latest patch for the next revision.
Comment 35 Gilles Dartiguelongue (RETIRED) gentoo-dev 2007-01-22 07:43:13 UTC
Doug, thanks for taking care of this. I hope I can help with hibernate stuff as soon as I'll be a gentoo dev (which I hope should be soon).
Comment 36 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-01-26 02:33:22 UTC
*** Bug 158527 has been marked as a duplicate of this bug. ***
Comment 37 Doug Goldstein (RETIRED) gentoo-dev 2007-01-30 16:01:34 UTC
Still does not apply.
Comment 38 Doug Goldstein (RETIRED) gentoo-dev 2007-01-30 16:05:50 UTC
Fixed for hal-0.5.7.1-r4
Comment 39 Gilles Dartiguelongue (RETIRED) gentoo-dev 2007-02-03 21:40:54 UTC
yes, the scripts are good now, thanks you so much :)