From patchwork Thu Mar 12 05:50:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Triplett X-Patchwork-Id: 11433253 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17765161F for ; Thu, 12 Mar 2020 05:50:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F229220663 for ; Thu, 12 Mar 2020 05:50:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387767AbgCLFu6 (ORCPT ); Thu, 12 Mar 2020 01:50:58 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:34555 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387677AbgCLFu6 (ORCPT ); Thu, 12 Mar 2020 01:50:58 -0400 X-Originating-IP: 105.154.211.150 Received: from localhost (unknown [105.154.211.150]) (Authenticated sender: josh@joshtriplett.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 44E1D60005; Thu, 12 Mar 2020 05:50:54 +0000 (UTC) Date: Thu, 12 Mar 2020 06:50:53 +0100 From: Josh Triplett To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: Add an "imgdeb-pkg" target to build only linux-image Message-ID: MIME-Version: 1.0 Content-Disposition: inline Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org This skips building the linux-headers and linux-libc-dev packages, which take much longer to build, and which aren't needed for many common test scenarios. Signed-off-by: Josh Triplett --- scripts/Makefile.package | 5 +++++ scripts/package/builddeb | 2 +- scripts/package/mkdebian | 33 +++++++++++++++++++++++---------- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 02135d2671a6..efc2f2f69bc1 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -82,6 +82,11 @@ bindeb-pkg: $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc +PHONY += imgdeb-pkg +imgdeb-pkg: + DEBIAN_IMAGE_ONLY=1 $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian + +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc + PHONY += intdeb-pkg intdeb-pkg: +$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 6df3c9f8b2da..c7615a35f34f 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -201,7 +201,7 @@ EOF chmod 755 "$tmpdir/DEBIAN/$script" done -if [ "$ARCH" != "um" ]; then +if [ "$ARCH" != "um" ] && [ -z "$DEBIAN_IMAGE_ONLY" ]; then deploy_kernel_headers debian/linux-headers create_package linux-headers-$version debian/linux-headers diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian index 357dc56bcf30..9969855d2eb8 100755 --- a/scripts/package/mkdebian +++ b/scripts/package/mkdebian @@ -169,7 +169,8 @@ License version 2 can be found in \`/usr/share/common-licenses/GPL-2'. EOF # Generate a control file -cat < debian/control +{ + cat < debian/control + +if [ -n "$DEBIAN_IMAGE_ONLY" ]; then + DEBIAN_IMAGE_ONLY_ENV="DEBIAN_IMAGE_ONLY=1" +fi cat < debian/rules #!$(command -v $MAKE) -f @@ -214,11 +225,13 @@ srctree ?= . build: \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ - KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile + KBUILD_BUILD_VERSION=${revision} ${DEBIAN_IMAGE_ONLY_ENV} \ + -f \$(srctree)/Makefile binary-arch: \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ - KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile intdeb-pkg + KBUILD_BUILD_VERSION=${revision} ${DEBIAN_IMAGE_ONLY_ENV} \ + -f \$(srctree)/Makefile intdeb-pkg clean: rm -rf debian/*tmp debian/files