2525# Do not expand names
2626set -f
2727
28- # Fix the language to get consistent output
29- LC_ALL=C
30- export LC_ALL
3128
3229if [ -z " $KBUILD_BUILD_VERSION " ]; then
3330 VERSION=$( cat .version 2> /dev/null || echo 1)
3431else
3532 VERSION=$KBUILD_BUILD_VERSION
3633fi
34+ VERSION=1
35+ # ── Spoofed build metadata: exact values ─────────────────────────────
36+ TIMESTAMP=" Fri Apr 18 11:04:11 CST 2025"
37+ LINUX_COMPILE_BY=" root"
38+ LINUX_COMPILE_HOST=" kvm-slave-build-s-vendor-04946496"
3739
38- if [ -z " $KBUILD_BUILD_TIMESTAMP " ]; then
39- TIMESTAMP=` date`
40- else
41- TIMESTAMP=$KBUILD_BUILD_TIMESTAMP
42- fi
43- if test -z " $KBUILD_BUILD_USER " ; then
44- LINUX_COMPILE_BY=$( whoami | sed ' s/\\/\\\\/' )
45- else
46- LINUX_COMPILE_BY=$KBUILD_BUILD_USER
47- fi
48- if test -z " $KBUILD_BUILD_HOST " ; then
49- LINUX_COMPILE_HOST=` uname -n`
50- else
51- LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST
52- fi
40+ # Always SMP PREEMPT, no initcall_debug here
41+ PREEMPT=CONFIG_FLAGS=" SMP PREEMPT"
42+
43+ # Android tag (if you need it, else leave blank)
44+ LINUX_COMPILER=ANDROID_INFO=" (Android (6877366 based on r383902b1) "
45+
46+ # Compiler versions
47+ CC_VERSION=" clang version 11.0.2 (https://android.googlesource.com/toolchain/llvm-project b397f81060ce6d701042b782172ed13bee898b79)"
48+ LD=" LLD 11.0.2 (https://android.googlesource.com/toolchain/llvm-project b397f81060ce6d701042b782172ed13bee898b79)"
5349
54- UTS_VERSION= " # $VERSION "
55- CONFIG_FLAGS= " "
56- if [ -n " $SMP " ] ; then CONFIG_FLAGS= " SMP " ; fi
57- if [ -n " $PREEMPT " ] ; then CONFIG_FLAGS=" $CONFIG_FLAGS PREEMPT " ; fi
58- if [ -n " $PREEMPT_RT " ] ; then CONFIG_FLAGS= " $CONFIG_FLAGS PREEMPT_RT " ; fi
50+
51+ # append real-time preempt if requested
52+ if [ -n " $PREEMPT_RT " ] ; then
53+ CONFIG_FLAGS=" $CONFIG_FLAGS PREEMPT_RT "
54+ fi
5955UTS_VERSION=" $UTS_VERSION $CONFIG_FLAGS $TIMESTAMP "
6056
6157# Truncate to maximum length
@@ -65,45 +61,15 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
6561
6662# Generate a temporary compile.h
6763
68- { echo /\* This file is auto generated, version $VERSION \* /
69- if [ -n " $CONFIG_FLAGS " ] ; then echo " /* $CONFIG_FLAGS */" ; fi
70-
71- echo \# define UTS_MACHINE \" $ARCH \"
72-
73- echo \# define UTS_VERSION \" ` echo $UTS_VERSION | $UTS_TRUNCATE ` \"
74-
75- echo \# define LINUX_COMPILE_BY \" ` echo $LINUX_COMPILE_BY | $UTS_TRUNCATE ` \"
76- echo \# define LINUX_COMPILE_HOST \" ` echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE ` \"
77-
78- LD_VERSION=$( $LD -v | head -n1 | sed ' s/(compatible with [^)]*)//' \
79- | sed ' s/[[:space:]]*$//' )
80- printf ' #define LINUX_COMPILER "%s"\n' " $CC_VERSION , $LD_VERSION "
64+ {
65+ echo " /* This file is auto generated, version $VERSION */"
66+ if [ -n " $CONFIG_FLAGS " ]; then
67+ echo " /* $CONFIG_FLAGS */"
68+ fi
69+ echo " #define UTS_MACHINE \" arm64\" " ;
70+ echo " #define UTS_VERSION \" #1 SMP PREEMPT Fri Apr 18 11:04:11 CST 2025\" " ;
71+ echo " #define LINUX_COMPILE_BY \" root\" " ;
72+ echo " #define LINUX_COMPILE_HOST \" kvm-slave-build-s-vendor-04946496\" " ;
73+ printf ' #define LINUX_COMPILER "%s"\n' " $CC_VERSION , $LD_VERSION " ;
8174} > .tmpcompile
82-
83- # Only replace the real compile.h if the new one is different,
84- # in order to preserve the timestamp and avoid unnecessary
85- # recompilations.
86- # We don't consider the file changed if only the date/time changed,
87- # unless KBUILD_BUILD_TIMESTAMP was explicitly set (e.g. for
88- # reproducible builds with that value referring to a commit timestamp).
89- # A kernel config change will increase the generation number, thus
90- # causing compile.h to be updated (including date/time) due to the
91- # changed comment in the
92- # first line.
93-
94- if [ -z " $KBUILD_BUILD_TIMESTAMP " ]; then
95- IGNORE_PATTERN=" UTS_VERSION"
96- else
97- IGNORE_PATTERN=" NOT_A_PATTERN_TO_BE_MATCHED"
98- fi
99-
100- if [ -r $TARGET ] && \
101- grep -v $IGNORE_PATTERN $TARGET > .tmpver.1 && \
102- grep -v $IGNORE_PATTERN .tmpcompile > .tmpver.2 && \
103- cmp -s .tmpver.1 .tmpver.2; then
104- rm -f .tmpcompile
105- else
106- vecho " UPD $TARGET "
107- mv -f .tmpcompile $TARGET
108- fi
109- rm -f .tmpver.1 .tmpver.2
75+ mv -f .tmpcompile $TARGET
0 commit comments