You are not logged in.

#1 2008-02-06 04:33:41

SpookyET
Member
Registered: 2008-01-27
Posts: 410

pm-utils-opensuse (suspend, hibernate)

Hello all.

For many of us, including me, kernel suspend and hibernate do not work. However, userspace suspend and hibernate does work. This package attempts to add support for uswsusp (s2ram, s2disk, s2both).

pm-utils is used by hal, which is used by gnome. If you want to suspend from gnome, this is the only way.

If you do not have uswsusp installed, the kernel method will be used.

For more information, see http://en.opensuse.org/Pm-utils

Please test it.

Jan de Groot, please have a look at it, you know more about the arch patches than I do. One of them conflicts and was commented it out.

GET IT HERE

Last edited by SpookyET (2008-03-08 20:20:59)

Offline

#2 2008-02-12 19:37:52

signor_rossi
Member
Registered: 2007-08-24
Posts: 257

Re: pm-utils-opensuse (suspend, hibernate)

Dead link to packge on AUR!!

Bye, signor_rossi.

Offline

#3 2008-02-12 20:00:02

SpookyET
Member
Registered: 2008-01-27
Posts: 410

Re: pm-utils-opensuse (suspend, hibernate)

Link fixed.

Offline

#4 2008-02-12 21:38:59

signor_rossi
Member
Registered: 2007-08-24
Posts: 257

Re: pm-utils-opensuse (suspend, hibernate)

Oh my, suspend to RAM worked for the first time on my HP nx8220 in Arch Linux. smile:)
No extra options where needed, just '-f' because the laptop is not known to s2ram. This is the log:

[root@tux val]# cat /var/log/pm-suspend.log
Di 12. Feb 22:29:51 CET 2008: running suspend hooks.
===== Di 12. Feb 22:29:51 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/00clear =====
===== Di 12. Feb 22:29:51 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/01grub =====
===== Di 12. Feb 22:29:51 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/05led =====
===== Di 12. Feb 22:29:51 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/10NetworkManager =====
===== Di 12. Feb 22:29:52 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/11netcfg =====
===== Di 12. Feb 22:29:52 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/20video =====
kernel.acpi_video_flags = 0
===== Di 12. Feb 22:29:52 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/49bluetooth =====
===== Di 12. Feb 22:29:52 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/50modules =====
===== Di 12. Feb 22:29:52 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/55battery =====
===== Di 12. Feb 22:29:52 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/65alsa =====
===== Di 12. Feb 22:29:52 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/90clock =====
===== Di 12. Feb 22:29:53 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/94cpufreq =====
===== Di 12. Feb 22:29:53 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/95led =====
===== Di 12. Feb 22:29:53 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/99video =====
Di 12. Feb 22:29:53 CET 2008: done running suspend hooks.
+ /usr/sbin/s2ram -f
Switching from vt7 to vt1
fbcon fb0 state 1
fbcon fb0 state 0
switching back to vt7
+ RET=0
+ set +x
Di 12. Feb 22:30:11 CET 2008: running resume hooks.
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/99video =====
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/95led =====
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/94cpufreq =====
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/90clock =====
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/65alsa =====
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/55battery =====
method return sender=:1.0 -> dest=:1.36
   boolean true
method return sender=:1.0 -> dest=:1.37
   boolean true
method return sender=:1.0 -> dest=:1.38
   boolean false
method return sender=:1.0 -> dest=:1.39
   boolean false
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/50modules =====
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/49bluetooth =====
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/20video =====
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/11netcfg =====
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/10NetworkManager =====
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/05led =====
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/01grub =====
===== Di 12. Feb 22:30:11 CET 2008: running hook: /usr/lib/pm-utils/sleep.d/00clear =====
Di 12. Feb 22:30:11 CET 2008: done running resume hooks.

I also have installed uswsusp from AUR, it is used, right?
Hope it works in the long term too. wink

Thank you, signor_rossi.

Last edited by signor_rossi (2008-02-12 21:40:45)

Offline

#5 2008-02-12 21:53:44

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: pm-utils-opensuse (suspend, hibernate)

SpookyET wrote:

Hello all.

For many of us, including me, kernel suspend and hibernate do not work. However, userspace suspend and hibernate does work. This package attempts to add support for uswsusp (s2ram, s2disk, s2both).

