diff options
author | Ben Hutchings <benh@debian.org> | 2012-07-24 01:52:31 +0000 |
---|---|---|
committer | Ben Hutchings <benh@debian.org> | 2012-07-24 01:52:31 +0000 |
commit | aca61360d7a98fc53c66e36f3c1113ff432cfa7a (patch) | |
tree | 74d8d15b17fe95d1e6e61651145063430967f5d2 /debian/patches/debian/version.patch | |
parent | f24a365c2a09d11d102a7cb71b455b55c9d8c4e6 (diff) |
linux-image: Include package version in utsname version string (Closes: #638878)
There is not enough space for both timestamp and package version, so
replace the timestamp by setting KBUILD_BUILD_TIMESTAMP.
We now need to get the distribution name in debian/rules.real, but
we already have DISTRIBUTION as the suite name so use DISTRIBUTOR for
the distribution name (!).
The utsname version string also appears in /proc/version and the init
banner, so don't bother including it again explicitly. This means we
no longer need to patch init/version.c and scripts/mkcompile_h at all.
Instead, split maintainer at the '@' and set KBUILD_BUILD_USER and
KBUILD_BUILD_HOST accordingly.
Carry on generating <generated/package.h>, but drop the parentheses
from LINUX_PACKAGE_ID now that it's not used in init/version.c.
Drop support for version.$DISTRIBUTION files. Any derived
distribution can set KBUILD_BUILD_* in the same way we are doing.
svn path=/dists/sid/linux/; revision=19289
Diffstat (limited to 'debian/patches/debian/version.patch')
-rw-r--r-- | debian/patches/debian/version.patch | 91 |
1 files changed, 8 insertions, 83 deletions
diff --git a/debian/patches/debian/version.patch b/debian/patches/debian/version.patch index 63b0af5a9..0f296e6b9 100644 --- a/debian/patches/debian/version.patch +++ b/debian/patches/debian/version.patch @@ -1,75 +1,11 @@ -From: Bastian Blank <waldi@debian.org> -Subject: Add debian version information to kernel version string -Date: Sun, 20 May 2007 11:46:51 +0200 - -Include the package version in /proc/version and the initial log -banner. - -Determine the target distribution ($DISTRIBUTION) with lsb_release, -defaulting to Debian. +From: Ben Hutchings <ben@decadent.org.uk> +Subject: Add header file with package version information +Date: Tue, 24 Jul 2012 02:15:43 +0100 For distribution binary packages we assume -$DISTRIBUTION_OFFICIAL_BUILD is set. Add $DISTRIBUTION and -$DISTRIBUTION_VERSION after the kernel version (UTS_RELEASE), and -replace the account name used to build the package with -$DISTRIBUTION_UPLOADER. - -[bwh: Changed $DISTRIBUTION_UPLOADER to $DISTRIBUTION_MAINTAINER.] +$DISTRIBUTION_OFFICIAL_BUILD, $DISTRIBUTOR and $DISTRIBUTION_VERSION +are set. -For custom packages built from a linux-source package, read the -package version from version.$DISTRIBUTION and add that after -the kernel version string. - ---- a/init/version.c -+++ b/init/version.c -@@ -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); - --/* FIXED STRINGS! Don't touch! */ - const char linux_banner[] = -- "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@" -- LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n"; -+ "Linux version " UTS_RELEASE LINUX_PACKAGE_ID -+ LINUX_COMPILE_ID " (" LINUX_COMPILER ") " UTS_VERSION "\n"; - - const char linux_proc_banner[] = - "%s version %s" -- " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")" -+ LINUX_PACKAGE_ID -+ LINUX_COMPILE_ID - " (" LINUX_COMPILER ") %s\n"; ---- a/scripts/mkcompile_h -+++ b/scripts/mkcompile_h -@@ -73,8 +73,18 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" - - echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\" - -- echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\" -- echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\" -+ DISTRIBUTION=$(lsb_release -is 2>/dev/null) -+ DISTRIBUTION=${DISTRIBUTION:-Debian} -+ -+ if [ "$DISTRIBUTION_OFFICIAL_BUILD" ]; then -+ echo \#define LINUX_COMPILE_BY \"unknown\" -+ echo \#define LINUX_COMPILE_HOST \"$DISTRIBUTION\" -+ echo \#define LINUX_COMPILE_ID \" \($DISTRIBUTION_MAINTAINER\)\" -+ else -+ 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 \"\)\" -+ fi - - echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\" - ) > .tmpcompile --- a/Makefile +++ b/Makefile @@ -976,7 +976,7 @@ endif @@ -81,29 +17,18 @@ the kernel version string. $(cmd_crmodverdir) archprepare: archscripts prepare1 scripts_basic -@@ -1008,12 +1008,36 @@ define filechk_version.h +@@ -1008,12 +1008,25 @@ 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)\)\" ++ echo \#define LINUX_PACKAGE_ID \"$(DISTRIBUTOR) $(DISTRIBUTION_VERSION)\" +endef +else -+ifneq ($(wildcard version.$(DISTRIBUTION)),) +define filechk_package.h -+ echo \#define LINUX_PACKAGE_ID \" \($$(cut -d" " -f1 version.$(DISTRIBUTION))\)\" ++ echo \#define LINUX_PACKAGE_ID \"\" +endef -+else -+define filechk_package.h -+ echo \#define LINUX_PACKAGE_ID \" \(unknown\)\" -+endef -+endif +endif + include/linux/version.h: $(srctree)/Makefile FORCE |