summaryrefslogtreecommitdiff
path: root/debian/patches/debian/version.patch
diff options
context:
space:
mode:
authorBen Hutchings <benh@debian.org>2012-07-24 00:28:08 +0000
committerBen Hutchings <benh@debian.org>2012-07-24 00:28:08 +0000
commitf24a365c2a09d11d102a7cb71b455b55c9d8c4e6 (patch)
tree38217691d052c272386de7c331eb99ad9104a814 /debian/patches/debian/version.patch
parent58eb042b322c2429b374f46f20e027521fa5d971 (diff)
Move definition of LINUX_PACKAGE_ID to new header <generated/package.h>
svn path=/dists/sid/linux/; revision=19288
Diffstat (limited to 'debian/patches/debian/version.patch')
-rw-r--r--debian/patches/debian/version.patch67
1 files changed, 58 insertions, 9 deletions
diff --git a/debian/patches/debian/version.patch b/debian/patches/debian/version.patch
index 9045ccaef..63b0af5a9 100644
--- a/debian/patches/debian/version.patch
+++ b/debian/patches/debian/version.patch
@@ -22,7 +22,15 @@ the kernel version string.
--- a/init/version.c
+++ b/init/version.c
-@@ -37,12 +37,12 @@ struct uts_namespace init_uts_ns = {
+@@ -11,6 +11,7 @@
+ #include <linux/uts.h>
+ #include <linux/utsname.h>
+ #include <generated/utsrelease.h>
++#include <generated/package.h>
+ #include <linux/version.h>
+
+ #ifndef CONFIG_KALLSYMS
+@@ -37,12 +38,12 @@ struct uts_namespace init_uts_ns = {
};
EXPORT_SYMBOL_GPL(init_uts_ns);
@@ -41,7 +49,7 @@ the kernel version string.
" (" LINUX_COMPILER ") %s\n";
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
-@@ -73,8 +73,25 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
+@@ -73,8 +73,18 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
@@ -51,17 +59,10 @@ the kernel version string.
+ DISTRIBUTION=${DISTRIBUTION:-Debian}
+
+ if [ "$DISTRIBUTION_OFFICIAL_BUILD" ]; then
-+ echo \#define LINUX_PACKAGE_ID \" \($DISTRIBUTION $DISTRIBUTION_VERSION\)\"
+ echo \#define LINUX_COMPILE_BY \"unknown\"
+ echo \#define LINUX_COMPILE_HOST \"$DISTRIBUTION\"
+ echo \#define LINUX_COMPILE_ID \" \($DISTRIBUTION_MAINTAINER\)\"
+ else
-+ if [ -e version.$DISTRIBUTION ]; then
-+ DISTRIBUTION_VERSION=$(cut -d" " -f1 version.$DISTRIBUTION)
-+ else
-+ DISTRIBUTION_VERSION=unknown
-+ fi
-+ echo \#define LINUX_PACKAGE_ID \" \($DISTRIBUTION_VERSION\)\"
+ echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\"
+ echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\"
+ echo \#define LINUX_COMPILE_ID \" \(\" LINUX_COMPILE_BY \"@\" LINUX_COMPILE_HOST \"\)\"
@@ -69,3 +70,51 @@ the kernel version string.
echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\"
) > .tmpcompile
+--- a/Makefile
++++ b/Makefile
+@@ -976,7 +976,7 @@ endif
+ prepare2: prepare3 outputmakefile asm-generic
+
+ prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \
+- include/config/auto.conf
++ include/config/auto.conf include/generated/package.h
+ $(cmd_crmodverdir)
+
+ archprepare: archscripts prepare1 scripts_basic
+@@ -1008,12 +1008,36 @@ define filechk_version.h
+ echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
+ endef
+
++DISTRIBUTION := $(shell lsb_release -is 2>/dev/null)
++ifeq ($(DISTRIBUTION),)
++DISTRIBUTION := Debian
++endif
++
++ifneq ($(DISTRIBUTION_OFFICIAL_BUILD),)
++define filechk_package.h
++ echo \#define LINUX_PACKAGE_ID \" \($(DISTRIBUTION) $(DISTRIBUTION_VERSION)\)\"
++endef
++else
++ifneq ($(wildcard version.$(DISTRIBUTION)),)
++define filechk_package.h
++ echo \#define LINUX_PACKAGE_ID \" \($$(cut -d" " -f1 version.$(DISTRIBUTION))\)\"
++endef
++else
++define filechk_package.h
++ echo \#define LINUX_PACKAGE_ID \" \(unknown\)\"
++endef
++endif
++endif
++
+ include/linux/version.h: $(srctree)/Makefile FORCE
+ $(call filechk,version.h)
+
+ include/generated/utsrelease.h: include/config/kernel.release FORCE
+ $(call filechk,utsrelease.h)
+
++include/generated/package.h: $(srctree)/Makefile FORCE
++ $(call filechk,package.h)
++
+ PHONY += headerdep
+ headerdep:
+ $(Q)find $(srctree)/include/ -name '*.h' | xargs --max-args 1 \