Updated on 22 April 2007
Working setups: 2.6.19 for suspend2-2.2.9 (SUSE linux 10.2) and 2.6.18-rc1 for suspend2-2.2.7.3 (SUSE linux 10.0)
The following commands shall be executed by root
Reference: See email: http://lists.suspend2.net/lurker/message/20051223.185724.b0194008.en.html
I'm assuming your initrd is in initramfs format. If so, to edit the files you have to extract the archive, modify the file, then create a new archive. Just like there's no easy way (that I know of) of mounting a tar archive, there's no easy way of mounting a cpio archive (which is just a simpler format than tar).
So, create and cd into the directory you want to extract the archive into. Then
zcat [original_initrd_file] | cpio --extract
Edit the file " init " as follows:
Put the line (approx: line no: 434)
echo > /sys/power/suspend2/do_resume
before this line...
udev_discover_resume() {
Now create a new archive with:
find . | cpio --create --format=newc | gzip -9 > [new_initrd_file]
The --format is important, as the default format for cpio is not one that the kernel understands.
Copy the new_initrd_file to your /boot directory and edit your grub accordingly.
Don't forget to re-run lilo (if that's your poison) after creating the new image file, since the chances of the new file being on the same blocks on the disk and in the same order as the original image is rather remote.
Notes:
It was reported in suspend2 list that the new sysfs-interface seems to ignore an empty echo into do_resume. If things don't work then use
echo 1 > /sys/power/suspend2/do_resume
http://lists.suspend2.net/lurker/message/20060724.123146.18330c0d.en.html But it works for me WITHOUT this change
The cpio extraction needs to be done as root since there is are two (character special) files (at least on my image) that won't be created otherwise, specifically:
| cpio: dev/console: Operation not permitted | cpio: dev/null: Operation not permitted
Big Warning
Things NOT to do
From http://lists.suspend2.net/lurker/message/20050526.141102.4951bff6.en.html:
DONT put the echo > /proc/suspend2/do_resume line in /etc/init.d/boot This is invoked after root has been mounted. It works but may cause serious problems.




