Comment 7 for bug 14908

Revision history for this message
John Cooper (choffee) wrote : Re: swsusp fails after automatic kernel upgrade

Hi,

At first glance I added this to the top of /etc/acpi/hibernate.sh.

grubkern=`awk 'BEGIN { kern=0 } {if ( $1 == "default" ) f=$2; if ( $1 == "kernel" ) if ( f == kern ) { gsub(".*z-","",$2 ) ;print $2 ; ( kern = kern + 1 ) } }' /boot/grub/menu.lst`

if [ $grubkern != `uname -r` ] ; then exit 1 ; fi

It just checks the default kernel is the same as the running one. Pretty hacky but it works! Might be nice if it could return a messages to the user somehow rather than just quitting.

In the end I thought that maybe grub-update should perhaps write out a file when it notices a change in default kernel.