svn commit: r247874 - in stable/9/sys: conf kern sys

Andriy Gapon avg at FreeBSD.org
Wed Mar 6 09:12:39 UTC 2013


Author: avg
Date: Wed Mar  6 09:12:38 2013
New Revision: 247874
URL: http://svnweb.freebsd.org/changeset/base/247874

Log:
  MFC r246246,246254: print compiler version in the kernel banner

Modified:
  stable/9/sys/conf/newvers.sh
  stable/9/sys/kern/init_main.c
  stable/9/sys/kern/kern_mib.c
  stable/9/sys/sys/systm.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/conf/   (props changed)

Modified: stable/9/sys/conf/newvers.sh
==============================================================================
--- stable/9/sys/conf/newvers.sh	Wed Mar  6 08:04:44 2013	(r247873)
+++ stable/9/sys/conf/newvers.sh	Wed Mar  6 09:12:38 2013	(r247874)
@@ -86,6 +86,7 @@ fi
 touch version
 v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date`
 i=`${MAKE:-make} -V KERN_IDENT`
+compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep 'version')
 
 for dir in /bin /usr/bin /usr/local/bin; do
 	if [ -x "${dir}/svnversion" ] ; then
@@ -141,6 +142,7 @@ $COPYRIGHT
 
 char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;
 char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR;
+char compiler_version[] = "${compiler_v}";
 char ostype[] = "${TYPE}";
 char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR;
 int osreldate = ${RELDATE};

Modified: stable/9/sys/kern/init_main.c
==============================================================================
--- stable/9/sys/kern/init_main.c	Wed Mar  6 08:04:44 2013	(r247873)
+++ stable/9/sys/kern/init_main.c	Wed Mar  6 09:12:38 2013	(r247874)
@@ -325,6 +325,7 @@ print_version(void *data __unused)
 	while (len > 0 && version[len - 1] == '\n')
 		len--;
 	printf("%.*s %s\n", len, version, machine);
+	printf("%s\n", compiler_version);
 }
 
 SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t,

Modified: stable/9/sys/kern/kern_mib.c
==============================================================================
--- stable/9/sys/kern/kern_mib.c	Wed Mar  6 08:04:44 2013	(r247873)
+++ stable/9/sys/kern/kern_mib.c	Wed Mar  6 09:12:38 2013	(r247874)
@@ -99,6 +99,9 @@ SYSCTL_INT(_kern, KERN_OSREV, osrevision
 SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD|CTLFLAG_MPSAFE,
     version, 0, "Kernel version");
 
+SYSCTL_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD|CTLFLAG_MPSAFE,
+    compiler_version, 0, "Version of compiler used to compile kernel");
+
 SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE|
     CTLFLAG_CAPRD, ostype, 0, "Operating system type");
 

Modified: stable/9/sys/sys/systm.h
==============================================================================
--- stable/9/sys/sys/systm.h	Wed Mar  6 08:04:44 2013	(r247873)
+++ stable/9/sys/sys/systm.h	Wed Mar  6 09:12:38 2013	(r247874)
@@ -49,6 +49,7 @@ extern int cold;		/* nonzero if we are d
 extern int rebooting;		/* kern_reboot() has been called. */
 extern const char *panicstr;	/* panic message */
 extern char version[];		/* system version */
+extern char compiler_version[];	/* compiler version */
 extern char copyright[];	/* system copyright */
 extern int kstack_pages;	/* number of kernel stack pages */
 


More information about the svn-src-stable-9 mailing list