hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/scripts/mkcompile_h
....@@ -5,22 +5,11 @@
55 ARCH=$2
66 SMP=$3
77 PREEMPT=$4
8
-RT=$5
9
-CC=$6
8
+PREEMPT_RT=$5
9
+CC_VERSION="$6"
1010 LD=$7
1111
1212 vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }
13
-
14
-# If compile.h exists already and we don't own autoconf.h
15
-# (i.e. we're not the same user who did make *config), don't
16
-# modify compile.h
17
-# So "sudo make install" won't change the "compiled by <user>"
18
-# do "compiled by root"
19
-
20
-if [ -r $TARGET -a ! -O include/generated/autoconf.h ]; then
21
- vecho " SKIPPED $TARGET"
22
- exit 0
23
-fi
2413
2514 # Do not expand names
2615 set -f
....@@ -46,7 +35,7 @@
4635 LINUX_COMPILE_BY=$KBUILD_BUILD_USER
4736 fi
4837 if test -z "$KBUILD_BUILD_HOST"; then
49
- LINUX_COMPILE_HOST=`hostname`
38
+ LINUX_COMPILE_HOST=`uname -n`
5039 else
5140 LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST
5241 fi
....@@ -55,31 +44,28 @@
5544 CONFIG_FLAGS=""
5645 if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
5746 if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
58
-if [ -n "$RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS RT"; fi
59
-UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
47
+if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi
6048
6149 # Truncate to maximum length
62
-
6350 UTS_LEN=64
64
-UTS_TRUNCATE="cut -b -$UTS_LEN"
51
+UTS_VERSION="$(echo $UTS_VERSION $CONFIG_FLAGS $TIMESTAMP | cut -b -$UTS_LEN)"
6552
6653 # Generate a temporary compile.h
6754
68
-( echo /\* This file is auto generated, version $VERSION \*/
55
+{ echo /\* This file is auto generated, version $VERSION \*/
6956 if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi
7057
7158 echo \#define UTS_MACHINE \"$ARCH\"
7259
73
- echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
60
+ echo \#define UTS_VERSION \"$UTS_VERSION\"
7461
75
- echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\"
76
- echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\"
62
+ printf '#define LINUX_COMPILE_BY "%s"\n' "$LINUX_COMPILE_BY"
63
+ echo \#define LINUX_COMPILE_HOST \"$LINUX_COMPILE_HOST\"
7764
78
- CC_VERSION=$($CC -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$//')
7965 LD_VERSION=$($LD -v | head -n1 | sed 's/(compatible with [^)]*)//' \
8066 | sed 's/[[:space:]]*$//')
8167 printf '#define LINUX_COMPILER "%s"\n' "$CC_VERSION, $LD_VERSION"
82
-) > .tmpcompile
68
+} > .tmpcompile
8369
8470 # Only replace the real compile.h if the new one is different,
8571 # in order to preserve the timestamp and avoid unnecessary