From 6c6ec648591b032a677fe6ff0787c494821fa5c6 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 22 Jul 2013 00:02:50 +0000 Subject: [PATCH] linux-source: Install kernel config files for linux-image packages The kernel config files used to be uploaded to http://kernel.alioth.debian.org/config/ or elsewhere, and people occasionally request them, but we have no infrastructure to automatically do that and I rarely remember to do it. These are presumably wanted as a starting point by people building custom packages who don't want to download the linux-image package, so add them to the linux-source-$UPSTREAMVERSION package. We can already generate all the config files without any cross-toolchain using the 'setup' target in rules.gen, except that the 'make prepare' command in rules.real will fail. This command is unnecessary as 'prepare' is a dependency of any build target we use in our 'build-arch' rule, so remove it. svn path=/dists/sid/linux/; revision=20400 --- debian/bin/gencontrol.py | 12 ++++++++++++ debian/changelog | 2 ++ debian/rules.real | 8 ++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/debian/bin/gencontrol.py b/debian/bin/gencontrol.py index 46dc6d758..7361f22c2 100755 --- a/debian/bin/gencontrol.py +++ b/debian/bin/gencontrol.py @@ -73,10 +73,22 @@ 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) 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)) diff --git a/debian/changelog b/debian/changelog index 5760ce86c..dffb740c5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,8 @@ linux (3.10.1-2) UNRELEASED; urgency=low * [armhf/armmp] Enable NET_CALXEDA_XGMAC as module (Closes: #717269) * linux-source: Switch compression of tarball and patch to xz. Disable compression of package (but use gzip, to keep old tools happy). + * linux-source: Install kernel config files for linux-image packages in + /usr/src/linux-config-$UPSTREAMVERSION directory -- Arnaud Patard Tue, 16 Jul 2013 08:19:29 +0200 diff --git a/debian/rules.real b/debian/rules.real index ecd7eba8e..0822ca89d 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -145,7 +145,6 @@ ifdef CFLAGS_KERNEL endif +$(MAKE_CLEAN) -C '$(SOURCE_DIR)' O='$(CURDIR)/$(DIR)' V=1 listnewconfig +yes "" | $(MAKE_CLEAN) -C '$(SOURCE_DIR)' O='$(CURDIR)/$(DIR)' oldconfig >/dev/null - +$(MAKE_CLEAN) -C '$(SOURCE_DIR)' O='$(CURDIR)/$(DIR)' prepare @$(stamp) $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE): DIR=$(BUILD_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR) @@ -495,11 +494,16 @@ install-udeb_$(ARCH): dh_gencontrol dh_builddeb -install-source: DH_OPTIONS = -plinux-source-$(VERSION) +install-source: PACKAGE_NAME = linux-source-$(VERSION) +install-source: DH_OPTIONS = -p$(PACKAGE_NAME) install-source: $(BUILD_DIR)/linux-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 + for triplet in $(ALL_TRIPLETS); do \ + xz -c $(BUILD_DIR)/build_$$triplet/.config >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 has almost the # same effect.