Re: [PATCH] v3 kconfig: place git SHA1 in .config output if in SCM

From: Frans Pop
Date: Thu Mar 04 2010 - 22:43:51 EST

On Friday 05 March 2010, Paul E. McKenney wrote:
> o Added the KBUILD_CONFIG_NO_CHECK_DIRTY environment variable,
> and modified scripts/setlocalversion to check it, as suggested
> by James Cloos.

Just to state the obvious: this will also affect CONFIG_LOCALVERSION_AUTO.

> @@ -450,12 +457,52 @@ int conf_write(const char *name)
> if (env && *env)
> use_timestamp = 0;
> + strcpy(localversion, "-?-nopath");
> + path = getenv(SRCTREE);
> + if (path && *path) {
> + strcpy(localversion, "-?-pipe()-failed");
> + if (pipe(pipefd) != 0)
> + goto nolocalversion;
> + env = getenv("KBUILD_CONFIG_NO_CHECK_DIRTY");

Is this line actually needed? AFAICT the variable is unused here and should
pass down through the environment to the setlocalversion script without
needing any help.

> + sprintf(cmdline, "%s/scripts/setlocalversion", path);
> + strcpy(localversion, "-?-fork()-failed");
> + pid = fork();

Do I read correctly that you're also postfixing error conditions to the
kernel version? Don't think that's a great idea TBH. Errors should be
printed to STDERR as they occur, not as pseudo version strings.

Users coming across them in config files would be very unlikely to be able
to make any sense of them. IMO, if no VCS version can be determined,
nothing should be printed.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at