pm-utils is used by hal, which is used by gnome. If you want to suspend from gnome, this is the only way.

If you do not have uswsusp installed, the kernel method will be used.

For more information, see http://en.opensuse.org/Pm-utils

Please test it.

Jan de Groot, please have a look at it, you know more about the arch patches than I do. One of them conflicts and was commented it out.

GET IT HERE

I don't understand what you're getting at... Pm-utils is in exxtra for quite some time.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#6 2008-02-12 22:18:26

SpookyET
Member
Registered: 2008-01-27
Posts: 410

Re: pm-utils-opensuse (suspend, hibernate)

B wrote:

I don't understand what you're getting at... Pm-utils is in exxtra for quite some time.

It's a modified version with userspace support. For most people, kernel suspend does not work.

Last edited by SpookyET (2008-02-12 22:26:59)

Offline

#7 2008-02-12 22:25:51

SpookyET
Member
Registered: 2008-01-27
Posts: 410

Re: pm-utils-opensuse (suspend, hibernate)

signor_rossi wrote:

Oh my, suspend to RAM worked for the first time on my HP nx8220 in Arch Linux. smile:)
No extra options where needed, just '-f' because the laptop is not known to s2ram. This is the log:

I also have installed uswsusp from AUR, it is used, right?
Hope it works in the long term too. wink

Thank you, signor_rossi.

That's the idea. I did not want to add uswsusp as a dependency because it is supposed to work with kernel instead of userspace as well, like the official pm-utils.

Add '-f' to '/etc/pm/config.d/defaults'

HIBERNATE_RESUME_POST_VIDEO="no"
SUSPEND_MODULES=""
HIBERNATE_METHOD={userspace,kernel} # selects the suspend to disk method. Defaults to userspace.
S2RAM_OPTS="-f" # options that are passed to s2ram. See also s2ram for more information.

From now on, you can suspend from gnome or use pm-suspend and pm-hibernate. There is no need to call s2ram, s2disk, s2both directly.
I also suggest installing 'vlock'. So, if you want to suspend from tty1-6, you can type 'pm-suspend && vlock'. When you resume, it will prompt for your password.
I might create a patch for vlock support.

Offline

#8 2008-02-13 08:01:51

signor_rossi
Member
Registered: 2007-08-24
Posts: 257

Re: pm-utils-opensuse (suspend, hibernate)

So the old pm-utils in extra wouldn't call s2ram through pm-suspend? And your pm-utils does, is that the only change? If so perhaps only the new kernel alllows me to suspend via s2ram now, since I recall that I tried only the pm-suspend command from extra with the 2.6.24 kernel and that didn't work. But when I installed uswsusp form AUR some time ago I had an older kernel I did try to suspend via the the s2ram command directly and that didn't work also. Interestingly I cannot resume when I suspend from console, but I will certainly play around with some new packages/settings combinations.

Thanks, signor_Rossi.

Offline

#9 2008-02-13 08:22:19

signor_rossi
Member
Registered: 2007-08-24
Posts: 257

Re: pm-utils-opensuse (suspend, hibernate)

Update:
pm-utils from extra + uswsusp from AUR (s2ram -f) -> doesn't resume
your pm-utils from AUR + same uswsusp from AUR (s2ram -f) -> resume works from X
I didn't add the uresume hook and didn't rebuild initrd this time as stated in uswsusp docu, but did these steps when I did my first tests with uswsusp and kernel-2.6.23.

Bye, signor_rossi.

Last edited by signor_rossi (2008-02-13 08:23:39)

Offline

#10 2008-02-13 09:53:22

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: pm-utils-opensuse (suspend, hibernate)

Just one strong recommendation: if pm-utils works for you as an interface to s2ram and if you need the force option plus perhaps a certain combination of other options, PLEASE report the output of 's2ram -i' and the minimal working combination of options to the suspend-devel mailing list, so that your laptop can be properly whitelisted in the next uswsusp release! For the moment you can also recompile uswsusp adding your laptop to the whitelist in your local uswsusp, following the instructions in uswsusp.install. This is required if you want to use s2both, because s2both has no force option.

Finally, note that, if you do not need hal and gnome support, then also the hibernate-script supports fully s2ram, s2disk and s2both.


Mortuus in anima, curam gero cutis

Offline

