From patchwork Sun Jan 22 14:14:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 46951 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1169780wrn; Sun, 22 Jan 2023 06:17:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXuZa2XxQZTLv7FkX36xU7MWu7ZsKEzJMQK3veUi5BpF9IYVmCweb+zBT7ph0RoCweSwFg5t X-Received: by 2002:a17:906:d971:b0:870:7e7d:97a7 with SMTP id rp17-20020a170906d97100b008707e7d97a7mr19959548ejb.72.1674397046046; Sun, 22 Jan 2023 06:17:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674397046; cv=none; d=google.com; s=arc-20160816; b=HX+OG0b21fUAUpqpIGBkBsiVzqq6FYruvLAztX3TagYDzPPJHRgS6GSxk1VYSGfcHy PZeQUioZrcAx7yY+tjCm7hoTQq6cL6ysJaDsx2ydUnt+QpiJfLEueeQbNF4rR/fJjDsi hCzlasyE8XwIjyfIiHqfsU3kABQakV0Ybw07tSMne4/oPFYb/XvbtY9Qrd3iioWIIPL0 DYLfMfSvdmXpkLZ+B0i9cBq5Pdnyxxk749zhAWC2UR5FrCpQlarKYgm9Yu+vaU6SZ+D5 xhAM+hDg6E1xYe5ZStST6gZa8nileWOcS2lsD8BDz/sOJkvv/1zSKkTov53ryJrkz4iB Tgog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0GwxEmlRmVKXjdZQ6qbGS2S2dT27rGeQv9//PAwCkYI=; b=RFXNjFlZzj52vEa7fc9mD41Ah1cpswIDiuMNHrpCgYGC1WrgWYRThgbSx7auadfVFh P068jkxxkhWkOe65SmxH2udo1aTokad9WXoyG++i17dJnvc5WB7htAKDZKeHPeiUtNxO Scyao8vmNlDeXhhV+gGGY/+y9SVtbuTYrMmMx0o0H5OFzeYfHVup6y4ptDNLepGf6Y/S VIhzxY/IhTpM7qRNpzH3msg4eQLkj5JyZiAKvhHkO8FwRprea5q2dEmsjGf8jJy6JeKH o9pdLX/o5nEkarCluM507lgvKObxJ0ZoMKoNPWq1DmyPNWikuS1frtxiivxfYXZ7PcYg udDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mKaHTJNU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw10-20020a1709066a0a00b008714c52cd14si22816056ejc.37.2023.01.22.06.17.02; Sun, 22 Jan 2023 06:17:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mKaHTJNU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230161AbjAVOO4 (ORCPT + 99 others); Sun, 22 Jan 2023 09:14:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbjAVOOq (ORCPT ); Sun, 22 Jan 2023 09:14:46 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0466D1A960; Sun, 22 Jan 2023 06:14:42 -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 84D9160C33; Sun, 22 Jan 2023 14:14:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE931C433EF; Sun, 22 Jan 2023 14:14:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674396881; bh=54/WoMZ8YydDCjSCHnhXruffaj7Qo/EOB9FpfM9dfE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mKaHTJNU+lxxXBEbp3aV2wH/EkaNYfJE0weeBS2a9lRuj9k8T63GLvWo6LHMY2Tft oTXgc7CPLEpt92WRC5w5S8c+73JSshZYcMdQHtoCVHHdcU5SWECLLW/mKJW8L+vanI VtuiHWbP5iG6BBFnT0QLXB4fS648rna4lgLV8xGEiYtro0jyDtIpoeb7W+rj/n6kr9 itpHQkz+yqnSQsocunshqIBDu51acPdu6+dxuCXrBHNXGnMQXHypkt1kKWgWkpkLB+ 2xh0HqQuPQcz/pC7LMwtCwm4+F+EfVFIosNv67uPBjVvRWRchbqkjRhaLGnoF2Xe7D Sdos3Z3ba/ktw== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH 7/7] kbuild: do not re-run setlocalversion for kernelrelease Date: Sun, 22 Jan 2023 23:14:27 +0900 Message-Id: <20230122141428.115372-7-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230122141428.115372-1-masahiroy@kernel.org> References: <20230122141428.115372-1-masahiroy@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755732556665594558?= X-GMAIL-MSGID: =?utf-8?q?1755732556665594558?= Revert: - 7b8ea53d7f18 ("makefile: not need to regenerate kernel.release file when make kernelrelease") - 01ab17887f4c ("Makefile: "make kernelrelease" should show the correct full kernel version") I think the original behavior was better - 'make kernelrelease' should print $(KERNELRELEASE) used in the last build, not the one that will be used in the next build. Therefore, it is an error if you run it in the pristine source tree. Signed-off-by: Masahiro Yamada --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index d0a95277f08a..de402d415d5f 100644 --- a/Makefile +++ b/Makefile @@ -281,13 +281,13 @@ clean-targets := %clean mrproper cleandocs no-dot-config-targets := $(clean-targets) \ cscope gtags TAGS tags help% %docs check% coccicheck \ $(version_h) headers headers_% archheaders archscripts \ - %asm-generic kernelversion %src-pkg dt_binding_check \ + %asm-generic kernelrelease kernelversion %src-pkg dt_binding_check \ outputmakefile rustavailable rustfmt rustfmtcheck # Installation targets should not require compiler. Unfortunately, vdso_install # is an exception where build artifacts may be updated. This must be fixed. no-compiler-targets := $(no-dot-config-targets) install dtbs_install \ - headers_install modules_install kernelrelease image_name -no-sync-config-targets := $(no-dot-config-targets) %install kernelrelease \ + headers_install modules_install image_name +no-sync-config-targets := $(no-dot-config-targets) %install \ image_name single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %.symtypes %/ @@ -1677,7 +1677,7 @@ help: @echo ' tags/TAGS - Generate tags file for editors' @echo ' cscope - Generate cscope index' @echo ' gtags - Generate GNU GLOBAL index' - @echo ' kernelrelease - Output the release version string (use with make -s)' + @echo ' kernelrelease - Output the release version string used in the last build (use with make -s)' @echo ' kernelversion - Output the version stored in Makefile (use with make -s)' @echo ' image_name - Output the image name (use with make -s)' @echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \ @@ -2111,7 +2111,7 @@ checkstack: $(PERL) $(srctree)/scripts/checkstack.pl $(CHECKSTACK_ARCH) kernelrelease: - @$(srctree)/scripts/setlocalversion $(srctree) + @echo $(or $(KERNELRELEASE),$(error kernelrelease not valid - run 'make prepare' to update it)) kernelversion: @echo $(KERNELVERSION)