summaryrefslogtreecommitdiffstats
path: root/debian/signing_templates
diff options
context:
space:
mode:
Diffstat (limited to 'debian/signing_templates')
-rw-r--r--debian/signing_templates/README.source4
-rwxr-xr-xdebian/signing_templates/rules22
-rw-r--r--debian/signing_templates/rules.real106
-rw-r--r--debian/signing_templates/source/format1
4 files changed, 133 insertions, 0 deletions
diff --git a/debian/signing_templates/README.source b/debian/signing_templates/README.source
new file mode 100644
index 000000000..f175c35b3
--- /dev/null
+++ b/debian/signing_templates/README.source
@@ -0,0 +1,4 @@
+This source package is generated by the Debian signing service from a
+template built by the linux package. It should never be updated directly.
+
+ -- Ben Hutchings <ben@decadent.org.uk> Fri, 06 Apr 2018 10:23:29 +0100
diff --git a/debian/signing_templates/rules b/debian/signing_templates/rules
new file mode 100755
index 000000000..18d3d7d24
--- /dev/null
+++ b/debian/signing_templates/rules
@@ -0,0 +1,22 @@
+#!/usr/bin/make -f
+
+include /usr/share/dpkg/architecture.mk
+
+SHELL := sh -e
+
+
+build: build-arch build-indep
+build-arch:
+build-indep:
+
+clean:
+ dh_testdir
+ dh_clean
+
+binary: binary-arch binary-indep
+binary-arch: debian/control
+ dh_testdir
+ $(MAKE) -f debian/rules.gen binary-arch_$(DEB_HOST_ARCH)
+binary-indep:
+
+.PHONY: build build-arch build-indep clean binary binary-arch binary-indep
diff --git a/debian/signing_templates/rules.real b/debian/signing_templates/rules.real
new file mode 100644
index 000000000..f617dbe00
--- /dev/null
+++ b/debian/signing_templates/rules.real
@@ -0,0 +1,106 @@
+include /usr/share/dpkg/default.mk
+
+SHELL := bash -e
+
+export DH_OPTIONS
+
+export DEB_RULES_REQUIRES_ROOT ?= no
+
+GENCONTROL_ARGS := -v@signedtemplate_binaryversion@
+BUILDDEB_ARGS := -Zxz $(if $(filter pkg.linux.quick,$(DEB_BUILD_PROFILES)),-z0)
+
+define dh_binary_pre
+ dh_testroot
+ dh_prep
+ dh_installdirs
+endef
+
+define dh_binary_post
+ dh_install $(DH_INSTALL_ARGS)
+ dh_installdocs $(if $(INSTALLDOCS_LINK_DOC),--link-doc=$(INSTALLDOCS_LINK_DOC))
+ dh_installchangelogs
+ dh_installexamples
+ dh_installman
+ dh_installudev
+ dh_bugfiles
+ dh_ucf
+ dh_lintian
+ dh_icons
+ dh_link
+ dh_compress
+ dh_fixperms
+ dh_missing
+ dh_strip
+ dh_makeshlibs
+ dh_shlibdeps $(DH_SHLIBDEPS_ARGS)
+ dh_installdeb
+ dh_gencontrol -- $(GENCONTROL_ARGS)
+ dh_md5sums
+ dh_builddeb -- $(BUILDDEB_ARGS)
+endef
+
+build-indep:
+
+build_image:
+
+binary_image: DH_OPTIONS = -p$(PACKAGE_NAME)
+binary_image: KERNEL_VERSION = $(ABINAME)$(LOCALVERSION)
+binary_image: IMAGE_PACKAGE_NAME = linux-image-$(KERNEL_VERSION)-unsigned
+binary_image: PACKAGE_DIR = debian/$(PACKAGE_NAME)
+binary_image: SIGNATURE_DIR = debian/signatures/$(IMAGE_PACKAGE_NAME)
+binary_image:
+ $(dh_binary_pre)
+ mkdir -p $(PACKAGE_DIR)/boot
+ rsync -a $(patsubst %,/boot/%-$(KERNEL_VERSION),config System.map $(IMAGE_INSTALL_STEM)) \
+ $(PACKAGE_DIR)/boot/
+ sbattach --attach $(SIGNATURE_DIR)/boot/vmlinuz-$(KERNEL_VERSION).sig \
+ $(PACKAGE_DIR)/boot/vmlinuz-$(KERNEL_VERSION)
+ mkdir -p $(PACKAGE_DIR)/lib/modules/$(KERNEL_VERSION)
+ rsync -a $(addprefix /lib/modules/$(KERNEL_VERSION)/,kernel modules.builtin modules.builtin.modinfo modules.order) \
+ $(PACKAGE_DIR)/lib/modules/$(KERNEL_VERSION)/
+# Copy any device tree files
+ if [ -d /usr/lib/linux-image-$(KERNEL_VERSION) ]; then \
+ mkdir -p $(PACKAGE_DIR)/usr/lib/linux-image-$(KERNEL_VERSION); \
+ rsync -a /usr/lib/linux-image-$(KERNEL_VERSION)/ \
+ $(PACKAGE_DIR)/usr/lib/linux-image-$(KERNEL_VERSION)/; \
+ fi
+# Copy bug scripts but change the info file to refer to the right package
+ mkdir -p $(PACKAGE_DIR)/usr/share/bug/$(PACKAGE_NAME)
+ rsync -a /usr/share/bug/$(IMAGE_PACKAGE_NAME)/ \
+ $(PACKAGE_DIR)/usr/share/bug/$(PACKAGE_NAME)/
+ sed -i -e 's/^PACKAGE_NAME=.*/PACKAGE_NAME=$(PACKAGE_NAME)/' \
+ -e 's/^PACKAGE_VERSION=.*/PACKAGE_VERSION=$(PACKAGE_VERSION)/' \
+ $(PACKAGE_DIR)/usr/share/bug/$(PACKAGE_NAME)/info
+ $(dh_binary_post)
+
+build_meta:
+
+binary_meta:
+ $(dh_binary_pre)
+ $(dh_binary_post)
+
+build_installer:
+
+binary_installer: REAL_VERSION = $(ABINAME)$(LOCALVERSION)
+binary_installer: export KW_DEFCONFIG_DIR=debian/installer
+binary_installer: export KW_CONFIG_DIR=debian/installer
+# XXX No make dependency exists for this directory
+binary_installer: export SOURCEDIR = debian/linux-image-$(REAL_VERSION)
+binary_installer: DH_OPTIONS_IMAGE = -p$(IMAGE_PACKAGE_NAME) --sourcedir=$(SOURCEDIR)
+binary_installer:
+ $(dh_binary_pre)
+ DH_OPTIONS="$(DH_OPTIONS_IMAGE)" dh_install boot/$(IMAGE_INSTALL_STEM)-$(REAL_VERSION)
+ DH_OPTIONS="$(DH_OPTIONS_IMAGE)" dh_install lib/modules/$(REAL_VERSION)/modules.builtin
+ DH_OPTIONS="$(DH_OPTIONS_IMAGE)" dh_install lib/modules/$(REAL_VERSION)/modules.order
+ifneq ($(filter arm64 armel armhf mipsel mips64el mipsr6 mipsr6el mips64r6 mips64r6el riscv64,$(ARCH)),)
+ DH_OPTIONS="$(DH_OPTIONS_IMAGE)" dh_install usr/lib/linux-image-$(REAL_VERSION)
+endif
+ kernel-wedge copy-modules $(ABINAME) $(FLAVOUR) $(REAL_VERSION)
+ kernel-wedge find-dups $(REAL_VERSION)
+ kernel-wedge find-unpackaged $(REAL_VERSION) $(REAL_VERSION)
+ kernel-wedge check $$(dh_listpackages)
+ dh_fixperms
+ dh_gencontrol -- $(GENCONTROL_ARGS)
+ dh_builddeb -- $(BUILDDEB_ARGS)
+
+.PHONY: build_% binary_%
diff --git a/debian/signing_templates/source/format b/debian/signing_templates/source/format
new file mode 100644
index 000000000..89ae9db8f
--- /dev/null
+++ b/debian/signing_templates/source/format
@@ -0,0 +1 @@
+3.0 (native)