Skip to content

Commit bd5bdd8

Browse files
author
Sam Ravnborg
committed
kbuild: "PREEMPT" in UTS_VERSION
From: Matt Mackall <mpm@selenic.com> Add PREEMPT to UTS_VERSION where enabled as is done for SMP to make preempt kernels easily identifiable. Added SMP PREEMPT as comment in compile.h to force it to be updated when they change (sam). Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
1 parent 6d30e3a commit bd5bdd8

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎init/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ $(obj)/version.o: include/linux/compile.h
2525

2626
include/linux/compile.h: FORCE
2727
@echo ' CHK $@'
28-
@$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
28+
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
29+
"$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(CFLAGS)"

‎scripts/mkcompile_h‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
TARGET=$1
22
ARCH=$2
33
SMP=$3
4-
CC=$4
4+
PREEMPT=$4
5+
CC=$5
56

67
# If compile.h exists already and we don't own autoconf.h
78
# (i.e. we're not the same user who did make *config), don't
@@ -26,8 +27,10 @@ fi
2627

2728

2829
UTS_VERSION="#$VERSION"
29-
if [ -n "$SMP" ] ; then UTS_VERSION="$UTS_VERSION SMP"; fi
30-
UTS_VERSION="$UTS_VERSION `LC_ALL=C LANG=C date`"
30+
CONFIG_FLAGS=""
31+
if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
32+
if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
33+
UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS `LC_ALL=C LANG=C date`"
3134

3235
# Truncate to maximum length
3336

@@ -37,7 +40,8 @@ UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
3740
# Generate a temporary compile.h
3841

3942
( echo /\* This file is auto generated, version $VERSION \*/
40-
43+
if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi
44+
4145
echo \#define UTS_MACHINE \"$ARCH\"
4246

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

0 commit comments

Comments
 (0)