From patchwork Sat Mar 9 15:43:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseny Maslennikov X-Patchwork-Id: 10845995 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC0A0922 for ; Sat, 9 Mar 2019 15:44:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7EAE1FF3E for ; Sat, 9 Mar 2019 15:44:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C5142A5C5; Sat, 9 Mar 2019 15:44:01 +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.9 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 865EF284C3 for ; Sat, 9 Mar 2019 15:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726505AbfCIPnx (ORCPT ); Sat, 9 Mar 2019 10:43:53 -0500 Received: from imap.cs.msu.ru ([188.44.42.39]:52414 "EHLO mail.cs.msu.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726372AbfCIPnu (ORCPT ); Sat, 9 Mar 2019 10:43:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cs.msu.ru; s=dkim; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc: To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=lggRxzWvoqfJxyRfc5m6AD0bqLNWTNk6axPQzHT2cDg=; b=G8UPo275ParO04h5qr79vRWJ6j y9ofFM/t/SMasTHKeeDzvEJYc8nLv9NyppCy+S6Cx6WN1FoGPPAWf7PHLTnmSi3EGuYwY9C4mNfwz Zvc5IygPF7ROTzfRQ2O+FD0C31foguXCVjHqglEV3TEZqYNoSzphusdgBBhR2gaIY86GIgfxALHI8 ZKC13kGhAOS4wDJ+WrR3/TvC/PHNZ1bNTcvc1rbRW+kXa31UjLawgU07WBFJ5gtsNfoPCHX+lTqkS 8j1+M3XEuK4+chL0uGHWyVxD7BAI4wlyYyN8jBteVpbb8RvFDt+sHQoU38FCrinZkvOpeThJmShq7 ThxxtUwg==; Received: from [37.204.119.143] (port=44904 helo=localhost.localdomain) by mail.cs.msu.ru with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1h2e8Q-000IDA-Ni; Sat, 09 Mar 2019 18:43:38 +0300 From: Arseny Maslennikov To: Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arseny Maslennikov , Ben Hutchings , Riku Voipio Date: Sat, 9 Mar 2019 18:43:05 +0300 Message-Id: <20190309154307.23039-1-ar@cs.msu.ru> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 37.204.119.143 X-SA-Exim-Mail-From: ar@cs.msu.ru Subject: [PATCH v2 1/3] scripts/package/Makefile: put proper config in source tarball X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on mail.cs.msu.ru) 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 It is widely known that one can build a kernel without a .config in the source tree by setting KCONFIG_CONFIG equal to the actual configuration file path. When making a *-pkg target, make(1) prepares a source tarball and tries to pack `.config' in there regardless of the value of KCONFIG_CONFIG, failing spectacularly if .config is absent and packing the wrong config if it exists. Let's fix that by including whatever KCONFIG_CONFIG points to in the archive under the traditional name `.config'. We have to pass --absolute-names to tar, since it seems to trim the paths of archive members first and only then consider --transform, which breaks KCONFIG_CONFIG=../../some.config, as well as absolute paths. Signed-off-by: Arseny Maslennikov --- scripts/package/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 2c6de21e5152..134cefee068d 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -27,7 +27,7 @@ KDEB_SOURCENAME ?= linux-$(KERNELRELEASE) KBUILD_PKG_ROOTCMD ?="fakeroot -u" export KDEB_SOURCENAME # Include only those top-level files that are needed by make, plus the GPL copy -TAR_CONTENT := $(KBUILD_ALLDIRS) .config .scmversion Makefile \ +TAR_CONTENT := $(KBUILD_ALLDIRS) $(KCONFIG_CONFIG) .scmversion Makefile \ Kbuild Kconfig COPYING $(wildcard localversion*) MKSPEC := $(srctree)/scripts/package/mkspec @@ -44,6 +44,7 @@ if test "$(objtree)" != "$(srctree)"; then \ fi ; \ $(srctree)/scripts/setlocalversion --save-scmversion; \ tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \ + --absolute-names --transform 's:^$(KCONFIG_CONFIG)$$:.config:S' \ --transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3); \ rm -f $(objtree)/.scmversion From patchwork Sat Mar 9 15:43:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arseny Maslennikov X-Patchwork-Id: 10845997 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38887139A for ; Sat, 9 Mar 2019 15:44:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 252F61FF3E for ; Sat, 9 Mar 2019 15:44:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17BF92A5C5; Sat, 9 Mar 2019 15:44:03 +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.9 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 B81161FF3E for ; Sat, 9 Mar 2019 15:44:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726443AbfCIPnu (ORCPT ); Sat, 9 Mar 2019 10:43:50 -0500 Received: from imap.cs.msu.ru ([188.44.42.39]:53701 "EHLO mail.cs.msu.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbfCIPnt (ORCPT ); Sat, 9 Mar 2019 10:43:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cs.msu.ru; s=dkim; h=Subject:Content-Transfer-Encoding:Content-Type:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=IxQpZZp1jw2edUZ2FQBV5SphB3EGuIm0nBwjetxFqiE=; b=xkcLqf66sgRq19qkH4J5TGtmMD qwmlTJ7S1UTtIP9tBGEZBy0+/yS9nORnwj6eZ0rH04oeGzFS5157Mio6gZALD7MjJS3ozCo9m95GH hj6tX+BC5vhfjpnMu7Z6Zzzw5yMih9EjWpWFci7Wh7SCEY+VVzidnrCD/nLw1POkc5CZcvHZbMswA IIkJPWSpWGwM6urxat5alvch8ZwmhSk5xGUXHHUOKP7xLn70vACvPviXG7f7gkMXHVwgmTamLtzoI Ui8euR647Yz60WKOk/z5xA5SNnB/1v2HtzsIeons7VUQ6o5+s2/qhMtQGY274VG4tjZeKf4OqmCoj ZfiLdADw==; Received: from [37.204.119.143] (port=44904 helo=localhost.localdomain) by mail.cs.msu.ru with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1h2e8S-000IDA-Ec; Sat, 09 Mar 2019 18:43:40 +0300 From: Arseny Maslennikov To: Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arseny Maslennikov , Ben Hutchings , Riku Voipio Date: Sat, 9 Mar 2019 18:43:06 +0300 Message-Id: <20190309154307.23039-2-ar@cs.msu.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190309154307.23039-1-ar@cs.msu.ru> References: <20190309154307.23039-1-ar@cs.msu.ru> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 37.204.119.143 X-SA-Exim-Mail-From: ar@cs.msu.ru Subject: [PATCH v2 2/3] scripts/package/mkdebian: avoid implicit effects X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on mail.cs.msu.ru) 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 * The man page for dpkg-source(1) notes: > -b, --build directory [format-specific-parameters] > Build a source package (--build since dpkg 1.17.14). > <...> > > dpkg-source will build the source package with the first > format found in this ordered list: the format indicated > with the --format command line option, the format > indicated in debian/source/format, “1.0”. The fallback > to “1.0” is deprecated and will be removed at some point > in the future, you should always document the desired > source format in debian/source/format. See section > SOURCE PACKAGE FORMATS for an extensive description of > the various source package formats. Thus it would be more foolproof to explicitly use 1.0 (as we always did) than to rely on dpkg-source's defaults. * In a similar vein, debian/rules is not made executable by mkdebian, and dpkg-source warns about that but still silently fixes the file. Let's be explicit once again. Signed-off-by: Arseny Maslennikov --- scripts/package/mkdebian | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian index f030961c5165..d276eb671a27 100755 --- a/scripts/package/mkdebian +++ b/scripts/package/mkdebian @@ -132,7 +132,9 @@ else echo >&2 "Install lsb-release or set \$KDEB_CHANGELOG_DIST explicitly" fi -mkdir -p debian/ +mkdir -p debian/source/ +echo "1.0" > debian/source/format + echo $debarch > debian/arch # Generate a simple changelog template @@ -221,5 +223,6 @@ clean: binary: binary-arch EOF +chmod +x debian/rules exit 0 From patchwork Sat Mar 9 15:43:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseny Maslennikov X-Patchwork-Id: 10845993 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A8125139A for ; Sat, 9 Mar 2019 15:43:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 866C82C653 for ; Sat, 9 Mar 2019 15:43:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 763CB2C69C; Sat, 9 Mar 2019 15:43:51 +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.9 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 75E352C653 for ; Sat, 9 Mar 2019 15:43:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726392AbfCIPns (ORCPT ); Sat, 9 Mar 2019 10:43:48 -0500 Received: from imap.cs.msu.ru ([188.44.42.39]:50712 "EHLO mail.cs.msu.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726286AbfCIPns (ORCPT ); Sat, 9 Mar 2019 10:43:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cs.msu.ru; s=dkim; h=Subject:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=a2A+taKjoNPZbH6GRbsyFcp2CMYguJDwXGJstd7lijw=; b=OEyIdflYbiyZxB73Lh8/4b+3F3 w++BzTM8I2WmfH5r41P0dZ9smV9ViXp8OzBGtuBU62AYnM48qLOx1hcAlfub/G9cD2CmBRDeZeb8t NoVbRgdS+JUQmGhRpusjfqfRcVeQ+EXn6NedmNRHn7UCyreDyQcQmEuinONWJS47EydU7mvKa43r2 9ryVfjBeyONQaxWXdw04SLFY2QCe0y1DIGbOBUF5CvsU3tj4ZmorYYR/EbP8dUZmtjTUzc19PMXXY i2OEH+0kwbkm73RTxmhKufRrL46g28jJ6cjTt7Hrudo+k1+jYPbLZi5CFqF2mNvo4l/YViUrR1rKE PhMW2zEw==; Received: from [37.204.119.143] (port=44904 helo=localhost.localdomain) by mail.cs.msu.ru with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1h2e8T-000IDA-NA; Sat, 09 Mar 2019 18:43:41 +0300 From: Arseny Maslennikov To: Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arseny Maslennikov , Ben Hutchings , Riku Voipio Date: Sat, 9 Mar 2019 18:43:07 +0300 Message-Id: <20190309154307.23039-3-ar@cs.msu.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190309154307.23039-1-ar@cs.msu.ru> References: <20190309154307.23039-1-ar@cs.msu.ru> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 37.204.119.143 X-SA-Exim-Mail-From: ar@cs.msu.ru Subject: [PATCH v2 3/3] package: {mkdebian,Makefile}: ignore .config in dpkg-source diffs X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on mail.cs.msu.ru) 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 * We'd like to make dpkg-source ignore certain filepath patterns while producing the .diff.gz as part of a Debian source package. The relationship between dpkg-source's -i and --extend-diff-ignore options is quite complicated[1]. It's thus not very convenient to specify file path patterns to ignore on dpkg-buildpackage's command line (they do not end up in the source package as well), so we turn `-i.git' into a record in debian/source/options. Besides, the dot in `-i.git' is a metacharacter and matches a tad too much. * In cases where a .config exists in the source tree, but the .config in the source tarball is provided by wherever KCONFIG_CONFIG pointed to, dpkg-source would attempt to replace the second, proper one with the first one, which is undesirable and nullifies the effort made to put the proper config in the source tarball. To prevent this, force dpkg-source to ignore /^[.]config$/ as well. This makes it possible to build working Debian source packages with a redefined KCONFIG_CONFIG: - that file is put in the source tarball at its traditional place, and the diff.gz does not dare touch it; - when the source package is rebuilt, debian/rules initiates the build process with the desired config already in the standard location. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=625789#22 Signed-off-by: Arseny Maslennikov --- scripts/package/Makefile | 2 +- scripts/package/mkdebian | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 134cefee068d..f2fca7e7d9fa 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -73,7 +73,7 @@ deb-pkg: FORCE $(call cmd,src_tar,$(KDEB_SOURCENAME)) origversion=$$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$$//');\ mv $(KDEB_SOURCENAME).tar.gz ../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz - +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -i.git -us -uc + +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -us -uc bindeb-pkg: FORCE $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian index d276eb671a27..74158c7f28ea 100755 --- a/scripts/package/mkdebian +++ b/scripts/package/mkdebian @@ -135,6 +135,12 @@ fi mkdir -p debian/source/ echo "1.0" > debian/source/format +cat < debian/source/options +# The regexes are matched against paths from the source tree. +diff-ignore = "[.]git" +extend-diff-ignore = "^[.]config$" +EOF + echo $debarch > debian/arch # Generate a simple changelog template