Added hibernate on systems with elilo by editing sleep.d/99Zgrub

Hi,

I’m running openSuSE 12.2 (earlier 12.1) on an ASUS N56V. I kept the preinstalled Windoze and had a long fight with the EFI BIOS.
Now It’s running fine using elilo (no menu, starting linux normally), but it took a while to figure out why I could suspend to RAM but not to disk.

The reason is in the file /usr/lib/pm-utils/sleep.d/99Zgrub which determines the bootmanager and takes some decision where to look for the kernel.
Elilo is not among the options. In my case grub2 is somehow on the system and has an updated /boot/grub2/grub.cfg (I checked manually against
the /boot/efi/efi/SuSE/elilo.conf) - thus the easiest fix was to clone the grub2-section at the beginning of the 99Zgrub and make it read as below.
Dirty hack, but works.

Would be nice if elilo could be added to the script in a clean way.

Hope it helps someone.

bye
Guenter


prepare-parameters()
{
        eval `grep LOADER_TYPE= /etc/sysconfig/bootloader`

        if  x"$LOADER_TYPE" = "xgrub" ]; then
                GRUBONCE="/usr/sbin/grubonce"
                GRUBDEFAULT="/boot/grub/default"
                GRUBDEFSAVE="/var/run/suspend.grubonce.default"
                getkernels="getkernels-grub"
        elif  x"$LOADER_TYPE" = "xgrub2" ]; then
                GRUBONCE="/usr/sbin/grub2-once"
                GRUBDEFAULT="/boot/grub2/grubenv"
                GRUBDEFSAVE="/var/run/suspend.grubonce.default"
                GRUB2EDITENV="/usr/bin/grub2-editenv"
                GRUB2CONF="/boot/grub2/grub.cfg"
                BLKID="/usr/sbin/blkid"
                getkernels="getkernels-grub2"
        elif  x"$LOADER_TYPE" = "xgrub2-efi" ]; then
                GRUBONCE="/usr/sbin/grub2-once"
                GRUBDEFAULT="/boot/grub2-efi/grubenv"
                GRUBDEFSAVE="/var/run/suspend.grubonce.default"
                GRUB2EDITENV="/usr/bin/grub2-efi-editenv"
                GRUB2CONF="/boot/grub2-efi/grub.cfg"
                BLKID="/usr/sbin/blkid"
                getkernels="getkernels-grub2"
        elif  x"$LOADER_TYPE" = "elilo" ]; then
                GRUBONCE="/usr/sbin/grub2-once"
                GRUBDEFAULT="/boot/grub2/grubenv"
                GRUBDEFSAVE="/var/run/suspend.grubonce.default"
                GRUB2EDITENV="/usr/bin/grub2-editenv"
                GRUB2CONF="/boot/grub2/grub.cfg"
                BLKID="/usr/sbin/blkid"
                getkernels="getkernels-grub2"
        fi
}

On 2013-01-11 00:16, ggrau wrote:
> Would be nice if elilo could be added to the script in a clean way.

You could post all that in a bugzilla.


Cheers/Saludos
Carlos E. R.