Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+10 -5
+2 -1
init/Makefile
··· 25 25 26 26 include/linux/compile.h: FORCE 27 27 @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)"
+8 -4
scripts/mkcompile_h
··· 1 1 TARGET=$1 2 2 ARCH=$2 3 3 SMP=$3 4 - CC=$4 4 + PREEMPT=$4 5 + CC=$5 5 6 6 7 # If compile.h exists already and we don't own autoconf.h 7 8 # (i.e. we're not the same user who did make *config), don't ··· 27 26 28 27 29 28 UTS_VERSION="#$VERSION" 30 - if [ -n "$SMP" ] ; then UTS_VERSION="$UTS_VERSION SMP"; fi 31 - UTS_VERSION="$UTS_VERSION `LC_ALL=C LANG=C date`" 29 + CONFIG_FLAGS="" 30 + if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi 31 + if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi 32 + UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS `LC_ALL=C LANG=C date`" 32 33 33 34 # Truncate to maximum length 34 35 ··· 40 37 # Generate a temporary compile.h 41 38 42 39 ( echo /\* This file is auto generated, version $VERSION \*/ 43 - 40 + if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi 41 + 44 42 echo \#define UTS_MACHINE \"$ARCH\" 45 43 46 44 echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"