Note: Before doing anything, you'll need a swap partition to hibernate. A swap file won't work.
Here's how I did it:
The kernel needs to be recompiled with support for hibernation:
- * Download the source tarball and DOTconfig from here: http://bkhome.org/sources/kernel-2.6.33.2/
* Compile the kernel:
* Replace your kernel with the new one:----------------------------------------------
To compile kernel
-----------------
# make clean
# make mrproper
<<<copy in the .config file
# make menuconfig <<<enable hibernation under power management options
# make bzImage
(no need to rebuild modules)Code: Select all
mv /mnt/home/vmlinuz /mnt/home/vmlinuz.old cp arch/x86/boot/bzImage /mnt/home/vmlinuz
- * Extract the initrd:
* Edit the init script:
Code: Select all
mkdir -p /tmp/initrd-tree && cd /tmp/initrd-tree zcat /mnt/home/initrd.gz | cpio -id --no-absolute-filenames
* In between the 'Loading modules to access disk drives' and 'Searching for puppy files' sections, insert the following:Code: Select all
geany init
* Now save and exit geanyCode: Select all
##############END MODULE LOADING TO ACCESS DRIVES#################### # piratesmack: Resume after hibernation # # Note: boot parameter 'resume' must be set # e.g. resume=sda3, where sda3 is the swap partition you hibernated to # RESUME="$(tr ' ' '\n' < /proc/cmdline | grep '^resume=' | cut -d= -f2 | sed -e 's:^/dev/::')" if [ -n "$RESUME" -a -e "/sys/power/resume" ]; then PTRN="$RESUME$" # get major and minor number of resume partition MAJMIN="$(grep "$PTRN" /proc/partitions | tr -s ' ' | cut -d' ' -f2,3 | tr ' ' :)" echo -n $MAJMIN > /sys/power/resume fi ######################################## #######################FINDING PUPPY FILES###########################
* Rebuild the initrd:Code: Select all
mv /mnt/home/initrd.gz /mnt/home/initrd.gz.old find . | cpio -o -H newc | gzip -c9 > /mnt/home/initrd.gz
You'll also need to edit your boot loader's config file and add "resume=sdXX" as a boot parameter:
- * here is an example grub menu.lst, replace sda1 with your swap partiiton
Code: Select all
title Puppy 5.1 root (hd0,1) kernel /vmlinuz pmedia=atahd resume=sda1 initrd /initrd.gz
That's it.
Now you can hibernate with the following command:
echo -n disk > /sys/power/state
I apologize, this probably isn't very newbie-friendly.
You can download a prebuilt kernel and initrd from the following link.
http://www.mediafire.com/?o28pgbbh6jomsz6