Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5251454imb; Thu, 7 Mar 2019 11:06:33 -0800 (PST) X-Google-Smtp-Source: APXvYqyO1qEBHY6IjkNm6P3e5SWzEazmsNNnj2KBzOKqWSQsapyYrcbgNmCPVKRoYua9o5UI13RF X-Received: by 2002:a17:902:b404:: with SMTP id x4mr14565366plr.232.1551985593110; Thu, 07 Mar 2019 11:06:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551985593; cv=none; d=google.com; s=arc-20160816; b=Glx2JIkQgrQjyZK1pHdq9BFhrSDjn4wOaJzZYm44lpwk6UHmoqiTuF6zZvOYMpPg5e ohHD7Wl/Bnu7Khj9p2rO7Jg8fZWR+gCyD3CYc0zbbuGnPX9+ZrNNsafEWcYW7HCm56Z5 N97Czz2laewValRJdvuuKzOLFxEl6LQsm6ssfWfYlgyOMZJF1haoyi8v4dyg4pQsXIQF mkT7hmikXJYSSlpdCBJFN1Fj1dlJEh6xeeSSgzowyPs0+gEpNZ7zB55vzZOUXYuSBQjt y2WtubmEX4EYx1CuTrBDe2+zCYTbhbBuOmyDVprQozV+GMhgc69B4t8wBEFuEItYWGra ztew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:user-agent:openpgp:in-reply-to :content-disposition:mime-version:references:message-id:cc:to:from :date:dkim-signature; bh=07ZT7sdwBOVBcsFDW6KEYrhfpu5RXTx8PWmnMddWpAc=; b=FvwxIFiJKgp89vsjvu38wb9oP149pY0TqGIriS72qTemhewAoeMw6UMfI6uCYrgks5 nieEsvt8/eTFkeytpnL7nddxCTcK0JbkPWqlmzaW4faSMY1+1uC+itkxarr+s5hKYsz3 UuXEq2k99yn2a1ohO94OMlkkROwBdpKdVurkTPT8GG2WCmsHMY5LgA8lijixoxTdIaaZ Pr3M1+VBjyp/0hSElBJmM0408fZd8FaZk5JGROG3JEfdROWNhlgd1Ssn5d84RQiG/Ugo zRWBNsbYg0RiZ4WQBQNqxFCr8Dbtx9Llw2QpKAToYj5GomarntLy+2GBzNl36CDxt824 aS9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cs.msu.ru header.s=dkim header.b=QCNSxpKa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cs.msu.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m24si4829359pls.211.2019.03.07.11.06.17; Thu, 07 Mar 2019 11:06:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@cs.msu.ru header.s=dkim header.b=QCNSxpKa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cs.msu.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726431AbfCGTFo (ORCPT + 99 others); Thu, 7 Mar 2019 14:05:44 -0500 Received: from imap.cs.msu.ru ([188.44.42.39]:64541 "EHLO mail.cs.msu.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726318AbfCGTFn (ORCPT ); Thu, 7 Mar 2019 14:05:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cs.msu.ru; s=dkim; h=Subject:In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: 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=07ZT7sdwBOVBcsFDW6KEYrhfpu5RXTx8PWmnMddWpAc=; b=QCNSxpKaVt7aucbD4aWZKk4ejB qG0kAPQdl/7rQAsLIobKdmc+fF4GKure/ojaj+V039ovMlhyX7aTA9rHuivDXPuqg1yhjb7LhxbOQ ZG0nuyYEyPPNaUgFePgNGIBPjaGu0hA5cATIiajwCEc79w6k8TMxDwFQ6K0HPmc6uVVUcNvCF93bZ 0/9mu6smBw39wpvWhBxfe6EyXAfchG4O9AuFN7Cg32pscW/ptC/sqgSa/ain/e9QZc8ITxJm+m7vc ykM6ClIO3aLv8OHfRSb60SpNwULvJUF6LUA4gjR6KBhVvsZdXtm4aGIwucOvKrTUKBCrBethQJGtj DxfgfOjw==; Received: from [10.7.4.141] (port=33306 helo=cello) by mail.cs.msu.ru with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1h1yKk-000Lth-0O; Thu, 07 Mar 2019 22:05:34 +0300 Date: Thu, 7 Mar 2019 22:05:30 +0300 From: Arseny Maslennikov To: Masahiro Yamada Cc: Michal Marek , Linux Kbuild mailing list , Linux Kernel Mailing List , Riku Voipio Message-ID: <20190307190530.GA25561@cello> References: <20190221215901.23970-1-ar@cs.msu.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="d6Gm4EdcadzBjdND" Content-Disposition: inline In-Reply-To: OpenPGP: url=http://grep.cs.msu.ru/~ar/pgp-key.asc User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 10.7.4.141 X-SA-Exim-Mail-From: ar@cs.msu.ru X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.cs.msu.ru X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_ALL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Subject: Re: [PATCH] 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 08, 2019 at 12:32:11AM +0900, Masahiro Yamada wrote: > On Fri, Feb 22, 2019 at 7:19 AM Arseny Maslennikov wrote: > > > > It is widely known that one can build a kernel without a .config in the > > source tree >=20 > "without a .config in the source file" means > KCONFIG_CONFIG will probably contain '..' or absolute path. >=20 >=20 >=20 > ex1) KCONFIG_CONFIG=3D../my_dir/.config >=20 > ex2) KCONFIG_CONFIG=3D/absolute/pass/to/my/.config >=20 Hmm, I did not consider that; my bad, sorry. >=20 >=20 >=20 >=20 > > 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. >=20 >=20 > Did you notice the log 'Removing leading ...' from tar > for case ex1), ex2) ? >=20 >=20 > masahiro@grover:~/ref/linux$ make -j8 KCONFIG_CONFIG=3D../.config deb-p= kg > make clean > /bin/bash ./scripts/package/mkdebian > TAR linux-5.0.0+.tar.gz > tar: Removing leading `../' from member names Yes, I know tar does that. I mostly use KCONFIG_CONFIG with a bunch of config files in the source tree, so did not experience this while making sure the change makes sense. > ... >=20 >=20 > Even if I apply 3/3, it will produce a broken source package > since the tar will rip off the leading directory path, > then it mismatches to KCONFIG_CONFIG recorded in debian/rules. >=20 > A simple case like KCONFIG_CONFIG=3Dmy.config will work, > but I am not convinced with 3/3. >=20 So instead of this one and 3/3 we could ensure the source tarball contains a .config equal to the contents of KCONFIG_CONFIG provided to make(1), so the source package is fixed and its users are not confused. If the following is ok, I'll send a v2. A quick look at the generated orig tarball tells me it ought to work well. Something like this: diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 100a0d28ad25..8530fe267a76 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -44,6 +44,7 @@ if test "$(objtree)" !=3D "$(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 =20 --d6Gm4EdcadzBjdND Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE56JD3UKTLEu/ddrm9dQjyAYL01AFAlyBa3QACgkQ9dQjyAYL 01CxSw/9HJEvBrWN5BU6rEohXfDzq1odRKDg/VVHBaogxpUilnCMhg79UPyTr2Te Wl9Nobm4merPTYI94gHkYPNOV40Fk649cvfFq/zVJc0bna/SG1r3mDsJsGjaeeLF /6LNpJslkCVS1+EStvKkkdTAPNVChMjkISCyRNR8LffXGnh8dJbBPNeB9SwSd41N 1BiVWWm4nx1Ol479jYzHdETpn3uQLectT/YrCienqQJdPKTsEfvdnCj/nu8Bhte1 Ztbwe2dAlxeM2+E57vvnT5vzLTxsCt7Sn3LycPbM+42cl9EQwcPt56eKAk7+DSe1 zRZ9RaKG9VMz7kiBd9HJZX0UsDKoMcZWHgOeqxlpZ6g849R//FMwM/K2M1dW4RTS fQHDkBzklglbSd35OB7Fdi5YG/gYltD1hpjHht1yhECPjquNbJMkMz+S7Cqyox8M TRUuqpwjJXS+RfVHp9rtaqB4Wv8XxArVkyQbJLhlWOo1wIM/IzCR2QjfJC6hSRIH jB1/Qrh0kqLadjMmHcxTKk2J8hRG93W+79UPPcuVBaEWYUsUerKlSG9EVdWOwqxE 4WNujYXr0nWcjCjUFupJaPafc9KKDvnwZGzxFZ9ixpH2JzLPrr9niXfZAElJbn2a IhtbTCb7FwpQZhzYEGtv4LGcf2YCFIxxmpdAiSlhHstSt52/8oQ= =/0Sk -----END PGP SIGNATURE----- --d6Gm4EdcadzBjdND--