From patchwork Fri Mar 31 13:09:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 9656403 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5858C60351 for ; Fri, 31 Mar 2017 13:14:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 497EB28506 for ; Fri, 31 Mar 2017 13:14:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E30B28643; Fri, 31 Mar 2017 13:14:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CBE328506 for ; Fri, 31 Mar 2017 13:14:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933430AbdCaNLR (ORCPT ); Fri, 31 Mar 2017 09:11:17 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:32939 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933447AbdCaNJv (ORCPT ); Fri, 31 Mar 2017 09:09:51 -0400 Received: by mail-lf0-f49.google.com with SMTP id h125so43511604lfe.0 for ; Fri, 31 Mar 2017 06:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GytUdJAgdtnnJgQswo88KZJAiGIrR7/hHMxJZDSAuv8=; b=WIkla38cUj5HD+CZyhbIrwvpSNdtVKguCIazCdMSOAbG6k3JfOSP94z7qmwuS3HMyy hZuptWg/L5N4AfTetQsUNn6PYYWZe9zy80q96Le4+quol61grxfUmKzkB7ThjPWNRoLw QgYC/M3n3Edbbf18RA5ZjhRRlWaCrbYLl0dwY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GytUdJAgdtnnJgQswo88KZJAiGIrR7/hHMxJZDSAuv8=; b=c+ALBmYJdX3ACUo+XDoHeSUkbTwg5rwyeou2XIm4aNj+wHtVTaLvSW3X5aJMHA1Jc8 qgRIhZvlwTRFMobW6xKSL7wzUOxe/6dHludF+SiCa4go4DfudHBQ05NCy4/gg8gCWLji WgeSRGJzOre86DSKi54C5P7rQCjW1UkI6JRu062F0o98Uw4dlAj3KsjTVRaH1wmihqhV S2GzrCgtc5eFdeK7pDu4J4ds3CQvaqvJFD0SJfJavNqMWCa0uLzuqCLPf0LdwZxyB0ov NWsW78Z1UjezH5wuFDdY9OwZT2lC17ELCouqYe5pYLp9oN4inaa+Rfxtw3DicutqZJyi lbew== X-Gm-Message-State: AFeK/H3vuoNzwYdHNk+pF6vS4yo/6Ns5gz1te34AmEmciHlmjJcxehyA12y4mOTVr4HHXRro X-Received: by 10.25.23.215 with SMTP id 84mr931926lfx.148.1490965789409; Fri, 31 Mar 2017 06:09:49 -0700 (PDT) Received: from localhost.localdomain (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id h1sm933357lfk.33.2017.03.31.06.09.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Mar 2017 06:09:48 -0700 (PDT) From: riku.voipio@linaro.org To: linux-kbuild@vger.kernel.org, mmarek@suse.com Cc: yamada.masahiro@socionext.com, debian-kernel@lists.debian.org, Riku Voipio , Andrew Donnellan Subject: [PATCH 3/3] builddeb: add make fastdeb-pkg target Date: Fri, 31 Mar 2017 16:09:41 +0300 Message-Id: <20170331130941.5250-4-riku.voipio@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170331130941.5250-1-riku.voipio@linaro.org> References: <20170331130941.5250-1-riku.voipio@linaro.org> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Riku Voipio Currently, the deb-pkg and bindeb-pkg targets create multiple packages for the kernel binaries, headers, userspace headers and firmware. For developers who generate Debian packages as part of their development workflows, it's often not necessary to generate all these packages. Introduce new target, fastdeb-pkg, which only generates kernel packages. Re-order package build order so that kernel binary package is created first and we can exit cleanly unless generating rest packages with the old bindeb-pkg and deb-pkg targets. Cc: Andrew Donnellan Tested-By: Jim Davis Signed-off-by: Riku Voipio --- scripts/package/Makefile | 7 ++++++- scripts/package/builddeb | 49 +++++++++++++++++++++++++----------------------- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 71b4a8af9d4d..fc86cc3ae222 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -97,6 +97,10 @@ bindeb-pkg: FORCE $(MAKE) KBUILD_SRC= +$(call cmd,builddeb) +fastdeb-pkg: FORCE + $(MAKE) KBUILD_SRC= + +$(call cmd,builddeb) + clean-dirs += $(objtree)/debian/ @@ -142,7 +146,8 @@ help: FORCE @echo ' rpm-pkg - Build both source and binary RPM kernel packages' @echo ' binrpm-pkg - Build only the binary kernel RPM package' @echo ' deb-pkg - Build both source and binary deb kernel packages' - @echo ' bindeb-pkg - Build only the binary kernel deb package' + @echo ' bindeb-pkg - Build all binary kernel deb packages' + @echo ' fastdeb-pkg - Build only the binary kernel image deb package' @echo ' tar-pkg - Build the kernel as an uncompressed tarball' @echo ' targz-pkg - Build the kernel as a gzip compressed tarball' @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball' diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 3407826f2a99..6c2f57039d22 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -180,11 +180,6 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then fi fi -if [ "$ARCH" != "um" ]; then - $MAKE headers_check KBUILD_SRC= - $MAKE headers_install KBUILD_SRC= INSTALL_HDR_PATH="$libc_headers_dir/usr" -fi - # Install the maintainer scripts # Note: hook scripts under /etc/kernel are also executed by official Debian # kernel packages, as well as kernel packages built using make-kpkg. @@ -315,6 +310,32 @@ EOF fi +# Move firmware out of kernel image package. +if [ -e "$tmpdir/lib/firmware" ]; then + mv "$tmpdir/lib/firmware"/* "$fwdir/lib/firmware/$version/" + rmdir "$tmpdir/lib/firmware" +fi + +create_package "$packagename" "$tmpdir" +[ "x$1" = "xfastdeb-pkg" ] && exit 0 + +if [ -e "$fwdir/lib/firmware/$version" ]; then + cat <> debian/control + +Package: $fwpackagename +Architecture: all +Description: Linux kernel firmware, version $version + This package contains firmware from the Linux kernel, version $version. +EOF + + create_package "$fwpackagename" "$fwdir" +fi + +if [ "$ARCH" != "um" ]; then + $MAKE headers_check KBUILD_SRC= + $MAKE headers_install KBUILD_SRC= INSTALL_HDR_PATH="$libc_headers_dir/usr" +fi + # Build kernel header package (cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl) > "$objtree/debian/hdrsrcfiles" (cd $srctree; find arch/*/include include scripts -type f) >> "$objtree/debian/hdrsrcfiles" @@ -345,22 +366,6 @@ Description: Linux kernel headers for $KERNELRELEASE on \${kernel:debarch} This is useful for people who need to build external modules EOF -# Do we have firmware? Move it out of the way and build it into a package. -if [ -e "$tmpdir/lib/firmware" ]; then - mv "$tmpdir/lib/firmware"/* "$fwdir/lib/firmware/$version/" - rmdir "$tmpdir/lib/firmware" - - cat <> debian/control - -Package: $fwpackagename -Architecture: all -Description: Linux kernel firmware, version $version - This package contains firmware from the Linux kernel, version $version. -EOF - - create_package "$fwpackagename" "$fwdir" -fi - cat <> debian/control Package: $libc_headers_packagename @@ -377,8 +382,6 @@ if [ "$ARCH" != "um" ]; then create_package "$libc_headers_packagename" "$libc_headers_dir" fi -create_package "$packagename" "$tmpdir" - if [ -n "$BUILD_DEBUG" ] ; then # Build debug package # Different tools want the image in different locations