# Suspend

## thom_raindog

Hi there,

looking through a few of the howtos on gentoo-wiki.com I didn't get one question answered:

Do I HAVE to patch the kernel in order to make things like suspend2ram and suspend2disk work?

I have been unsure about how recent those texts were, so I would need some clearance on that..

----------

## zogle

Howdy,

I didn't need to but in all honesty it depends what kernel you are using. i am still using a 2.6.23 tuxonice r10 while i tinker around with the newer kernels ( 2.6.25-[whatever sources you are using]-r6). just as important as what version, what source you using? the gentoo sources ?? vanella sources ?? tuxonice sources (highly recommended for laptops which i assume you have ) or a number of other sources ??.

to further answer your question, correct me if i am wrong,  i believe you only needed the patches for kernels before say 2.6.19 ???? can anyone verify.  In all honesty, it isn't really important unless you wanted an older kernel. if you are using the newer kernels you should be fine. you just need to investigate what options to turn on in your .config file before compiling =]

good luck

----------

## thom_raindog

I am on a AMD64 Desktop and use the gentoo sources.

I would like to in the end have my PC set so that it suspends after a certain time of idling, therefore I study that subject.

Don't I need any patches for the gentoo kernel? Some tuxonice stuff? That IS what I am confused about..

----------

## thom_raindog

Any more hints on that? I am still confused as to whether I need to patch my gentoo-sources kernel (2.6.25-gentoo-r7) and if NOT how I would set up suspend (2disk and 2ram would be perfect).

----------

## jcat

The Wiki is patchy, and not official gentoo docs.

How about the official guide to power management, seems to provide the necessary kernel options and packages required:

http://www.gentoo.org/doc/en/power-management-guide.xml#doc_chap7

Cheers,

jcat

----------

## baeksu

Tuxonice is different from µswsusp.

By your question, I'm assuming you want to use s2ram and s2disk commands, which are part of µswsusp.

To use those, you do not need to patch the kernel. Just make sure you enable the standard suspend options. You also do not necessarily need hibernate-script.

I recently switched to tuxonice, which works better with splash (at least for me). For that, I would recommend using the tuxonice-sources available in portage. Tuxonice is basically the standard gentoo-sources plus tuxonice patches.

----------

## thom_raindog

I looked at the gentoo page (sorry, tuxonice seems one step further for me, being not that experienced yet..) and it would appear I have all it takes.

Yet, hibernating does not work. I get:

```

hibernate: Aborting suspend due to errors in ModulesUnload (use --force to override).

```

Should I really use --force?

Edit: I simply tried and it worked. But I get 

```

Some modules failed to unload: nvidia

```

twice before it hibernated. Still hibernation and waking up seems to work rather flawlessly..

----------

## DirtyHairy

That's no problem per se; I'm assuming X is running, and then the nvidia modules can't be unloaded as they are in use. Unless they don't sleep properly, that's no problem. Suspend to RAM has been working in the kernel for ages without any patches (allthough there are some machines I could never get to resume properly). Also for ages there has been suspend to disk support in 2.6 which has worked for me without problems for years. Tuxonice is an independent implementation of suspend to disk that is renowned to work better on some systems and offers more options like encryption and compression of the image, but unless you need those or have problems with it, the in-kernel support should be sufficient.

----------

## thom_raindog

Aha.. thanks.

Well, since S2Disk seems to work just fine I will move on to the next step: Integrating that into KDE as per my wishes  :Very Happy: 

I will do that in a different post though:

https://forums.gentoo.org/viewtopic-p-5189781.html#5189781

Thanks guys.

----------

