linux-headers-common: Make these packages architecture-independent

Include headers for all architectures that we build a kernel for.
This allows co-installation of per-flavour header packages for
multiple Debian architectures, and fixes the problem of arm64 headers
depending on arm headers that we did not include.
This commit is contained in:
Ben Hutchings 2016-11-17 16:29:12 +00:00
parent 48f370b3c2
commit eeb496a241
4 changed files with 53 additions and 29 deletions

View File

@ -125,6 +125,30 @@ class Gencontrol(Base):
'debian/linux-perf-%s.lintian-overrides' %
self.vars['version'])
def do_indep_featureset_setup(self, vars, makeflags, featureset, extra):
makeflags['LOCALVERSION'] = vars['localversion']
kernel_arches = set()
for arch in iter(self.config['base', ]['arches']):
if self.config.get_merge('base', arch, featureset, None, 'flavours'):
kernel_arches.add(self.config['base', arch]['kernel-arch'])
makeflags['ALL_KERNEL_ARCHES'] = ' '.join(sorted(list(kernel_arches)))
vars['featureset_desc'] = ''
if featureset != 'none':
desc = self.config[('description', None, featureset)]
desc_parts = desc['parts']
vars['featureset_desc'] = (' with the %s featureset' %
desc['part-short-%s' % desc_parts[0]])
def do_indep_featureset_packages(self, packages, makefile, featureset,
vars, makeflags, extra):
headers_featureset = self.templates["control.headers.featureset"]
packages.extend(self.process_packages(headers_featureset, vars))
cmds_binary_arch = ["$(MAKE) -f debian/rules.real binary-indep-featureset %s" %
makeflags]
makefile.add('binary-indep_%s_real' % featureset, cmds=cmds_binary_arch)
arch_makeflags = (
('kernel-arch', 'KERNEL_ARCH', False),
)
@ -247,15 +271,6 @@ class Gencontrol(Base):
config_base = self.config.merge('base', arch, featureset)
makeflags['LOCALVERSION_HEADERS'] = vars['localversion_headers'] = vars['localversion']
def do_featureset_packages(self, packages, makefile, arch, featureset, vars, makeflags, extra):
headers_featureset = self.templates["control.headers.featureset"]
package_headers = self.process_package(headers_featureset[0], vars)
merge_packages(packages, (package_headers,), arch)
cmds_binary_arch = ["$(MAKE) -f debian/rules.real binary-arch-featureset %s" % makeflags]
makefile.add('binary-arch_%s_%s_real' % (arch, featureset), cmds=cmds_binary_arch)
flavour_makeflags_base = (
('compiler', 'COMPILER', False),
('kernel-arch', 'KERNEL_ARCH', False),

4
debian/changelog vendored
View File

@ -10,6 +10,10 @@ linux (4.9~rc6-1~exp1) UNRELEASED; urgency=medium
QCOM_WCNSS_PIL and EXTCON_QCOM_SPMI_MISC.
* [arm64] Enable ARCH_MVEBU and related options.
[ Ben Hutchings ]
* linux-headers-common: Make these packages architecture-independent by
including headers for all architectures that we build a kernel for
-- Uwe Kleine-König <ukleinek@debian.org> Thu, 17 Nov 2016 09:55:16 +0100
linux (4.9~rc5-1~exp1) experimental; urgency=medium

29
debian/rules.real vendored
View File

@ -58,7 +58,6 @@ endif
ifneq ($(DO_LIBC),False)
binary-arch-arch: install-libc-dev_$(ARCH)
endif
binary-arch-featureset: install-headers_$(ARCH)_$(FEATURESET)
binary-arch-flavour: install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
ifeq ($(DEBUG),True)
binary-arch-flavour: install-image-dbg_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
@ -88,6 +87,8 @@ ifneq ($(DO_TOOLS),False)
# binary-indep: install-lockdep
endif
binary-indep-featureset: install-common-headers_$(FEATURESET)
build-arch-flavour: $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
setup-arch-flavour: $(STAMPS_DIR)/setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
@ -269,13 +270,13 @@ install-headers_$(ARCH):
dh_testroot
+$(MAKE_SELF) install-base GENCONTROL_ARGS='-Vkernel:Arch=$(ARCH)'
install-headers_$(ARCH)_$(FEATURESET): PACKAGE_NAME = linux-headers-$(ABINAME)-common$(LOCALVERSION_HEADERS)
install-headers_$(ARCH)_$(FEATURESET): PACKAGE_NAME_KBUILD = linux-kbuild-$(VERSION)
install-headers_$(ARCH)_$(FEATURESET): DH_OPTIONS = -p$(PACKAGE_NAME)
install-headers_$(ARCH)_$(FEATURESET): BASE_DIR = /usr/src/$(PACKAGE_NAME)
install-headers_$(ARCH)_$(FEATURESET): SOURCE_DIR = $(BUILD_DIR)/source_$(FEATURESET)
install-headers_$(ARCH)_$(FEATURESET): DIR = debian/$(PACKAGE_NAME)/$(BASE_DIR)
install-headers_$(ARCH)_$(FEATURESET): $(STAMPS_DIR)/source_$(FEATURESET)
install-common-headers_$(FEATURESET): PACKAGE_NAME = linux-headers-$(ABINAME)-common$(LOCALVERSION)
install-common-headers_$(FEATURESET): PACKAGE_NAME_KBUILD = linux-kbuild-$(VERSION)
install-common-headers_$(FEATURESET): DH_OPTIONS = -p$(PACKAGE_NAME)
install-common-headers_$(FEATURESET): BASE_DIR = /usr/src/$(PACKAGE_NAME)
install-common-headers_$(FEATURESET): SOURCE_DIR = $(BUILD_DIR)/source_$(FEATURESET)
install-common-headers_$(FEATURESET): DIR = debian/$(PACKAGE_NAME)/$(BASE_DIR)
install-common-headers_$(FEATURESET): $(STAMPS_DIR)/source_$(FEATURESET)
dh_testdir
dh_testroot
dh_prep
@ -283,11 +284,13 @@ install-headers_$(ARCH)_$(FEATURESET): $(STAMPS_DIR)/source_$(FEATURESET)
set -o pipefail; \
cd $(SOURCE_DIR); \
( \
echo Makefile; \
find arch/$(KERNEL_ARCH) -maxdepth 1 -name 'Makefile*' -print; \
find arch/$(KERNEL_ARCH) \( -name 'module.lds' -o -name 'Kbuild.platforms' -o -name 'Platform' \) -print; \
find $$(find arch/$(KERNEL_ARCH) \( -name include -o -name scripts \) -type d -print) -print; \
find include -print; \
echo Makefile; \
for arch in $(ALL_KERNEL_ARCHES); do \
find arch/$$arch -maxdepth 1 -name 'Makefile*' -print; \
find arch/$$arch \( -name 'module.lds' -o -name 'Kbuild.platforms' -o -name 'Platform' \) -print; \
find $$(find arch/$$arch \( -name include -o -name scripts \) -type d -print) -print; \
done; \
find include -print; \
) \
| \
cpio -pd --preserve-modification-time '$(CURDIR)/$(DIR)'

View File

@ -1,9 +1,11 @@
Package: linux-headers-@abiname@-common@localversion_headers@
Package: linux-headers-@abiname@-common@localversion@
Build-Profiles: <!stage1>
Architecture: all
Depends: ${misc:Depends}
Description: Common header files for Linux @abiname@@localversion_headers@
This package provides the architecture-specific common kernel header files
for Linux kernel version @abiname@@localversion_headers@, generally used for building out-of-tree
kernel modules. To obtain a complete set of headers you also need to install
the linux-headers-@abiname@-(flavour) package, matching the
flavour of the kernel you intend the build for.
Multi-Arch: foreign
Description: Common header files for Linux @abiname@@localversion@
This package provides the common kernel header files for Linux kernel
version @abiname@@featureset_desc@, generally used for building
out-of-tree kernel modules. To obtain a complete set of headers you
also need to install the linux-headers-@abiname@-(flavour) package,
matching the flavour of the kernel you intend the build for.