From owner-freebsd-current@FreeBSD.ORG Fri Apr 23 06:06:47 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF8D416A4CE for ; Fri, 23 Apr 2004 06:06:46 -0700 (PDT) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2ED6343D62 for ; Fri, 23 Apr 2004 06:06:46 -0700 (PDT) (envelope-from smckay@internode.on.net) Received: from dungeon.home (ppp167-147.lns1.bne3.internode.on.net [150.101.167.147])i3ND6iZq096124; Fri, 23 Apr 2004 22:36:44 +0930 (CST) Received: from dungeon.home (localhost [127.0.0.1]) by dungeon.home (8.12.8p2/8.11.6) with ESMTP id i3ND6gce012346; Fri, 23 Apr 2004 23:06:43 +1000 (EST) (envelope-from mckay) Message-Id: <200404231306.i3ND6gce012346@dungeon.home> To: freebsd-current@freebsd.org Date: Fri, 23 Apr 2004 23:06:42 +1000 From: Stephen McKay X-Mailman-Approved-At: Sat, 24 Apr 2004 04:50:33 -0700 cc: Stephen McKay Subject: what /boot/kernel/kernel output X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 13:06:47 -0000 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 $COPYRIGHT -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? Stephen.