From patchwork Thu Aug 5 11:02:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 60949 X-Patchwork-Delegate: leann.ogasawara@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id F2171B70A6 for ; Thu, 5 Aug 2010 21:03:27 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OgyDw-0007n7-Up; Thu, 05 Aug 2010 12:02:57 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OgyDu-0007mW-N3 for kernel-team@lists.ubuntu.com; Thu, 05 Aug 2010 12:02:54 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1OgyDu-0006IN-JQ for ; Thu, 05 Aug 2010 12:02:54 +0100 Received: from [85.210.148.55] (helo=localhost.localdomain) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1OgyDu-0003va-Dl for kernel-team@lists.ubuntu.com; Thu, 05 Aug 2010 12:02:54 +0100 From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/2] UBUNTU: add support for building selected stages of kernel Date: Thu, 5 Aug 2010 12:02:51 +0100 Message-Id: <1281006172-29467-2-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1281006172-29467-1-git-send-email-apw@canonical.com> References: <1281006172-29467-1-git-send-email-apw@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com BugLink: http://bugs.launchpad.net/bugs/603087 To bootstrap in a cross-compile environment we need to be able to build the compiler and libc, for this we need linux-libc-dev from the kernel. However we cannot build the kernel without the compiler. Catch 22. This patch adds "DEB_STAGE=stage1" variable which skips building kernel requesting only the linux-libc-dev package. Based on a patch by Marcin Juszkiewicz Signed-off-by: Andy Whitcroft Acked-by: Stefan Bader --- debian/rules | 9 +++++++++ debian/rules.d/0-common-vars.mk | 6 ++++++ debian/rules.d/1-maintainer.mk | 3 +++ debian/rules.d/2-binary-arch.mk | 10 +++++++++- debian/rules.d/3-binary-indep.mk | 2 ++ 5 files changed, 29 insertions(+), 1 deletions(-) diff --git a/debian/rules b/debian/rules index b167196..92ec033 100755 --- a/debian/rules +++ b/debian/rules @@ -29,6 +29,15 @@ include $(DROOT)/rules.d/0-common-vars.mk # Maintainer targets include $(DROOT)/rules.d/1-maintainer.mk +# Stages +ifeq ($(DEB_STAGE),stage1) + do_tools=false + do_doc_package=false + do_source_package=false + do_flavour_image_package=false + do_flavour_header_package=false +endif + # Debian Build System targets binary: binary-indep binary-arch diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk index b59656c..2880576 100644 --- a/debian/rules.d/0-common-vars.mk +++ b/debian/rules.d/0-common-vars.mk @@ -141,6 +141,12 @@ endif tools_pkg_name=$(src_pkg_name)-tools-$(abi_release) tools_common_pkg_name=$(src_pkg_name)-tools-common +# The general flavour specific image package. +do_flavour_image_package=true + +# The general flavour specific header package. +do_flavour_header_package=true + # Support parallel= in DEB_BUILD_OPTIONS (see #209008) # # These 2 environment variables set the -j value of the kernel build. For example, diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk index 65b9688..4443274 100644 --- a/debian/rules.d/1-maintainer.mk +++ b/debian/rules.d/1-maintainer.mk @@ -102,9 +102,12 @@ endif @echo "do_source_package = $(do_source_package)" @echo "do_source_package_content = $(do_source_package_content)" @echo "do_libc_dev_package = $(do_libc_dev_package)" + @echo "do_flavour_image_package = $(do_flavour_image_package)" + @echo "do_flavour_header_package = $(do_flavour_header_package)" @echo "do_common_headers_indep = $(do_common_headers_indep)" @echo "do_full_source = $(do_full_source)" @echo "do_tools = $(do_tools)" + @echo "full_build = $(full_build)" printchanges: @baseCommit=$$(git log --pretty=format:'%H %s' | \ diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index ace4d85..6a07d3c 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -377,16 +377,24 @@ endif binary-debs: binary-perarch $(stampdir)/stamp-flavours $(addprefix binary-,$(flavours)) -build-arch: $(addprefix build-,$(flavours)) +build-arch-deps = +ifeq ($(do_flavour_image_package),true) +build-arch-deps += $(addprefix build-,$(flavours)) +endif +build-arch: $(build-arch-deps) +ifeq ($(do_flavour_image_package),true) binary-arch-deps = binary-debs ifeq ($(AUTOBUILD),) binary-arch-deps += binary-udebs endif +endif ifeq ($(do_libc_dev_package),true) binary-arch-deps += binary-arch-headers endif ifneq ($(do_common_headers_indep),true) +ifeq ($(do_flavour_header_package),true) binary-arch-deps += binary-headers endif +endif binary-arch: $(binary-arch-deps) diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk index d8f2407..c4ac483 100644 --- a/debian/rules.d/3-binary-indep.mk +++ b/debian/rules.d/3-binary-indep.mk @@ -97,8 +97,10 @@ install-tools: install-indep-deps = ifeq ($(do_common_headers_indep),true) +ifeq ($(do_flavour_header_package),true) install-indep-deps += install-headers endif +endif ifeq ($(do_doc_package),true) install-indep-deps += install-doc endif