Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Detecting kernel version upgrade



Hello all,

I use a cron script to pull changes from CVS and rebuild the NetBSD distributions for a variety of architectures each night. As expected, builds do not always succeed because the source tree is not guaranteed to compile. Most of these errors will fix themselves eventually. However, occasionally, I will run into errors that require a full rebuild. In particular, any time there is a kernel version upgrade, the builds will fail until I manually run a script to rebuild distributions from the beginning. As an example, such an error may look as follows:

=======  8 extra files in DESTDIR  =========
Files in DESTDIR but missing from flist.
File is obsolete or flist is out of date ?
------------------------------------------
./usr/X11R7/lib/libxcb-randr.so.0
./usr/X11R7/lib/libxcb-randr.so.0.1
./usr/X11R7/lib/libxcb-sync.so.0
./usr/X11R7/lib/libxcb-sync.so.0.1
./usr/X11R7/lib/libxcb.so.1
./usr/X11R7/lib/libxcb.so.1.1
./usr/lib/libssh.so.22
./usr/lib/libssh.so.22.0
=========  end of 8 extra files  ===========

For space reasons, I do not capture the output from each invocation of build.sh each night :P. I also cannot always check the build logs from my cron scripts each night (sometimes once a week). I've been looking into trying to autodetect kernel version upgrades so I can full rebuild without needing to manually run the script. The best I've come up with is the following grep command:

./gen_i386build.sh -u 2> /dev/null | grep -q "Files in DESTDIR but missing from flist."; echo $?

Ignoring the contrived example above, this requires saving output to an intermediate file; I need both the output of build.sh and grep to detect whether to rebuild, fail, or continue, so a pipe in non-bash will not work in my cron scripts. While I can't guard against all errors, is it possible to programmatically (and reliably) detect when a kernel version upgrade occurred so I can tailor my cron scripts to do a full rebuild during those cases? Even better would be to detect a kernel version upgrade BEFORE beginning the builds :).

As always, thanks in advance for any help.

Sincerely,

--
William D. Jones
Rowan University | ECE | 2012
Member IEEE
Member Tau Beta Pi
thor0505%comcast.net@localhost
Message sent using 'Windows Live Mail' client.

Home | Main Index | Thread Index | Old Index