From patchwork Tue Dec 26 13:52:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 183318 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp875078dyb; Tue, 26 Dec 2023 05:53:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjwtzWPmdM/BMoCRkCSzDRWEQ32PyAAH+tG1wpp7k3y7BLnRHyR1ceMbvS0mvblpD0j7Wk X-Received: by 2002:a50:aada:0:b0:554:1193:35ad with SMTP id r26-20020a50aada000000b00554119335admr4519458edc.49.1703598813191; Tue, 26 Dec 2023 05:53:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703598813; cv=none; d=google.com; s=arc-20160816; b=GnNK86mbZutX0iN2IJxaho2ZGSbr+1hxqLQSM0TP4LeYAN1oo8ghYERvv1HHjbM/68 WXqFwmCotnFsFUuKnSrY7J5/LUf2ujdGylkWH0sQ7dqVDrAb9iZ8KNWqxmBV0tmDkh5G p6GGuDPh6QC+Hv2C1QjzPNy0a00a2oMaD2ymrjWU7H37p8GLNyb3lGeFpEzbAMY3e/4o PDMj/Vr+m2flGWwEdeH2f0uoNfkUbZLMePbLWo5nHMp+8ImVp/gGJLTasYyAF8lb5v5z rK3j8hT7rCTg9FjmTrsIOmBjsZjTg2KvLf/ajnsFIOjBL7fGK1bieNjceFdMdrDp3mIX yXHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=D/wWGEI/ZfcPGlpL7Lmcs25vFlxg1k4u89cdIInj5KA=; fh=5gYN4msaJmwnN8mGpibv8VZnTy0MtvGQcf5D09XpoaQ=; b=KTcPHszgpG7kPCzhR3SNMW74GqgpXPCBU7kW0kqDVr4oJodME+4HTo/rMXiv0+BmXO Gefrb9yOwlA27X052lWLlabvwTGpsHpUJNepHYwjR8AX/Th8pRBCdaxYV35kCxjjjRkq 8N0NM4byLPDwC2Hj82I6b1KJvbjAKmE+dZu6Y+ZKhXhlxJ1/KNb39cZar3B6hJ9M1Wj/ CdZs3/tKs7g4QKzFdQTnba6vO3mNW3TlSdDyAVSBTHyOJ9bMXq8zMfGv2gusODeeIoFC LwO4LF2qyculjDate7vknYnkzRqW7XZbSJWs5f1HLjT+72yOXuGHeSlE7TuxKe0KTBLy OvGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="muzM/KiE"; spf=pass (google.com: domain of linux-kernel+bounces-11531-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11531-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a1-20020a509e81000000b00553b51b5292si5499906edf.245.2023.12.26.05.53.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 05:53:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11531-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="muzM/KiE"; spf=pass (google.com: domain of linux-kernel+bounces-11531-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11531-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C726C1F21A8B for ; Tue, 26 Dec 2023 13:53:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 091014F5FD; Tue, 26 Dec 2023 13:53:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="muzM/KiE" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E2924F1EC; Tue, 26 Dec 2023 13:52:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 969DAC433CB; Tue, 26 Dec 2023 13:52:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703598778; bh=qV21Ddxy565YeVMxc5SZLejjsKbZ8CTNjuyHTzJU14s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=muzM/KiEaiuwfCK9I8JLbD7PghAhWtcrnCeYuBNt+0ShtQnRV8n5Df7aT0Lpc2hAN N1+3Pv87ppFluNbnEVskEMzSuuHelElRCW48pSbylCY5SauirAP+oGtWEPWFUp4CvG kciQIGtBN+PIkvNl3GzjeTgcbuO4Fwvn/rZJP4pw5zS7O4NLntNqh1hmsgFn/Ly6qw aWubuNusZ4E+iJIzkb6FlTB3N61MIcGBJOyovSmPxXF6LxcoJy4F6WLh473JNwNQd1 /byx4TG9CwIhmHcULXe63+cDKNuqMXEc/TnW8ulT3LWneaKcWGb26YZhXH0IbK/dk+ qJMGtqb5cUDKA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ben Hutchings , Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , linux-kernel@vger.kernel.org Subject: [PATCH 2/6] kbuild: deb-pkg: squash scripts/package/deb-build-option to debian/rules Date: Tue, 26 Dec 2023 22:52:39 +0900 Message-Id: <20231226135243.1393780-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231226135243.1393780-1-masahiroy@kernel.org> References: <20231226135243.1393780-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786352828701900723 X-GMAIL-MSGID: 1786352828701900723 The binary-arch target needs to use the same CROSS_COMPILE as used in build-arch; otherwise, 'make run-command' may attempt to resync the .config file. Squash scripts/package/deb-build-option into debian/rules, as it is a small amount of code. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier --- scripts/package/deb-build-option | 14 -------------- scripts/package/debian/rules | 5 +++-- 2 files changed, 3 insertions(+), 16 deletions(-) delete mode 100755 scripts/package/deb-build-option diff --git a/scripts/package/deb-build-option b/scripts/package/deb-build-option deleted file mode 100755 index 7950eff01781..000000000000 --- a/scripts/package/deb-build-option +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-only - -# Set up CROSS_COMPILE if not defined yet -if [ "${CROSS_COMPILE+set}" != "set" -a "${DEB_HOST_ARCH}" != "${DEB_BUILD_ARCH}" ]; then - echo CROSS_COMPILE=${DEB_HOST_GNU_TYPE}- -fi - -version=$(dpkg-parsechangelog -S Version) -debian_revision="${version##*-}" - -if [ "${version}" != "${debian_revision}" ]; then - echo KBUILD_BUILD_VERSION=${debian_revision} -fi diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules index 26bc6239e200..529b71b55efa 100755 --- a/scripts/package/debian/rules +++ b/scripts/package/debian/rules @@ -10,7 +10,9 @@ ifneq (,$(filter-out parallel=1,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))) MAKEFLAGS += -j$(NUMJOBS) endif -make-opts = ARCH=$(ARCH) KERNELRELEASE=$(KERNELRELEASE) +revision = $(lastword $(subst -, ,$(shell dpkg-parsechangelog -S Version))) +CROSS_COMPILE ?= $(filter-out $(DEB_BUILD_GNU_TYPE)-, $(DEB_HOST_GNU_TYPE)-) +make-opts = ARCH=$(ARCH) KERNELRELEASE=$(KERNELRELEASE) KBUILD_BUILD_VERSION=$(revision) $(addprefix CROSS_COMPILE=,$(CROSS_COMPILE)) .PHONY: binary binary-indep binary-arch binary: binary-arch binary-indep @@ -24,7 +26,6 @@ build: build-arch build-indep build-indep: build-arch: $(MAKE) -f $(srctree)/Makefile $(make-opts) \ - $(shell $(srctree)/scripts/package/deb-build-option) \ olddefconfig all .PHONY: clean