#11 2008-02-13 10:27:57

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: pm-utils-opensuse (suspend, hibernate)

Please note that pm-hibernate will not work, because it looks for a s2disk configuration file in /var/lib/s2disk.conf (the dumbest possible place where to look for a config file), while the uswsusp package installs it where the developers of uswsusp think it should go, that is in /etc/suspend.conf.
You can fix this defining the S2DISK_CONF variable in  /etc/pm/power.d/config. Perhaps this configuration file could be provided in the package, including also SUSPEND_MODULES, RESUME_MODULES and the s2ram options...

Last edited by patroclo7 (2008-02-13 11:20:35)


Mortuus in anima, curam gero cutis

Offline

#12 2008-02-13 10:37:20

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: pm-utils-opensuse (suspend, hibernate)

For those trying to emulate the hibernate-script behavior with pm-utils, please note that there is no simple way to stop or restart system services. You need to write a hook for that and to place it in /etc/pm/sleep.d, but at the moment I do not understand how to define what should be done during suspend and what should be done during resume. The open-suse webpage is not explanatory, any help appreciated (for myself I am immediately back to the hibernate-script, but since I maintain uswsusp in AUR and many people will be forced by gnome to use this package, I feel obliged to learn how it works).


Mortuus in anima, curam gero cutis

Offline

#13 2008-02-13 13:15:11

SpookyET
Member
Registered: 2008-01-27
Posts: 410

Re: pm-utils-opensuse (suspend, hibernate)

patroclo7 wrote:

Please note that pm-hibernate will not work, because it looks for a s2disk configuration file in /var/lib/s2disk.conf (the dumbest possible place where to look for a config file), while the uswsusp package installs it where the developers of uswsusp think it should go, that is in /etc/suspend.conf.
You can fix this defining the S2DISK_CONF variable in  /etc/pm/power.d/config. Perhaps this configuration file could be provided in the package, including also SUSPEND_MODULES, RESUME_MODULES and the s2ram options...

Please create a patch and I'll add it to the package. Also, there is one patch that conflicts with suse's patches, which was disabled. It seems to be for kernel suspend. It's called pm-utils-opensuse for a reason. Look at the http://aur.archlinux.org/packages/pm-ut … use.tar.gz . I didn't touch it besides applying the suse patches.

Offline

#14 2008-02-13 13:52:25

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: pm-utils-opensuse (suspend, hibernate)

I propose the following emended package where:
1) all the arch and opensuse patches (including the nosleep one) are unified in an unique patch which applies cleanly;
2) rpmextract is no longer a dependency
3) a default config is installed in /etc/pm/config.d, fixing the above issue with s2disk.

http://www.patroclo7.org/archlinux/myau … use.tar.gz


Mortuus in anima, curam gero cutis

Offline

#15 2008-02-13 14:03:41

SpookyET
Member
Registered: 2008-01-27
Posts: 410

Re: pm-utils-opensuse (suspend, hibernate)

patroclo7 wrote:

I propose the following emended package where:
1) all the arch and opensuse patches (including the nosleep one) are unified in an unique patch which applies cleanly;
2) rpmextract is no longer a dependency
3) a default config is installed in /etc/pm/config.d, fixing the above issue with s2disk.

http://www.patroclo7.org/archlinux/myau … use.tar.gz

The idea behind using rpmextract is that I have not wanted to manage the suse patches manually. This way I can package it faster (i.e. changing the version), and it will automatically deal with everything and apply the patches. I would only look at it if something broke. Is it advisable to relinquish that flexibility and efficiency to clean up the package?

/etc/pm/config.d/defaults exists

I look at it. I have a finance exam. So, I'll probably do it tomorrow after the exam.

Last edited by SpookyET (2008-02-13 14:06:16)

Offline

#16 2008-02-13 14:13:55

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: pm-utils-opensuse (suspend, hibernate)

1) rpmextract should never be used if not necessary. Personally I do not like to have it installed at all, because we have already our native package manager. Moreover I do not think that you are going to have big problems with updates. The suse rpm is rarely updated (8 months old ATM and, moreover, all the patches concerning uswsusp support are reaching the mainstream of pm-utils, so that no opensuse patch will be needed with the next version of pm-utils).
2) I think that you are looking at /usr/lib/pm-utils/defaults, which should not be edited at all (as stated in the file itself). Nothing is installed by your PKGBUILD in /etc/pm/config.d (obviously may be you have added a config file there by hand).


