Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 268133 - sys-power/hibernate-script-2.0 Making USuspendRam* Options available for s2both
Summary: sys-power/hibernate-script-2.0 Making USuspendRam* Options available for s2both
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Alon Bar-Lev (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2009-05-01 17:08 UTC by samLT
Modified: 2013-01-12 17:39 UTC (History)
0 users

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


Attachments
Patch to add the USuspendBothForce option (hibernate-script-2.0-USuspendBothForce.patch,3.07 KB, patch)
2009-05-06 08:26 UTC, samLT
Details | Diff
ebuild using this patch (hibernate-script-2.0-r2.ebuild,1.80 KB, text/plain)
2009-05-06 08:27 UTC, samLT
Details
hibernate-script-2.0-USuspendBothForce.patch (hibernate-script-2.0-USuspendBothForce.patch,3.07 KB, text/plain)
2009-05-06 08:34 UTC, samLT
Details
hibernate-script-2.0-USuspend-use-long-options.patch (hibernate-script-2.0-USuspend-use-long-options.patch,5.58 KB, patch)
2009-05-06 18:37 UTC, samLT
Details | Diff
hibernate-script-2.0-USuspendRam-options-for-s2both.patch (hibernate-script-2.0-USuspendRam-options-for-s2both.patch,2.56 KB, patch)
2009-05-06 18:38 UTC, samLT
Details | Diff
hibernate-script-2.0-r2.ebuild (hibernate-script-2.0-r2.ebuild,1.87 KB, text/plain)
2009-05-06 18:38 UTC, samLT
Details
hibernate-script-2.0-USuspendRam-options-for-s2both.patch (hibernate-script-2.0-USuspendRam-options-for-s2both.patch,2.55 KB, patch)
2009-05-07 16:20 UTC, samLT
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description samLT 2009-05-01 17:08:31 UTC
Hello,

My machine is unknown to s2ram, fortunately adding the --force option is enough to get s2ram to work.

s2ram --force: works as expected (both from X and the console)
s2disk: works as expected (both from X and the console)
s2both == s2disk, but
s2both --force: works as expected (both from X and the console)


Now, with the hibernate script:

Since I need to use --force for s2ram, I set 'USuspendRamForce' to 'yes' in /etc/hibernate/ususpend-ram.conf. This result in the following behaviour:

hibernate-ram: works as expected ( == s2ram)
hibernate -F /etc/hibernate/ususpend-disk.conf: works as expected ( == s2disk)

but

hibernate -F /etc/hibernate/ususpend-both.conf: doesn't work as expected since the computer is shutdown.

I tried adding "USuspendRamForce yes" to /etc/hibernate/ususpend-both.conf, but that didn't help.

(I even tried the potential hidden option: "USuspendBothForce yes"... :p )

Anyway, the hibernate script should give the possibility to --force s2both, as it does for s2ram

Reproducible: Always

Actual Results:  
hibernate -F /etc/hibernate/ususpend-both.conf does a 's2both' instead of 's2both --force' which then is equivalent to just do a 's2disk'

Expected Results:  
The ability to resume from RAM

Workaround: use s2both directly

hibernate -F /etc/hibernate/ususpend-both.conf  -v3
hibernate: Including configuration from common.conf
hibernate: [01] Executing CheckLastResume ...
hibernate: [01] Executing CheckRunlevel ...
hibernate: [01] Executing LockFileGet ...
hibernate: [01] Executing NewKernelFileCheck ...
hibernate: [10] Executing EnsureUSuspendCapable ...
hibernate: [11] Executing XHacksSuspendHook1 ...
hibernate: [19] Executing LogoutPidgin ...
Logging out sam's Pidgin using D-Bus session bus address
No existing libpurple instance detected.
hibernate: [59] Executing RemountXFSBootRO ...
hibernate: [89] Executing SaveKernelModprobe ...
Saved /proc/sys/kernel/modprobe is /sbin/modprobe
hibernate: [91] Executing ModulesUnloadBlacklist ...
Unloading blacklisted modules listed /etc/hibernate/blacklisted-modules
Module version for ipw2100 is
Module version for ipw2200 is
Module version for snd_bt_sco is
Module version for ndiswrapper is
Unloading blacklisted module uvcvideo (and dependencies)
Unloading uvcvideo ...
Removing modules with rmmod.
hibernate: [95] Executing XHacksSuspendHook2 ...
xhacks: changing console from 7 to 15
hibernate: [98] Executing CheckRunlevel ...
hibernate: [99] Executing DoUSuspend ...
hibernate: Running /usr/sbin/s2both ...
hibernate: [90] Executing ModulesLoad ...
Loading module uvcvideo (from auto)...
hibernate: [89] Executing RestoreKernelModprobe ...
hibernate: [85] Executing XHacksResumeHook2 ...
xhacks: changing console back to 7
hibernate: [70] Executing ClockRestore ...
hibernate: [59] Executing RemountXFSBootRW ...
hibernate: [19] Executing LoginPidgin ...
Logging back (to status ) sam's Pidgin using D-Bus session bus address
No existing libpurple instance detected.
hibernate: [11] Executing XHacksResumeHook1 ...
hibernate: [01] Executing NoteLastResume ...
hibernate: [01] Executing LockFilePut ...
Comment 1 samLT 2009-05-06 08:26:27 UTC
Created attachment 190480 [details, diff]
Patch to add the USuspendBothForce option

With this patch, it's now possible to use the hibernate script to do a ususpend-both, even if the machine is unknown to s2ram. One just need to set USuspendBothForce to yes in (for example) /etc/hibernate/ususpend-both.conf
Comment 2 samLT 2009-05-06 08:27:09 UTC
Created attachment 190481 [details]
ebuild using this patch
Comment 3 samLT 2009-05-06 08:27:44 UTC
--- hibernate-script-2.0-r1.ebuild      2009-05-05 15:34:48.000000000 +0200
+++ hibernate-script-2.0-r2.ebuild      2009-05-06 08:15:56.000000000 +0200
@@ -25,6 +25,7 @@ src_unpack() {
        cd "${S}"
 
        epatch "${FILESDIR}/${P}-init.d.patch"
+       epatch "${FILESDIR}/${P}-USuspendBothForce.patch"
 }
 
 src_install() {
Comment 4 samLT 2009-05-06 08:34:01 UTC
Created attachment 190483 [details]
hibernate-script-2.0-USuspendBothForce.patch

typo in my previous patch: ( need => needs )
Comment 5 samLT 2009-05-06 18:37:44 UTC
Created attachment 190520 [details, diff]
hibernate-script-2.0-USuspend-use-long-options.patch

From this debian bug report http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505410 it seems s2both should accept every USuspendRam* options.

The attached patches are an improvement over the one posted on 'bdo' (as opposed to 'bgo' ;) )

First patch ( hibernate-script-2.0-USuspend-use-long-options.patch ):
* uses long options instead of short ones because for example s2both doesn't support the '-f' (for --force) short option. Same for the '-a' short option ( --acpi_sleep )
* adapts the comments about the different USuspendRam* options in ususpend-ram.conf to reflect that changes.


And the second patch ( hibernate-script-2.0-USuspendRam-options-for-s2both.patch )
* also suggests for the suspend-to-both method to read about s2ram, and USuspendRamForce if the machine is unknown and the option unset.

* Duplicates and adapts the comments about the different USuspendRam* options in and from ususpend-ram.conf to ususpend-both.conf
Comment 6 samLT 2009-05-06 18:38:27 UTC
Created attachment 190521 [details, diff]
hibernate-script-2.0-USuspendRam-options-for-s2both.patch
Comment 7 samLT 2009-05-06 18:38:54 UTC
Created attachment 190523 [details]
hibernate-script-2.0-r2.ebuild
Comment 8 samLT 2009-05-07 16:20:29 UTC
Created attachment 190633 [details, diff]
hibernate-script-2.0-USuspendRam-options-for-s2both.patch

Use s2ram for EnsureUSuspendCapable function, as s2both doesn't support the --test option

And, this should be the last change I make.
Comment 9 Pacho Ramos gentoo-dev 2012-12-16 14:24:59 UTC
This package is now orphan:
http://my.opera.com/pacho/blog/2012/11/27/about-maintainer-needed
Comment 10 Alon Bar-Lev (RETIRED) gentoo-dev 2013-01-12 17:39:09 UTC
Fixed in hibernate-script-2.0-r6

Thanks!