diff options
author | Michal Marek <mmarek@suse.cz> | 2011-04-05 08:32:30 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2011-04-18 08:26:55 -0400 |
commit | 53e6892c0411006848882eacfcfea9e93681b55d (patch) | |
tree | af622e1ec2b1a66961749596ba3b3cf45370f114 /scripts/mkcompile_h | |
parent | 061296dc2c14f852604fc6849669fe0b78bb1eda (diff) |
kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros
Make it possible to override the user@host string displayed during boot
and in /proc/version by the environment variables KBUILD_BUILD_USER and
KBUILD_BUILD_HOST. Several distributions patch scripts/mkcompile_h to
achieve this, so let's provide an official way. Also, document the
KBUILD_BUILD_TIMESTAMP variable while at it.
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/mkcompile_h')
-rwxr-xr-x | scripts/mkcompile_h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 82416a81df5e..7ad6bf7a09ff 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h | |||
@@ -42,6 +42,16 @@ if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then | |||
42 | else | 42 | else |
43 | TIMESTAMP=$KBUILD_BUILD_TIMESTAMP | 43 | TIMESTAMP=$KBUILD_BUILD_TIMESTAMP |
44 | fi | 44 | fi |
45 | if test -z "$KBUILD_BUILD_USER"; then | ||
46 | LINUX_COMPILE_BY=`whoami` | ||
47 | else | ||
48 | LINUX_COMPILE_BY=$KBUILD_BUILD_USER | ||
49 | fi | ||
50 | if test -z "$KBUILD_BUILD_HOST"; then | ||
51 | LINUX_COMPILE_HOST=`hostname` | ||
52 | else | ||
53 | LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST | ||
54 | fi | ||
45 | 55 | ||
46 | UTS_VERSION="#$VERSION" | 56 | UTS_VERSION="#$VERSION" |
47 | CONFIG_FLAGS="" | 57 | CONFIG_FLAGS="" |
@@ -63,8 +73,8 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" | |||
63 | 73 | ||
64 | echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\" | 74 | echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\" |
65 | 75 | ||
66 | echo \#define LINUX_COMPILE_BY \"`whoami`\" | 76 | echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\" |
67 | echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\" | 77 | echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\" |
68 | 78 | ||
69 | echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\" | 79 | echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\" |
70 | ) > .tmpcompile | 80 | ) > .tmpcompile |