From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 897D4C433FE for ; Tue, 15 Nov 2022 19:18:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229680AbiKOTSE (ORCPT ); Tue, 15 Nov 2022 14:18:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230399AbiKOTR6 (ORCPT ); Tue, 15 Nov 2022 14:17:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C1DA12613; Tue, 15 Nov 2022 11:17:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 95E8E619D9; Tue, 15 Nov 2022 19:17:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE09EC433C1; Tue, 15 Nov 2022 19:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668539877; bh=KyRsvFEBwVPz5tDYyoud/S831SbVw7pwwS+jJZ8uaac=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kB9RUqdXsgq9yGL2OzsVGokrxUVQzPw2/UL/9j5PdAvKYAPTeAY/Mi9t1Tu631Woh qWBj2j24P7g4lWCS3J40TBc7x4FSfBfL4sQGtCccRmTU1y2vu9JBZzxxPEqZV/Ooug APpaRrVTenVXXfOyqrndBlIrUOpj9SwISUmx/mdEz0Qn8boUJ2Zg8tSIeDABi6yghT uMv4JCE9aUQzSrXTYg54GhVKchv/7CFUve/VLWXIK/PFMOzb2cBd7JQLG9/9ClW8e3 buRp0FEL506cDaSZvcrlGRpkTUVDht1MkGvQ+NwYJVan4gHW0X9h97ikbTDuA4bO4n K5OVW93HKwXmA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ov1RS-006I43-Ki; Tue, 15 Nov 2022 19:17:54 +0000 Date: Tue, 15 Nov 2022 19:17:54 +0000 Message-ID: <86a64sowm5.wl-maz@kernel.org> From: Marc Zyngier To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Marek , Nick Desaulniers Subject: Re: [PATCH] kbuild: Restore .version auto-increment behaviour for Debian/RPM packages In-Reply-To: References: <20221113160237.3152770-1-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: masahiroy@kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, michal.lkml@markovi.net, ndesaulniers@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Nov 2022 03:36:05 +0000, Masahiro Yamada wrote: > > On Tue, Nov 15, 2022 at 9:09 AM Masahiro Yamada wrote: > > > > On Mon, Nov 14, 2022 at 1:02 AM Marc Zyngier wrote: > > > > > > diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian > > > index 60a2a63a5e90..e5c983afddab 100755 > > > --- a/scripts/package/mkdebian > > > +++ b/scripts/package/mkdebian > > > @@ -90,7 +90,7 @@ if [ -n "$KDEB_PKGVERSION" ]; then > > > packageversion=$KDEB_PKGVERSION > > > revision=${packageversion##*-} > > > else > > > - revision=$(cat .version 2>/dev/null||echo 1) > > > + revision=$(init/build-version) > > > > > > This does not work for out-of-tree builds > > because init/build-version is a check-in source file. > > > > > > > > For example, "make O=/tmp/foo bindeb-pkg" fails with: > > .../linux/scripts/package/mkdebian: 93: init/build-version: not found > > > > > > The correct code is: > > > > > > revision=$($srctree/init/build-version) > > > > > > > > > > > packageversion=$version-$revision > > > fi > > > sourcename=$KDEB_SOURCENAME > > > diff --git a/scripts/package/mkspec b/scripts/package/mkspec > > > index 70392fd2fd29..9cbd45f497ba 100755 > > > --- a/scripts/package/mkspec > > > +++ b/scripts/package/mkspec > > > @@ -42,7 +42,7 @@ sed -e '/^DEL/d' -e 's/^\t*//' < > > Name: kernel > > > Summary: The Linux Kernel > > > Version: $__KERNELRELEASE > > > - Release: $(cat .version 2>/dev/null || echo 1) > > > + Release: $(init/build-version) > > > > > > Ditto. > > > > Release: $($srctree/init/build-version) > > > > No, mkspec needs no change because binrpm-pkg builds the kernel > _before_ generating the spec file. > > If you increment the .version file here again, you would have > the revision mismatch between the package and the actual vmlinuz. > > > > Please send the change for mkdebian only. Yup, good point on both count. Patch incoming shortly. Thanks, M. -- Without deviation from the norm, progress is not possible.