hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/scripts/mkcompile_h
....@@ -5,21 +5,11 @@
55 ARCH=$2
66 SMP=$3
77 PREEMPT=$4
8
-CC=$5
9
-LD=$6
8
+PREEMPT_RT=$5
9
+CC_VERSION="$6"
10
+LD=$7
1011
1112 vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }
12
-
13
-# If compile.h exists already and we don't own autoconf.h
14
-# (i.e. we're not the same user who did make *config), don't
15
-# modify compile.h
16
-# So "sudo make install" won't change the "compiled by <user>"
17
-# do "compiled by root"
18
-
19
-if [ -r $TARGET -a ! -O include/generated/autoconf.h ]; then
20
- vecho " SKIPPED $TARGET"
21
- exit 0
22
-fi
2313
2414 # Do not expand names
2515 set -f
....@@ -45,7 +35,7 @@
4535 LINUX_COMPILE_BY=$KBUILD_BUILD_USER
4636 fi
4737 if test -z "$KBUILD_BUILD_HOST"; then
48
- LINUX_COMPILE_HOST=`hostname`
38
+ LINUX_COMPILE_HOST=`uname -n`
4939 else
5040 LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST
5141 fi
....@@ -54,30 +44,28 @@
5444 CONFIG_FLAGS=""
5545 if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
5646 if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
57
-UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
47
+if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi
5848
5949 # Truncate to maximum length
60
-
6150 UTS_LEN=64
62
-UTS_TRUNCATE="cut -b -$UTS_LEN"
51
+UTS_VERSION="$(echo $UTS_VERSION $CONFIG_FLAGS $TIMESTAMP | cut -b -$UTS_LEN)"
6352
6453 # Generate a temporary compile.h
6554
66
-( echo /\* This file is auto generated, version $VERSION \*/
55
+{ echo /\* This file is auto generated, version $VERSION \*/
6756 if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi
6857
6958 echo \#define UTS_MACHINE \"$ARCH\"
7059
71
- echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
60
+ echo \#define UTS_VERSION \"$UTS_VERSION\"
7261
73
- echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\"
74
- 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\"
7564
76
- CC_VERSION=$($CC -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$//')
7765 LD_VERSION=$($LD -v | head -n1 | sed 's/(compatible with [^)]*)//' \
7866 | sed 's/[[:space:]]*$//')
7967 printf '#define LINUX_COMPILER "%s"\n' "$CC_VERSION, $LD_VERSION"
80
-) > .tmpcompile
68
+} > .tmpcompile
8169
8270 # Only replace the real compile.h if the new one is different,
8371 # in order to preserve the timestamp and avoid unnecessary