On 7/21/24 07:43, Mike wrote:
Hi all,

I have a TV card in one of my boxen, which requires a kernel module to
be built.  I've got that all nicely scripted and so I can kick it off
with relative ease.

The issue is detecting when it needs to be done.  ie after a change in
the running kernel.  At the moment, it's detected by the TV guide
running out of data and triggering an Icinga alert, which then causes me
to investigate and rebuild the kernel module.  I was hoping for
something a little more automated.  I'm envisioning something which
starts on boot checking if the kernel has changed and if so, kicking off
the kernel module rebuild script.

The question is: how to detect if the kernel has changed.

You could run
uname -r
and compare the output to what it was last time, by using a logfile to store
the info across invocations.  But I think you were correct, what's really
important is whether the kernel module is loaded, and then you're back to

1) lsmod | grep <driver>

I conceed that doesn't actually indicate the kernel has changed, just
that the kernel module is missing.  However, so far, it being missing
has consistent indicated a kernel change and rebuilding the driver on a
false positive isn't really an issue

--
"That."
           -- She

Reply via email to