# Suspend2 2.6.18 & genkernel

## Mythril

Hi,

I was  using suspend2-sources-2.6.16-r8 and hibernate-script-1.12-r1 until now but I upgraded to

suspend2-sources-2.6.18 and hibernate-script-1.93-r6 and it does not work anymore

I can hibernate without problem but when resuming, everything works fine until suspend2 tries to load the swap and fails with message "Unable to find swap-space signature".

I have looked on Google and it seems to be related to the initramfs generated by genkernel :

With the previous versions of suspend2-sources and hibernate-script, you had to update the /usr/share/genkernel/generic/linuxrc file and add the line 'echo > /proc/suspend2/do_resume' after 'mount -t proc proc /proc'. But in the new version of suspend2, location of /proc/suspend2 has been changed to /sys/power/suspend2 and thus updating the line to 'echo > /sys/power/suspend2/do_resume' does not work anymore (maybe /sys has not been loaded yet).

So, I think it is just a matter of adding a line or two in genkernel's linuxrc file but I can't find where.

Anyone who was able to have this work with genkernel and the latest versions of suspend2-sources and hibernate-script ?

Thanks !

----------

## Snoozz

I have the same problem :s. Doesn't anyone know what to do?

K found it!

This is what you'll have to do:

1.open /usr/share/genkernel/generic/linuxrc with your favorite editor

2.Search for the line: exec /bin/busybox chroot (normally line number 764)

3.Replace everything from "exec /bin/busybox chroot . /bin/sh <<- EOF" to "        exec /sbin/init ${REAL_INIT}

EOF" WITH

```

        exec /bin/busybox chroot . /bin/sh <<- EOF

        mount -t sysfs none /sys

        mount -t proc proc /proc >/dev/null 2>&1

        echo > /sys/power/suspend2/do_resume

        umount /proc;umount /sys ; mount -o remount,rw / >/dev/null 2>&1

        exec /sbin/init ${REAL_INIT}

EOF

```

4a. genkernel --install initrd

4b People with gensplash: genkernel --install --gensplash=yourtheme initrd

Voila, enjoy hibernate  :Wink: 

----------

## Mythril

yep ! worked for me too !

Thanks !   :Very Happy: 

I just had to remove the 'mount -o remount,rw' command cause fsck failed at boot with a message telling / was mounted so checking it would be dangerous.

Thanks a lot.

----------

## punter

I'm using the same kernel and hibernate-script... but my hibernation worked in an unusual manner:

it resumed not after the kernel loading, but even _after_ the modules were loaded.

there is a "suspend2_resume" command in the middleware of linuxrc file.... what did you guys do with that?

my resume works fine when it reaches that command, but i'm concerned about my root partition...

do you guys know if i should leave it as is... or alter the start to resume at that point?

cheers,

shane

----------

## Mythril

 *punter wrote:*   

> I'm using the same kernel and hibernate-script... but my hibernation worked in an unusual manner:
> 
> it resumed not after the kernel loading, but even _after_ the modules were loaded.
> 
> there is a "suspend2_resume" command in the middleware of linuxrc file.... what did you guys do with that?
> ...

 

I've got the same behaviour... Don't know anything about how this works internally but it seems to work fine for me...

----------

## punter

well, i can confirm that the default "suspend2_resume" command in the linuxrc file is not sufficient..... it hanged my computer 5 minutes after resuming....

so, we need to put the resume operation at the start.... but how do you know whether to use the traditional "echo > /proc" approach, or this new "suspend2_resume" command ??

----------