Mortuus in anima, curam gero cutis

Offline

#17 2008-02-13 14:14:34

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: pm-utils-opensuse (suspend, hibernate)

And good luck with your exam smile


Mortuus in anima, curam gero cutis

Offline

#18 2008-02-13 14:55:53

SpookyET
Member
Registered: 2008-01-27
Posts: 410

Re: pm-utils-opensuse (suspend, hibernate)

patroclo7 wrote:

And good luck with your exam smile

Thank you.

There is one thing that's been bugging me. If you suspend from gnome, it activates the screensaver. It will prompt you for a password upon resume. If you do it from the command line, it will not, not to mention that the tty1-6 stay unlocked.

Can you look into adding a vlock and gnome-lock, kde-lock, etc.?

Basically, it should be a loop. for tty1-n, execute vlock. If tty7-8 have xorg, check the desktop environment and execute the lock screen feature.

It's a major security hole, especially for laptops.

Thanks.

Offline

#19 2008-02-13 15:08:19

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: pm-utils-opensuse (suspend, hibernate)

I think that you should propose this feature in the upstream of pm-utils. Perhaps one could use always and only vlock, since vlock can be used from X with the -n option.
I think also that it should be optional, there are scenarios when one does not want to lock anything.
Anyway I doubt that this can be easily done at the level of packaging.


Mortuus in anima, curam gero cutis

Offline

#20 2008-02-13 16:04:01

SpookyET
Member
Registered: 2008-01-27
Posts: 410

Re: pm-utils-opensuse (suspend, hibernate)

patroclo7 wrote:

I think that you should propose this feature in the upstream of pm-utils. Perhaps one could use always and only vlock, since vlock can be used from X with the -n option.
I think also that it should be optional, there are scenarios when one does not want to lock anything.
Anyway I doubt that this can be easily done at the level of packaging.

It's just another patch, just like the other patches. It can be done at the level of packaging. Yes, it should be optional. If you're going to wait for someone else to do it, it will take months. The best way is to just do it and propose the patch.

It's not complicated. It's similar to uswusp support.

if vlock exists:
  do the loop and lock them

Offline

#21 2008-02-13 16:21:24

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: pm-utils-opensuse (suspend, hibernate)

Ok, but since I do not personally lock my session during suspension, I am not the right man smile


Mortuus in anima, curam gero cutis

Offline

#22 2008-02-13 16:30:33

SpookyET
Member
Registered: 2008-01-27
Posts: 410

Re: pm-utils-opensuse (suspend, hibernate)

Help others help you:-)

Offline

#23 2008-02-20 09:23:05

lloeki
Member
From: France
Registered: 2007-02-20
Posts: 456
Website

Re: pm-utils-opensuse (suspend, hibernate)

For those trying to emulate the hibernate-script behavior with pm-utils, please note that there is no simple way to stop or restart system services. You need to write a hook for that and to place it in /etc/pm/sleep.d

easy.

$ cat /etc/pm/sleep.d/50-stop_daemon
#/bin/sh

if [ "$1" == "hibernate" ]; then
    /etc/rc.d/daemon stop
fi
if [ "$1" == "thaw" ]; then
    /etc/rc.d/daemon start
fi

don't forget to 'chmod +x' it

you can also use suspend/resume for RAM suspension instead of hibernate/thaw

Last edited by lloeki (2008-02-20 13:50:50)


To know recursion, you must first know recursion.

Offline

#24 2008-02-20 11:01:14

zyghom
Member
From: Poland/currently Africa
Registered: 2006-05-11
Posts: 432
Website

Re: pm-utils-opensuse (suspend, hibernate)

pm-utils is working without problem  - what for to stop daemons ?
the only hook I use is to rmmod wlan module and later to insert it again


Zygfryd Homonto

Offline

#25 2008-02-20 13:50:06

lloeki
Member
From: France
Registered: 2007-02-20
Posts: 456
Website

Re: pm-utils-opensuse (suspend, hibernate)

I don't know, but hey, the guy asked, and I had the answer.
anyway, everyone has different configurations, and different needs.

that's the beauty of it: whatever the case you can make it do what you want smile


To know recursion, you must first know recursion.

Offline

Board footer

Powered by FluxBB