[lkml]   [2010]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[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 (

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 (

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 (

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(-)

 \ /
  Last update: 2010-03-05 20:45    [W:0.035 / U:20.652 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site