[PATCH 0/2] v4 kconfig: place git SHA1 in .config output if in SCM
From: Paul E. McKenney
Date: Fri Mar 05 2010 - 14:43:15 EST
This patch appends the localversion string to the Linux kernel version.
For example, in a git tree with uncommitted changes, the .config file
might start as follows (but with leading hash marks):
Automatically generated make config: don't edit
Linux kernel version: 2.6.33-01836-g90a6501-dirty
Mon Mar 1 17:05:59 2010
The "-01836-g90a6501-dirty" string is added by this patch.
The KBUILD_CONFIG_NO_CHECK_DIRTY environment variable controls the
git "-dirty" check. If this variable is either empty or undefined,
then a "-dirty" check is performed (the default), otherwise, this
check is omitted.
Differences from v3 (http://lkml.org/lkml/2010/3/4/520):
o Print errors to stderr, using gcc error format so that scripts
that pull errors from build output will find them.
o Make error strings placed in .config file more comprehensible.
o Make parent warn of child error return (via wait() system call).
Differences from v2 (http://lkml.org/lkml/2010/3/2/570):
o Replace popen() with the equivalent fork-exec series
to prevent security vulnerabilities due to shell metacharacter
o Added the KBUILD_CONFIG_NO_CHECK_DIRTY environment variable,
and modified scripts/setlocalversion to check it, as suggested
by James Cloos.
Differences from v1 (http://lkml.org/lkml/2010/2/28/191):
o Incorporates feedback from Geert Uytterhoeven, Linus Torvalds,
Frans Pop, and James Cloos.
o Fixed to work correctly with the "O=" Makefile argument and
the KBUILD_OUTPUT environment variable, so that .config files
created in directories outside of the source tree are tagged
o Uses scripts/setlocalversion, which handles not only git, but
also mercurial and svn.
o Make the new behavior default-off, as scripts/setlocalversion
has significant latency. A new environment variable named
"KBUILD_CONFIG_LOCALVERSION" must be set to enable the
"-01836-g90a6501-dirty" style of string.
This is intended to address James Cloos's concern that this
feature will slow down casual kernel builds.
It has been suggested that this string be output at boot and oops time.
If there is general agreement, this will be the subject of a separate
kconfig/confdata.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++---
setlocalversion | 18 +++++++------
2 files changed, 76 insertions(+), 11 deletions(-)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/