[Pm-utils] [patch] disable suspend when kernel image changed

Richard Zidlicky rz at linux-m68k.org
Sat Apr 10 12:05:24 PDT 2010


On Sat, Apr 10, 2010 at 07:53:41AM -0700, Dan Nicholson wrote:

> The main reason being that it's not easy to tell if the image has been
> updated. Your patch assumes that people are using syslog and will put
> the kernel messages in /var/log/boot.log. There's no reason that's the
> case, and there are lots of strange reasons why the test would fail
> even if that was the case. Failing that test means people fail to

that is true.. my patch was the simplest thing I could come up and not
meant to cover all thinkable cases.

Assuming that the time stamp of the kernel image does not lie would it be
good enough to compare it with time of last (re)boot? There is any number 
of possibilities how to get the boot time, I see "who -b", "cat /proc/uptime".

So my Fedora specific fix is a little easier but is it really necessary to
rely on distribution specific solutions?

True, if we do not trust the time stamp than things get more difficult. Seems
it should be somehow possible to get the exact kernel version out of the kernel
image but looking at extract-ikconfig I am not sure it is worth it and do not
know any ready made solution.

> ....  		Failing that test means people fail to
> suspend for some undocumented reason.

which is imho very much better than crashing for an even less undocumented 
reason.
Would it be possible to send a meaningfull error message to syslog?

> > There is nothing that is obviously risky about overwriting an image in /boot.
> > Also it is not necessarily the same user who hits the hibernate button who
> > did regenerate the kernel image.
> 
> The only people who ever would get into this situation are people
> installing their own kernel and intentionally overwriting the running
> kernel. Why would they logout and walk away without rebooting into the
> new kernel on a multiuser system?

I am doing remote kernel installs all the time and if anyone is working on 
that machine I will obviously not reboot him unless critically needed. Sure,
I do now know how to safeguard myself but it is not documented anywhere.

Richard


More information about the Pm-utils mailing list