what /boot/kernel/kernel output

Stephen McKay smckay at internode.on.net
Fri Apr 23 19:38:40 PDT 2004

[This is a resend.  My first attempt appears to have been eaten.  Sorry
if this is the 2nd copy for you.]

For as long as I can remember, running the SCCS command "what" on the
kernel of the day produced useful output: a single line fairly similar
to "uname -v" but not quite so verbose.  It works up until FreeBSD 5.2.1
(at least) but fails for current.

It fails because a hack in the constructed file "vers.c" no longer
works.  Here is a fix to the hack:

--- newvers.sh.old     Wed Apr 14 13:01:18 2004
+++ newvers.sh  Fri Apr 23 22:55:04 2004
@@ -85,7 +85,7 @@
 i=`make -V KERN_IDENT`
 cat << EOF > vers.c
-char sccspad[32 - 4 /* sizeof(sccs) */] = { '\\0' };
+char sccspad[32 - 4 /* sizeof(sccs) */] = { '\\1' };
 char sccs[4] = { '@', '(', '#', ')' };
 char version[] = "${VERSION} #${v}: ${t}\\n    ${u}@${h}:${d}\\n";
 char ostype[] = "${TYPE}";

Without this, sccspad is put in the BSS.  I note that NetBSD solved
this by duplicating the version string, one copy with @(#) and one
without.  Perhaps this is better than second guessing the whims of
the compiler.

Secondly, the output of "what" now has extraneous lines:

$RCSfile: if_em_hw.h,v $$Revision: 1.37 $$Date: 2003/12/20 00:14:51 $

which is printed twice.

To solve this, we could #define NO_VERSION_CONTROL or simply delete
the @(#) characters in line 45 in dev/em/if_em_hw.h.

So, is this one tradition that still exists, or does this go in my
growing collection of personal hacks?  Should I patch either or both
of these?  The quick hack or the NetBSD way?


More information about the freebsd-current mailing list