Re: Smp kernel version comparison

Bjorn Tore Sund <[email protected]> Fri, 22 Oct 2004 13:54:34 +0200 (CEST)
Newsgroups gmane.linux.suse.fou4s.devel
Message-ID <[email protected]>
On Fri, 22 Oct 2004, Lars Ellenberg wrote:

> / 2004-10-22 10:00:05 +0200
> \ Bjorn Tore Sund:
> > 
> > Hi,
> > 
> > Something is broken in the kernel version comparison in fou4s, showing
> > up after the latest kernel update in SuSE 9.1 on smp machines.   Yes,'
> > the machine is running from the installed kernel.
> > 
> > bjornts@barnabas(9:44)104> uname -a
> > Linux barnabas 2.6.5-7.111-smp #1 SMP Wed Oct 13 15:45:13 UTC 2004 i686 
> > i686 i386 GNU/Linux
> > bjornts@barnabas(9:45)105> rpm -qa | grep -i kernel
> > kernel-smp-2.6.5-7.111
> > kernel-source-2.6.5-7.111
> > kernel-docs-2.6.5-7.111
> > bjornts@barnabas(9:51)110> cat /proc/version 
> > Linux version 2.6.5-7.111-smp (geeko@buildhost) (gcc version 3.3.3 (SuSE 
> > Linux)) #1 SMP Wed Oct 13 15:45:13 UTC 2004
> 
> well, it is heuristic anyways, and it could be improved.
> 
> run with fou4s -vv --checkd , to see what I mean, or look at 
> getKernelVersion() (line 1044)
> and the kernel related code of checkDeleted (line 944)
> 
> rpm -qf /boot/vmlinuz gives something ugly, e.g. k_deflt on older boxes
> and kernel-smp-2.6.5-7.111 on your box, so the package name sometimes contains
> the additional information, but we cannot rely on that.
> and the uname -a (resp. /proc/version) does sometimes not contain the
> release information, so this is not reliable either.
> 
> therefore Markus compares the buildtime of the currently run kernel
>  ("Wed Oct 13 15:45:13 UTC 2004" in your case, as listed above)
> with the buildtime of the kernel package
>   rpm -qf --qf "%{BUILDTIME}" /boot/vmlinuz
> 
> [what does this say on your box? ]
> 
> and when they are not within one day, it gives you a hint to reboot.

This seems to be a specific issue with the 32bit smp (not the bigsmp,
not with AMD smp) kernel.

I was starting to dig into this code when I had to run for a meeting,
so I sent the email just as I was starting to look at it.  

rpm -q --qf "%{BUILDTIME}" kernel-smp gives: 1097770850

Enabling Marcus' debug echo during the kernebuild-check gives me:
Running kernel build: 1097682313, Installed kernel build: 1097770850/1098369124

newkernelbuild - runningkernelbuild gets to 88537, the test used is
if [ $((newkernelbuild - runningkernelbuild)) -gt 86400 ]

I'm not sure why this happens but an easy fix that shouldn't cause
many problems is increasing that threshold to 100000 or something.

Bjørn
-- 
Bjørn Tore Sund           Phone:  (+47) 555-84894    Stupidity is like a
System administrator      Fax:    (+47) 555-89672    fractal; universal and
Math. Department          Mobile: (+47) 918 68075    infinitely repetitive.
University of Bergen      VIP:    81724
Support: [email protected] Contact: [email protected] Direct: [email protected]
--