[linux] 03/05: linux-image: Add '-unsigned' suffix to packages with modules that will later be signed

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Fri Jun 10 13:47:56 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository linux.

commit 72f58e83eaacb07b7dc5d077890f2be7d548300b
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Wed Jun 8 23:31:55 2016 +0100

    linux-image: Add '-unsigned' suffix to packages with modules that will later be signed
---
 debian/bin/gencontrol.py                   | 11 +++++++----
 debian/changelog                           |  2 ++
 debian/rules.real                          | 10 +++++++++-
 debian/templates/control.image-unsigned.in | 10 ++++++++++
 4 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/debian/bin/gencontrol.py b/debian/bin/gencontrol.py
index f859f08..1e772ee 100755
--- a/debian/bin/gencontrol.py
+++ b/debian/bin/gencontrol.py
@@ -355,7 +355,10 @@ class Gencontrol(Base):
         packages_dummy = []
         packages_own = []
 
-        image = self.templates["control.image"]
+        build_signed = config_entry_build.get('signed-modules')
+
+        image = self.templates[build_signed and "control.image-unsigned"
+                               or "control.image"]
 
         config_entry_xen = self.config.merge('xen', arch, featureset, flavour)
         if config_entry_xen:
@@ -370,6 +373,7 @@ class Gencontrol(Base):
 
         image_main = self.process_real_image(image[0], image_fields, vars)
         packages_own.append(image_main)
+        makeflags['IMAGE_PACKAGE_NAME'] = image_main['Package']
         packages_own.extend(self.process_packages(image[1:], vars))
 
         package_headers = self.process_package(headers[0], vars)
@@ -452,7 +456,7 @@ class Gencontrol(Base):
         makeflags['KCONFIG_OPTIONS'] = ''
         if build_debug:
             makeflags['KCONFIG_OPTIONS'] += ' -o DEBUG_INFO=y'
-        if config_entry_build.get('signed-modules'):
+        if build_signed:
             makeflags['KCONFIG_OPTIONS'] += ' -o MODULE_SIG=y'
 
         cmds_binary_arch = ["$(MAKE) -f debian/rules.real binary-arch-flavour %s" % makeflags]
@@ -473,8 +477,7 @@ class Gencontrol(Base):
                               (vars['abiname'], vars['localversion']))
         for name in ['postinst', 'postrm', 'preinst', 'prerm']:
             self._substitute_file('image.%s' % name, vars,
-                                  'debian/linux-image-%s%s.%s' %
-                                  (vars['abiname'], vars['localversion'], name))
+                                  'debian/%s.%s' % (image_main['Package'], name))
         if build_debug:
             self._substitute_file('image-dbg.lintian-override', vars,
                                   'debian/linux-image-%s%s-dbg.lintian-overrides' %
diff --git a/debian/changelog b/debian/changelog
index 636264b..4fd8b71 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ linux (4.6.1-2) UNRELEASED; urgency=medium
   * Move merge_packages function from debian/bin/gencontrol.py to
     gencontrol module
   * udeb: Drop packages for modules that will later be signed
+  * linux-image: Add '-unsigned' suffix to packages with modules that will
+    later be signed
 
  -- Ben Hutchings <ben at decadent.org.uk>  Tue, 07 Jun 2016 19:37:55 +0100
 
diff --git a/debian/rules.real b/debian/rules.real
index d14c508..d8b8a18 100644
--- a/debian/rules.real
+++ b/debian/rules.real
@@ -367,7 +367,7 @@ install-support:
 	+$(MAKE_SELF) install-base
 
 install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR): REAL_VERSION = $(ABINAME)$(LOCALVERSION)
-install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR): PACKAGE_NAME = linux-image-$(REAL_VERSION)
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR): PACKAGE_NAME = $(IMAGE_PACKAGE_NAME)
 install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR): PACKAGE_DIR = debian/$(PACKAGE_NAME)
 install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR): INSTALL_DIR = $(PACKAGE_DIR)/boot
 install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR): DIR = $(BUILD_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
@@ -463,6 +463,14 @@ install-udeb_$(ARCH): DH_OPTIONS=$(PACKAGE_NAMES:%=-p%)
 install-udeb_$(ARCH):
 	dh_testdir
 	dh_prep
+ifeq ($(UDEB_UNSIGNED_TEST_BUILD),True)
+# kernel-wedge doesn't expect a -unsigned suffix; work around that for now
+	while read flavour; do \
+		rm -f debian/linux-image-$(ABINAME)-$$flavour; \
+		ln -s linux-image-$(ABINAME)-$$flavour-unsigned \
+			debian/linux-image-$(ABINAME)-$$flavour; \
+	done < <(awk '!/^#/ { print $$3 }' $(KW_CONFIG_DIR)/kernel-versions)
+endif
 	kernel-wedge install-files $(ABINAME)
 	kernel-wedge check $(PACKAGE_NAMES)
 	dh_fixperms
diff --git a/debian/templates/control.image-unsigned.in b/debian/templates/control.image-unsigned.in
new file mode 100644
index 0000000..6a1fb1f
--- /dev/null
+++ b/debian/templates/control.image-unsigned.in
@@ -0,0 +1,10 @@
+Package: linux-image- at abiname@@localversion at -unsigned
+Build-Profiles: <!stage1>
+Depends: kmod, linux-base (>= 4.3~), ${misc:Depends}
+Recommends: firmware-linux-free, ${kernel:Recommends}
+Suggests: linux-doc- at version@, debian-kernel-handbook
+Conflicts: linux-image- at abiname@@localversion@
+Replaces: linux-image- at abiname@@localversion@
+Provides: linux-image- at abiname@@localversion@
+Description: Linux @upstreamversion@ for @class@
+ The Linux kernel @upstreamversion@ and modules for use on @longclass at .

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list