Move config files from linux-source to an arch-dependent linux-config package

In Linux 4.18, various compiler version and feature tests are invoked
via kconfig rather than via kbuild.  This means that we generally
cannot generate kconfig files for foreign architectures.

Move the config files to a new linux-config-<version> package which is
arch-dependent (and also M-A: same).

Make linux-config-<version> and linux-source-<version> recommend each
other.
This commit is contained in:
Ben Hutchings 2018-07-03 02:57:30 +01:00
parent 7f113f9112
commit a14e37b110
5 changed files with 42 additions and 21 deletions

View File

@ -81,6 +81,7 @@ class Gencontrol(Base):
makeflags['DO_TOOLS_UNVERSIONED'] = False
if not self.config.merge('packages').get('tools-versioned', True):
makeflags['DO_TOOLS_VERSIONED'] = False
makeflags['SOURCE_BASENAME'] = self.vars['source_basename']
# Prepare to generate debian/tests/control
self.tests_control = None
@ -99,27 +100,14 @@ class Gencontrol(Base):
['source_%s_real' % featureset])
makefile.add('source', ['source_%s' % featureset])
triplet_enabled = []
for arch in iter(self.config['base', ]['arches']):
for featureset in self.config['base', arch].get('featuresets', ()):
if self.config.merge('base', None, featureset).get('enabled', True):
for flavour in self.config['base', arch, featureset]['flavours']:
triplet_enabled.append('%s_%s_%s' %
(arch, featureset, flavour))
makeflags = makeflags.copy()
makeflags['ALL_FEATURESETS'] = ' '.join(fs_enabled)
makeflags['ALL_TRIPLETS'] = ' '.join(triplet_enabled)
makeflags['SOURCE_BASENAME'] = self.vars['source_basename']
if not self.config.merge('packages').get('docs', True):
makeflags['DO_DOCS'] = False
if not self.config.merge('packages').get('source', True):
makeflags['DO_SOURCE'] = False
super(Gencontrol, self).do_main_makefile(makefile, makeflags, extra)
# linux-source-$UPSTREAMVERSION will contain all kconfig files
makefile.add('binary-indep', deps=['setup'])
def do_main_packages(self, packages, vars, makeflags, extra):
packages.extend(self.process_packages(self.templates["control.main"], self.vars))
if self.config.merge('packages').get('docs', True):
@ -210,11 +198,21 @@ class Gencontrol(Base):
merge_packages(packages, packages_headers_arch, arch)
if (self.config['base', arch].get('featuresets') and
self.config.merge('packages').get('source', True)):
merge_packages(packages,
self.process_packages(
self.templates["control.config"], vars),
arch)
else:
makeflags['DO_CONFIG'] = False
cmds_build_arch = ["$(MAKE) -f debian/rules.real build-arch-arch %s" % makeflags]
makefile.add('build-arch_%s_real' % arch, cmds=cmds_build_arch)
cmds_binary_arch = ["$(MAKE) -f debian/rules.real binary-arch-arch %s" % makeflags]
makefile.add('binary-arch_%s_real' % arch, cmds=cmds_binary_arch)
makefile.add('binary-arch_%s_real' % arch, cmds=cmds_binary_arch,
deps=['setup_%s' % arch])
# For stage1 build profile
makefile.add('binary-libc-dev_%s' % arch,

2
debian/changelog vendored
View File

@ -7,6 +7,8 @@ linux (4.18~rc3-1~exp1) UNRELEASED; urgency=medium
* netfilter: ipvs: Fix invalid bytes in IP_VS_MH_TAB_INDEX help text
* Update config for 4.18 using kconfigeditor2
- [x86,arm64] PCI: HOTPLUG_PCI_SHPC is now built-in
* Move config files from linux-source-<version> to an arch-dependent
linux-config-<version> package
[ YunQiang Su ]
* [mips*r6*] Enable dtb building for boston.

22
debian/rules.real vendored
View File

@ -52,6 +52,9 @@ build-indep:
binary-arch-arch:
binary-indep:
ifneq ($(DO_CONFIG),False)
binary-arch-arch: install-config_$(ARCH)
endif
ifneq ($(DO_HEADERS_ALL),False)
binary-arch-arch: install-headers_$(ARCH)
endif
@ -554,19 +557,26 @@ install-source: DH_OPTIONS = -p$(PACKAGE_NAME)
install-source: $(BUILD_DIR)/$(SOURCE_BASENAME)-source-$(UPSTREAMVERSION).tar.xz $(foreach FEATURESET,$(filter-out none,$(ALL_FEATURESETS)),$(BUILD_DIR)/linux-patch-$(UPSTREAMVERSION)-$(FEATURESET).patch.xz)
dh_testdir
dh_testroot
dh_installdirs /usr/src/linux-config-$(UPSTREAMVERSION)
dh_install $^ /usr/src
# Include our kernel config files, but with the module signing
# configuration fixed to work for custom kernels.
for triplet in $(ALL_TRIPLETS); do \
sed '/CONFIG_\(MODULE_SIG_\(ALL\|KEY\)\|SYSTEM_TRUSTED_KEYS\)[ =]/d' $(BUILD_DIR)/build_$$triplet/.config | xz -c >debian/$(PACKAGE_NAME)/usr/src/linux-config-$(UPSTREAMVERSION)/config.$$triplet.xz; \
done
# We don't want to recompress, but -Znone is not compatible with older
# tools and is currently rejected by dak. -Zgzip -z0 (uncompressed
# data.tar.gz!) makes dpkg and dak happy, but is incomaptible with
# other things (#725492). So use the fastest real gzip mode.
+$(MAKE_SELF) install-base BUILDDEB_ARGS='-Zgzip -z1'
install-config_$(ARCH): PACKAGE_NAME = $(SOURCE_BASENAME)-config-$(VERSION)
install-config_$(ARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
install-config_$(ARCH): TRIPLETS = $(subst $(BUILD_DIR)/build_,,$(wildcard $(BUILD_DIR)/build_$(ARCH)_*_*))
install-config_$(ARCH):
dh_testdir
dh_testroot
dh_installdirs /usr/src/linux-config-$(UPSTREAMVERSION)
# Fix the module signing configuration to work for custom kernels
for triplet in $(TRIPLETS); do \
sed '/CONFIG_\(MODULE_SIG_\(ALL\|KEY\)\|SYSTEM_TRUSTED_KEYS\)[ =]/d' $(BUILD_DIR)/build_$$triplet/.config | xz -c >debian/$(PACKAGE_NAME)/usr/src/linux-config-$(UPSTREAMVERSION)/config.$$triplet.xz; \
done
+$(MAKE_SELF) install-base
define make-tools
+mkdir -p $(BUILD_DIR)/build-tools/$(1) && $(MAKE_CLEAN) -C $(BUILD_DIR)/build-tools/$(1) -f $(CURDIR)/debian/rules.d/$(1)/Makefile top_srcdir=$(CURDIR) top_rulesdir=$(CURDIR)/debian/rules.d OUTDIR=$(1) VERSION=$(VERSION)
endef

11
debian/templates/control.config.in vendored Normal file
View File

@ -0,0 +1,11 @@
Package: @source_basename@-config-@version@
Build-Profiles: <!stage1 !pkg.linux.nosource>
Multi-Arch: same
Depends: ${misc:Depends}
Recommends: @source_basename@-source-@version@
Description: Debian kernel configurations for Linux @version@
This package contains the configuration files used to build the
official Debian kernel files, but without references to Debian's
signing certificates.
.
These can be used as a basis for configuring custom kernels.

View File

@ -3,7 +3,7 @@ Build-Profiles: <!stage1 !pkg.linux.nosource>
Architecture: all
Section: kernel
Depends: binutils, xz-utils, ${misc:Depends}
Recommends: libc6-dev | libc-dev, gcc, make, bc
Recommends: libc6-dev | libc-dev, gcc, make, bc, @source_basename@-config-@version@
Suggests: libncurses-dev | ncurses-dev, libqt4-dev, pkg-config
Multi-Arch: foreign
Description: Linux kernel source for version @version@ with Debian patches