Interesting Kernel compilation flags

arch/x86/boot/version.c:20:     UTS_RELEASE ” (” LINUX_COMPILE_BY “@” LINUX_COMPILE_HOST “) ”
include/generated/compile.h~:6:#define LINUX_COMPILE_BY “droidzone”
include/generated/compile.h:6:#define LINUX_COMPILE_BY “Droidzone”
init/version.c:41:      “Linux version ” UTS_RELEASE ” (” LINUX_COMPILE_BY “@”
init/version.c:46:      ” (” LINUX_COMPILE_BY “@” LINUX_COMPILE_HOST “)”
scripts/mkcompile_h:67:  echo #define LINUX_COMPILE_BY “`whoami`”

Actual scripts/mkcompile_h is very interesting

UTS_LEN=64
UTS_TRUNCATE="cut -b -$UTS_LEN"[/code]

# Generate a temporary compile.h

( echo /* This file is auto generated, version $VERSION */
if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi

echo #define UTS_MACHINE "$ARCH"

echo #define UTS_VERSION "`echo $UTS_VERSION | $UTS_TRUNCATE`"

echo #define LINUX_COMPILE_TIME "`date +%T`"
echo #define LINUX_COMPILE_BY "`whoami`"
echo #define LINUX_COMPILE_HOST "`hostname | $UTS_TRUNCATE`"

domain=`dnsdomainname 2> /dev/null`
if [ -z "$domain" ]; then
domain=`domainname 2> /dev/null`
fi

if [ -n "$domain" ]; then
echo #define LINUX_COMPILE_DOMAIN "`echo $domain | $UTS_TRUNCATE`"
else
echo #define LINUX_COMPILE_DOMAIN
fi

echo #define LINUX_COMPILER "`$CC -v 2>&1 | tail -n 1`"
) > .tmpcompile

 

arch/x86/boot/version.c:21:     UTS_VERSION;
include/generated/compile.h~:4:#define UTS_VERSION "#10 PREEMPT Mon Oct 31 14:34:56 IST 2011"
include/generated/compile.h:4:#define UTS_VERSION "#10 PREEMPT Mon Oct 31 14:34:56 IST 2011"
init/version.c:32:              .version        = UTS_VERSION,
init/version.c:42:      LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "n";
scripts/mkcompile_h:46:UTS_VERSION="#$VERSION"
scripts/mkcompile_h:50:UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
scripts/mkcompile_h:64:  echo #define UTS_VERSION "`echo $UTS_VERSION | $UTS_TRUNCATE`"
scripts/mkcompile_h:94:      grep -v 'UTS_VERSION|LINUX_COMPILE_TIME' $TARGET > .tmpver.1 &&
scripts/mkcompile_h:95:      grep -v 'UTS_VERSION|LINUX_COMPILE_TIME' .tmpcompile > .tmpver.2 &&

 

And of course init/version.c

struct uts_namespace init_uts_ns = {
.kref = {
.refcount    = ATOMIC_INIT(2),
},
.name = {
.sysname    = UTS_SYSNAME,
.nodename    = UTS_NODENAME,
.release    = UTS_RELEASE,
.version    = UTS_VERSION,
.machine    = UTS_MACHINE,
.domainname    = UTS_DOMAINNAME,
},
};
EXPORT_SYMBOL_GPL(init_uts_ns);[/code]

/* FIXED STRINGS! Don't touch! */
const char linux_banner[] =
"Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "n";

const char linux_proc_banner[] =
"%s version %s"
" (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")"
" (" LINUX_COMPILER ") %sn";

 

And every time a version number is changed in menuconfig, it changes here:

include/generated/autoconf.h:464:#define CONFIG_LOCALVERSION "Kernel_Stock"
include/generated/utsrelease.h:1:#define UTS_RELEASE "2.6.35.10Kernel_Stock"
include/config/auto.conf:463:CONFIG_LOCALVERSION="Kernel_Stock"
include/config/kernel.release:1:2.6.35.10Kernel_Stock