Skip to content

v4 kconfig: place git SHA1 in .config output if in SCM

Paul E. McKenney lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2kconfig: place localversion string in .config outputscripts/kconfig/confdata.c+66 -20 replies
2/2kconfig: make setlocalversion -dirty check optionalscripts/setlocalversion+10 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] v4 kconfig: place git SHA1 in .config output if in SCM

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 interpretation.

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 correctly.

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 patch.

 kconfig/confdata.c |   69 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 setlocalversion    |   18 +++++++------
 2 files changed, 76 insertions(+), 11 deletions(-)