From patchwork Tue Dec 26 13:52:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 183317 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp874987dyb; Tue, 26 Dec 2023 05:53:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFsPNMvH8QuIMVVGaufeHMC/a+URk5hOZtoyjtsiLencjhitkJTbX+YDefP1hbaK31adF78 X-Received: by 2002:a05:6214:ac9:b0:67f:2632:9992 with SMTP id g9-20020a0562140ac900b0067f26329992mr13937006qvi.38.1703598797214; Tue, 26 Dec 2023 05:53:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703598797; cv=none; d=google.com; s=arc-20160816; b=GM9BP8hRPzplWxPIzPE0KURmscu18Ae0ggx+NoACk02OAlQ/eIPncjcBDEk9GiXuG7 lz3TnrPZfzx7gHpGnfmfFGZKnwoXsKM5VOygEoFaov70ynaGokMiyWW+jX5cFmlIRvrg kzkFKu5XC9sL81nktWtn2Uwc+DHhPuxS9YBIyiZ+5CoMWNWMnsrnOPIvG8ilAfwlS0pa +h2oG1BuYDhPwmqG8o81OeaFQJeAqbdgp7yKAen1rOfM87cAmvoMOa/jzwy2IIbDO/Pj y6r1QlowfrWOUlXUUAU9Tj7eKSq/nIEf3T3FR+Re3DtrU1qsk6Ho4Ou/xxK+sDUBXTVq +SFQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=sSOFChyrfs3ifnOH6Ap6ou9xOph+iCxvvV47VYIg/VY=; fh=5gYN4msaJmwnN8mGpibv8VZnTy0MtvGQcf5D09XpoaQ=; b=O3Z6b8X+6/KYPZIW06f43efKdTWxs3HNhcPYhC2oJW+hTjRcQbNamJUXRfDwApqxtw whq1l5i9ftEg8aVJ1gI91LS87W3YmmqA4PTnUmlXQZHpJZPD/EjR8VLDCodLmeXpw5kK yXlu2zdXInzS4Ef12iNgW5hGd5/ej22VuZFxbvFvBlLe/579OHFlZ1OYZRlc3XXe+Kc5 MQswWUXWiyuPsrf+WuGeqkdGebFgItYNbVhf9nwdwG86FWo69oZxCy7Hqc/SQSTpbc8K IarSLor5FBsxrSsE1vtucqcKtN9licCP0sFasS8hBFIG+bcBv7Rgd06EXZaBaNY9PUpi Rnkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nyKhjWua; spf=pass (google.com: domain of linux-kernel+bounces-11530-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11530-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h18-20020a0cf412000000b0067a93cf954bsi12902227qvl.266.2023.12.26.05.53.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 05:53:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11530-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nyKhjWua; spf=pass (google.com: domain of linux-kernel+bounces-11530-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11530-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 07E671C20F77 for ; Tue, 26 Dec 2023 13:53:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D0494F209; Tue, 26 Dec 2023 13:53:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nyKhjWua" 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 C1B004EB42; Tue, 26 Dec 2023 13:52:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 005C9C433C7; Tue, 26 Dec 2023 13:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703598777; bh=AQY7dmprZJmESi+61/lhMwT1uO26gspqlrGm0b7sd2s=; h=From:To:Cc:Subject:Date:From; b=nyKhjWua2/XlcnQVnS4Osre4jpkurB2edDocb5nMDx/FaT1Fly7efvMGfHw1+FdHo n9630IsYXcWl6KXaUngiBDlgOOlKRRjFILzeYM6+QSVSSvkp9b0S/8LdWpD0OJ34ss 9RlApq4B+HNswz1S4fx31VY9L6ZB8vkftf8LbanXwjYi0uvX5UHQ3o/v10ua/BaWqC NejKrVi/5Dz9tf8S2w9lqcIMhtGgfgErYUkCz5LOS03M2haCm28BJTl63ipDO6y91G W4MNo+9flDX7OL4N+soUKWzqIFCML2P3JtT5wwV6mkPC91RVdjYTX+MzmqKq2HiZ09 Kva6jwhM37W3A== 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 1/6] kbuild: deb-pkg: factor out common Make options in debian/rules Date: Tue, 26 Dec 2023 22:52:38 +0900 Message-Id: <20231226135243.1393780-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 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: 1786352812160561994 X-GMAIL-MSGID: 1786352812160561994 This avoid code duplication between binary-arch and built-arch. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier --- scripts/package/debian/rules | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules index 3dafa9496c63..26bc6239e200 100755 --- a/scripts/package/debian/rules +++ b/scripts/package/debian/rules @@ -10,20 +10,20 @@ ifneq (,$(filter-out parallel=1,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))) MAKEFLAGS += -j$(NUMJOBS) endif +make-opts = ARCH=$(ARCH) KERNELRELEASE=$(KERNELRELEASE) + .PHONY: binary binary-indep binary-arch binary: binary-arch binary-indep binary-indep: build-indep binary-arch: build-arch - $(MAKE) -f $(srctree)/Makefile ARCH=$(ARCH) \ - KERNELRELEASE=$(KERNELRELEASE) \ + $(MAKE) -f $(srctree)/Makefile $(make-opts) \ run-command KBUILD_RUN_COMMAND=+$(srctree)/scripts/package/builddeb .PHONY: build build-indep build-arch build: build-arch build-indep build-indep: build-arch: - $(MAKE) -f $(srctree)/Makefile ARCH=$(ARCH) \ - KERNELRELEASE=$(KERNELRELEASE) \ + $(MAKE) -f $(srctree)/Makefile $(make-opts) \ $(shell $(srctree)/scripts/package/deb-build-option) \ olddefconfig all 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 From patchwork Tue Dec 26 13:52:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 183319 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp875183dyb; Tue, 26 Dec 2023 05:53:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgG7LoDKyiDA2oVrot+ynx4EMKIS94JUBKzuDeVugri4UEFUxJdSspbhubNFbdnbGb9nf7 X-Received: by 2002:a17:906:1097:b0:a23:67d2:c546 with SMTP id u23-20020a170906109700b00a2367d2c546mr3140643eju.80.1703598827550; Tue, 26 Dec 2023 05:53:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703598827; cv=none; d=google.com; s=arc-20160816; b=gQDZsOB8WkjYLcfHqxqwwCiCVbPWzOF6zw41wLMpqILxZ83mBeNOz2K9beXlaYXmXj T2acz5n+QrrUViKPz04hI+MOC8frGPpkTZTqnqMKJEE0hS6nTDg0/IRmHA68Xw5ui6h4 DS83tE1MFV7wBVYtMh0wXVLBcGGcNFSRIj8+s4cHbzlpQCKnzl+q2UhOJGWOWafeL2K5 UrKXXeuh1HDhS08H25wQ0Wd65kla0wJBtonZTkt/2bD9qSIujEhEWhVmKZCsfxjPx84T dr2Yc/eSCl09vC25f0XNedKflkyVcBQsqW7pOW+hiSwMQ9tW4fNtZfJaZ2dREjeExQej 10AQ== 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=6tb74LZlyhHN1r5szZooZyC5f32WLVMW4lbS9l/Qru4=; fh=5gYN4msaJmwnN8mGpibv8VZnTy0MtvGQcf5D09XpoaQ=; b=IlZYtqP/+EdRKLIfqBmidwBNK9KF7m84Pg2SrmLjUHpfeFIlBRhPwahYAaQTkMiXxK 6ulJQFddxM9EBzvaRkJ1nMTuNvQFMb6alHVoWv8VFexNT6ImZ1aENZaTfRww/wwgy5fL rzh1hkPT0bUX8kQaMgeqWvqZ4NNMCOMi26clyExkyTLIYzUoNVmNhXxBXQYU8TsYcgYM 1bWITn7mqPIVLGt1Sximi3ieHbwJ7w5C60HhOLNAO4dqY4kZXDHOyKwumlJfBdtGojzQ /ghKzkzUZf6hiYkrzFf3hiog/+knD8a5mq9z43PZaaBCffDQAx9DDN46Efvn1mWIjFSL NOeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="I9whyM/H"; spf=pass (google.com: domain of linux-kernel+bounces-11532-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11532-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 gh29-20020a1709073c1d00b00a26dc87b7f2si2761458ejc.820.2023.12.26.05.53.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 05:53:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11532-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="I9whyM/H"; spf=pass (google.com: domain of linux-kernel+bounces-11532-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11532-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 2E9511F22931 for ; Tue, 26 Dec 2023 13:53:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 80C6D4F891; Tue, 26 Dec 2023 13:53:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="I9whyM/H" 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 E21984F216; Tue, 26 Dec 2023 13:53:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 356D2C43391; Tue, 26 Dec 2023 13:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703598780; bh=GHEJTufmGu+U5ws6uli9pWrljzPPuOpjnKKiIXQ9OP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I9whyM/HAPsMMSg1XN9ZxtCtIVJSCpjEhZks2t2pdHelgP0JVYZL44424b/PqLRlk 1mj56KFfHC5zKF6uCqgl5oG8JFqieAfs7TxhMVTsNgsfL8IdJ1TmpYHHTX7l0ljywv eT70jgQ6XmRk1MXCYd8YsfAKa/acYi9t3NHmY6AMsaenIEfUKrq0E6R70FO7TJIEk1 yR5Mkd3EDLZMot6wH3HRIRQMrAK8yAXTY+mOc+qm7AFEcQDLUQ+D3m/hiwa0fjooZE cjRcNfOtbpZkeX6UDNWUvrEfZmTqIg184pv/S1MV9u5sDx0DLvbSQMjtpeNbq8nKGf aWzljeUwtPAFQ== 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 3/6] kbuild: deb-pkg: set DEB_* variables if debian/rules is directly executed Date: Tue, 26 Dec 2023 22:52:40 +0900 Message-Id: <20231226135243.1393780-3-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: 1786352844633735726 X-GMAIL-MSGID: 1786352844633735726 Since commit 491b146d4c13 ("kbuild: builddeb: Eliminate debian/arch use"), direct execution of debian/rules results in the following error: dpkg-architecture: error: unknown option 'DEB_HOST_MULTIARCH' The current code: dpkg-architecture -a$DEB_HOST_ARCH -qDEB_HOST_MULTIARCH ... does not look sensible because: - For this code to work correctly, DEB_HOST_ARCH must be pre-defined, which is true when the packages are built via dpkg-buildpackage. In this case, DEB_HOST_MULTIARCH is also likely defined, hence there is no need to query DEB_HOST_MULTIARCH in the first place. - If DEB_HOST_MULTIARCH is undefined, DEB_HOST_ARCH is likely undefined too. So, you cannot query DEB_HOST_MULTIARCH in this way. This is mostly the case where debian/rules is directly executed. When debian/rules is directly executed, querying DEB_HOST_MUCHARCH is not enough because we need to know DEB_{BUILD,HOST}_GNU_TYPE as well. All DEB_* variables are defined when the package build is initiated by dpkg-buildpackage, but otherwise, let's call dpkg-architecture to set all DEB_* environment variables. This implementation relies on dpkg commit 7c54fa2b232e ("dpkg-architecture: Add a --print-format option"). Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier --- scripts/package/builddeb | 5 ++--- scripts/package/debian/rules | 12 +++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 2fe51e6919da..2eb4910f0ef3 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -171,9 +171,8 @@ install_libc_headers () { # move asm headers to /usr/include//asm to match the structure # used by Debian-based distros (to support multi-arch) - host_arch=$(dpkg-architecture -a$DEB_HOST_ARCH -qDEB_HOST_MULTIARCH) - mkdir $pdir/usr/include/$host_arch - mv $pdir/usr/include/asm $pdir/usr/include/$host_arch/ + mkdir "$pdir/usr/include/${DEB_HOST_MULTIARCH}" + mv "$pdir/usr/include/asm" "$pdir/usr/include/${DEB_HOST_MULTIARCH}" } rm -f debian/files diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules index 529b71b55efa..8f24a8e84bf2 100755 --- a/scripts/package/debian/rules +++ b/scripts/package/debian/rules @@ -30,5 +30,15 @@ build-arch: .PHONY: clean clean: - rm -rf debian/files debian/linux-* + rm -rf debian/files debian/linux-* debian/deb-env.vars $(MAKE) -f $(srctree)/Makefile ARCH=$(ARCH) clean + +# If DEB_HOST_ARCH is empty, it is likely that debian/rules was executed +# directly. Run 'dpkg-architecture --print-set --print-format=make' to +# generate a makefile construct that exports all DEB_* variables. +ifndef DEB_HOST_ARCH +-include debian/deb-env.vars + +debian/deb-env.vars: + dpkg-architecture -a$$(cat debian/arch) --print-set --print-format=make > $@ +endif From patchwork Tue Dec 26 13:52:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 183320 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp875290dyb; Tue, 26 Dec 2023 05:54:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFvRG3WAf5KZ3NvNCcJSJzeM8SD2x/D4SxTJPpnqSCelw+COgMiT/ImfAmuNSh1nlA9K2MM X-Received: by 2002:a05:620a:6192:b0:781:5303:ccf with SMTP id or18-20020a05620a619200b0078153030ccfmr2062116qkn.58.1703598839900; Tue, 26 Dec 2023 05:53:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703598839; cv=none; d=google.com; s=arc-20160816; b=I/WIdI3l2+3mAzwEBHbf/qY1brS3/2MbouAYGYk2lEQA69iocKn5REib1IpypRzYUk F8pSFcHA/MLldNR2v52s9Sb6RtWff7/ha1pJ2NPSNBo2grviSYijwSZ66iA0dGSmd5BX HC4M3uzLrmR0D4dyHnfJ2AMixupWpCpWCEnOFrBWF3myB9/dLVe5ysmuyARe7szAINDA nBtdq6XSfZQNMs/kseRWzhmY7IlWhC9qSY/jbzokzDRkCSqwIz83yJE/x5vLKXq1ZHlh OUE5DhWNAA1Tiu5rS//p4s9sPUzzCJxFVxZZxor0cgbLKRCaYZRfvVkciMOBPouh6pW6 feuQ== 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=RGRbhUMY7X4kLKD072lBgHhmrNwztFpEutzTPdsV/l8=; fh=5gYN4msaJmwnN8mGpibv8VZnTy0MtvGQcf5D09XpoaQ=; b=elC8wV3mxQue+bmmim/IAxY7/p6nbF/zKoAY4PdsiTDz+PgQobQAmj0HGxBYI6H+yY onn+Bm6AVa5q8oINrbQJSOzPS4NLhWt7bba3EBhtEpJJax/exRoTWlEV4yUV3tks2g2X duxFGIr7QdPlX7Yucw9BRskDF1bNws8/wwRDTgTZcUQerzP71QOWHDnNl7n+ytnc7MWa KPQYzplyV1ibKLHlr0q078869tg8CnJoVGYMqgG/Tifbdd49dcDv2NVHHF3RJhpu6oQk KA6hR+MYzt+pEmmK8/v8n8gyHHJLBI5mrcuqdkeU7BHnAXU29ylZ8VvKPsLb7c22OSlJ jRPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FF9W5eoD; spf=pass (google.com: domain of linux-kernel+bounces-11533-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11533-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s8-20020a05620a0bc800b00774067d659csi13033968qki.92.2023.12.26.05.53.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 05:53:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11533-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FF9W5eoD; spf=pass (google.com: domain of linux-kernel+bounces-11533-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11533-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B11B41C20F21 for ; Tue, 26 Dec 2023 13:53:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04CA24F8BB; Tue, 26 Dec 2023 13:53:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FF9W5eoD" 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 6B3D94F611; Tue, 26 Dec 2023 13:53:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C482AC433CA; Tue, 26 Dec 2023 13:53:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703598782; bh=Yf/hVKai4B6D9hPEEtKdrrl+YI82sgCF8wTLgHt9pu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FF9W5eoD+RTmcaGMUHt0CAUOkEsYUbbmUx8w7n/lVKh6ddtIVeEZt0obusP1CTZek sJ3Q+wFhHbA/vVxU5DpdNwn7kS3CN0BD94l2va+qgGhvkCoKTOAcLXvehz+zjmQWEF fHdS1zN+1RPHY9osh/y3yOb+xVH7lZnRJIRbUt3hsnRf6iDVtXmA6Jp8kwb1SaXERm HRZfJWhyZ4tm8uzLlXLsKYC6TQME0c562eviHKIAqmkfaLVlMtCiH1RzB1b6XWysgh dT5ukV8lBxq5mS6khHHxYIyKbXhDmcGL4OSu7LDIJCIvSEYMOp/iG/q9p5Q7Vhsk80 eJ8lgoieLWw+Q== 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 4/6] kbuild: deb-pkg: allow to run debian/rules from output directory Date: Tue, 26 Dec 2023 22:52:41 +0900 Message-Id: <20231226135243.1393780-4-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: 1786352857248902678 X-GMAIL-MSGID: 1786352857248902678 'make O=... deb-pkg' creates the debian directory in the output directory. However, currently it is impossible to run debian/rules created in the separate output directory. This commit delays the $(srctree) expansion by escaping '$' and by quating the entire command, making it possible to run debian/rules in the output directory. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier --- scripts/package/debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules index 8f24a8e84bf2..6b2333e3cf96 100755 --- a/scripts/package/debian/rules +++ b/scripts/package/debian/rules @@ -19,7 +19,7 @@ binary: binary-arch binary-indep binary-indep: build-indep binary-arch: build-arch $(MAKE) -f $(srctree)/Makefile $(make-opts) \ - run-command KBUILD_RUN_COMMAND=+$(srctree)/scripts/package/builddeb + run-command KBUILD_RUN_COMMAND='+$${srctree}/scripts/package/builddeb' .PHONY: build build-indep build-arch build: build-arch build-indep From patchwork Tue Dec 26 13:52:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 183321 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp875434dyb; Tue, 26 Dec 2023 05:54:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGHzRi2+vBczLNDwPofrnpXgel4V57P37ON0mVNfY5nSjdmC62r1lFhrm9WrxTG1Q3GNzKW X-Received: by 2002:ac2:4854:0:b0:50e:7551:f06f with SMTP id 20-20020ac24854000000b0050e7551f06fmr1108037lfy.77.1703598855072; Tue, 26 Dec 2023 05:54:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703598855; cv=none; d=google.com; s=arc-20160816; b=arSFcYbaIyx1v+W+RKoil28cWPpwVB4oZSt7SQG62EHt3i3Izd16Uou0Jp082gAMld IDvq9sDHhzM0seT3Kaxc/intzDZcLFDpm9Ew6uHML8ElF795z8thKTn7rf50Kry46ana 8A2yPfSC3zhX1BN82YoHD0NgxZ5pgUvvJyZbQiSCfRCYYTT83OdnrmWA6BWQlfEJX9Rz k5G0+lHOvExCQFAlk4qBmNpFZoDjZo+ptMlYw6O95BOBX/WTANmaikmA44eciCQCdv4N ehj4xgB/7+NNHXNQYhrfS5ZPvRrBZzuDiMnSEDTbhxlOXDs83u//fRTGztgqvcml/5c2 3f6w== 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=C21jKShFVWYhGFY7tVS+lUCWy3QtACdk+8CLQ2u/fqw=; fh=5gYN4msaJmwnN8mGpibv8VZnTy0MtvGQcf5D09XpoaQ=; b=S6KmBupcg9Adp4M33i/Iip+ta6YUCqa6yItLB83gyoR7k5ojw1OKP4iLKNOA6v50WC 3YRplCvJii3YpZpCLkIlN9MwKILpqLM8IZglTQGas5YNwGpXWTwErojs5vNv0gfnATBD 4mLodlhiUDh6NIndYlCOHvapFv2LV38JVy0pEFHl20YP+8XmXpobJedYWzS7483/KnCz DOSRhH2l6hS5X8k9TWHOUcCA4AesOFq7uUpGgViInMv1lt6b+WvKRiOgPdBcw8jjbOJq LIO6Lulh6AYgW3oVDsdEt8NSG32YXxrPomX5h5pon+hg4xX8En4mj7r0BjZT2FreOtDC nK9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g6Ryscme; spf=pass (google.com: domain of linux-kernel+bounces-11534-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11534-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 r21-20020a50d695000000b005541005946fsi5448092edi.72.2023.12.26.05.54.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 05:54:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11534-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=g6Ryscme; spf=pass (google.com: domain of linux-kernel+bounces-11534-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11534-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 ACB591F22306 for ; Tue, 26 Dec 2023 13:54:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD7854FF63; Tue, 26 Dec 2023 13:53:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g6Ryscme" 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 270FC4F8A6; Tue, 26 Dec 2023 13:53:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60B44C433CB; Tue, 26 Dec 2023 13:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703598783; bh=fSRgbph1yPaaUtk0eAjQa+ArlTVll7f5fkppZKDNpBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g6RyscmeMEpXnOlMRmKtwyX7WOTR+p/iLVqxnGz2NW9MO6CnLueLYmiwj7XefRDiT v1c+KjwFOBGsMkFAxXJIlyj6Y0bY5A6bg/IsXu5q6EpCqfuFo7UYHgVx/naEMxGBlt oruY50rGDqPaglzXdzH1Aa0Uye7SirKLoqBWow9FvWHZMwujHjgpAV81Jflkul3pW/ rFdRIcVWX3pVi2eDCV1NhzH+dSc1/GjDEJvHcQP5S0I5WufY3fi9IeYdeX8jHivXIQ 6T3qHH7axfU3psgo8U09LX4QYvbNXqBrqjXlw2cNEKPB7vqjlJSaNSY0y59mp81Dho KYO5nVEyuJ1KA== 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 5/6] kbuild: deb-pkg: remove unneeded '-f $srctree/Makefile' in debian/rules Date: Tue, 26 Dec 2023 22:52:42 +0900 Message-Id: <20231226135243.1393780-5-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: 1786352872734199631 X-GMAIL-MSGID: 1786352872734199631 This is unneeded because the Makefile in the output directory wraps the top-level Makefile in the srctree. Just run $(MAKE) irrespective of the build location. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier --- scripts/package/debian/rules | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules index 6b2333e3cf96..36d51f60f98d 100755 --- a/scripts/package/debian/rules +++ b/scripts/package/debian/rules @@ -3,8 +3,6 @@ include debian/rules.vars -srctree ?= . - ifneq (,$(filter-out parallel=1,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))) NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) MAKEFLAGS += -j$(NUMJOBS) @@ -18,20 +16,20 @@ make-opts = ARCH=$(ARCH) KERNELRELEASE=$(KERNELRELEASE) KBUILD_BUILD_VERSION=$(r binary: binary-arch binary-indep binary-indep: build-indep binary-arch: build-arch - $(MAKE) -f $(srctree)/Makefile $(make-opts) \ + $(MAKE) $(make-opts) \ run-command KBUILD_RUN_COMMAND='+$${srctree}/scripts/package/builddeb' .PHONY: build build-indep build-arch build: build-arch build-indep build-indep: build-arch: - $(MAKE) -f $(srctree)/Makefile $(make-opts) \ + $(MAKE) $(make-opts) \ olddefconfig all .PHONY: clean clean: rm -rf debian/files debian/linux-* debian/deb-env.vars - $(MAKE) -f $(srctree)/Makefile ARCH=$(ARCH) clean + $(MAKE) ARCH=$(ARCH) clean # If DEB_HOST_ARCH is empty, it is likely that debian/rules was executed # directly. Run 'dpkg-architecture --print-set --print-format=make' to From patchwork Tue Dec 26 13:52:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 183322 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp875806dyb; Tue, 26 Dec 2023 05:54:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IEo+fvAu/UGuAUc8O6gWpO9ur3hYMTSKUfGQv6ERDMPF4bSZLnP/i/xvZZYdTtsgICpU91+ X-Received: by 2002:a17:90a:1049:b0:28c:4a67:eb7d with SMTP id y9-20020a17090a104900b0028c4a67eb7dmr722715pjd.48.1703598898781; Tue, 26 Dec 2023 05:54:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703598898; cv=none; d=google.com; s=arc-20160816; b=P+IZJv+3kw42dkKq5CGyKaBYaF4kjuzITd5Q+zgzT5MKqD0iNgAgyRNg1z3IkbZzuy iJ+O2j3JcY79fAsxeqYW0lxdn6AOGGQXHf6I4eJxM2aiAO+yPCuc2VwoT5Yjj5uLMyx6 EB8BCKBKxnCrzqQ6XcWu7jEAiIfbLt719Juo812l9oWWsW8fkFD7wopN4A+zYbr9JYRZ mFaMxFPAd9Xi1I4VU9xoJIejm7e7srXZSPf9m32bveqPGeVUOLkpDwlWy4mc8kiqXncU TV3CMkYdLqI5f3Ez7pq+S/aCtPXKK1wIpI6PBt8pLBpE0XDp3KZMnBFQv9ASiVZJ3/TA GT1A== 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=Uc2nlFEN7iC5YMD++JhglMm359DSaeMsfoebEoUSeqY=; fh=TzTqDUMKP/KQaEfE3IrByn8I7Y7VmT/7HASSO3QvYuU=; b=K1WXK6n5U5ya6qmhIQ4B1pW8yKc4Vmt6sDpJ2NksT1QGJn7qJ5pGAXxMMnRmtapU8/ l1aXom8kJM7yzbE4FfCi8O94Qo6EgVCW5F3SClcU/znnaB+tSHnlKE8kpd4csDminxAG ksvPeOfWGL1EhXYjKn2lGjqencSINwmlvViWQf5SfR4O2f4PJyiXNUX4XcQ5bXLd8+Fz /XbvW/N/LaUgcLHEJ5U9hBdMT0ejshnAJ752csDDLcTMKCGbBeAMGyYO2TPbbakoHlqM ABa3ojKZ7LgSkQnioCPb2NY28I6Jjdee4OFbQGFQjqzir6LIaqTRqyarhf17OJtcsH18 QMaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sgBVAgpa; spf=pass (google.com: domain of linux-kernel+bounces-11535-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11535-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a1-20020a170902ecc100b001d43ea963c7si5187118plh.371.2023.12.26.05.54.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 05:54:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11535-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sgBVAgpa; spf=pass (google.com: domain of linux-kernel+bounces-11535-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11535-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 45B17B209E8 for ; Tue, 26 Dec 2023 13:54:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62F5851C5F; Tue, 26 Dec 2023 13:53:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sgBVAgpa" 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 D130B4EB5E; Tue, 26 Dec 2023 13:53:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F16D5C433CA; Tue, 26 Dec 2023 13:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703598785; bh=Xd3RiHeuNxlRf7T5i6AVEz2ZQo7xF4C6gARQq5XvO3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sgBVAgpa6Mx1oNF36hARX877uYe/EOtNlyhZoVHLngzwJVt6yp2RDtyng8vyZUCsW PTqrIWxpbVVeQgO4Oz/SnlroG04pZdSQ3BPOqNpBDJ5kTb71GMuT9cQXd+5P7+0+ap zHoAlPNpgIpv9PHUpizffQ09MQqNUbC9o7TlsgwB66ke/FmncOgMNxTUix4NF6Tjpe SnBDzugE8xAVvBWS84voRh6oAh0RW4B6PdgzJbapSVNkpikfsB8Oy+OhUVwgpsEkpJ 7xRFDYEJE3B43+8Ps/VnYzYUcbcM6q/WZN4WWzPzMYI6al4Y+f2Yk4EtKkvx1ZeD/e jbYrym1T/OTcw== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ben Hutchings , Masahiro Yamada , Nicolas Schier , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , linux-kernel@vger.kernel.org Subject: [PATCH 6/6] kbuild: deb-pkg: use more debhelper commands in builddeb Date: Tue, 26 Dec 2023 22:52:43 +0900 Message-Id: <20231226135243.1393780-6-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: 1786352919117854133 X-GMAIL-MSGID: 1786352919117854133 Commit 36862e14e316 ("kbuild: deb-pkg: use dh_listpackages to know enabled packages") started to require the debhelper tool suite. Use more dh_* commands in create_package(): - dh_installdocs to install copyright - dh_installchangelogs to install changelog - dh_compress to compress changelog - dh_fixperms to replace the raw chmod command - dh_gencontrol to replace the raw dpkg-gencontrol command - dh_md5sums to record the md5sum of included files - dh_builddeb to replace the raw dpkg-deb command Set DEB_RULES_REQUIRES_ROOT to 'no' in case debian/rules is executed directly. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier --- scripts/package/builddeb | 23 ++++++++--------------- scripts/package/debian/rules | 2 ++ scripts/package/mkdebian | 2 +- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 2eb4910f0ef3..436d55a83ab0 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -26,23 +26,16 @@ if_enabled_echo() { create_package() { local pname="$1" pdir="$2" - local dpkg_deb_opts - mkdir -m 755 -p "$pdir/DEBIAN" - mkdir -p "$pdir/usr/share/doc/$pname" - cp debian/copyright "$pdir/usr/share/doc/$pname/" - cp debian/changelog "$pdir/usr/share/doc/$pname/changelog.Debian" - gzip -n -9 "$pdir/usr/share/doc/$pname/changelog.Debian" - sh -c "cd '$pdir'; find . -type f ! -path './DEBIAN/*' -printf '%P\0' \ - | xargs -r0 md5sum > DEBIAN/md5sums" + export DH_OPTIONS="-p${pname} -P${pdir}" - # a+rX in case we are in a restrictive umask environment like 0077 - # ug-s in case we build in a setuid/setgid directory - chmod -R go-w,a+rX,ug-s "$pdir" - - # Create the package - dpkg-gencontrol -p$pname -P"$pdir" - dpkg-deb --root-owner-group ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS} --build "$pdir" .. + dh_installdocs + dh_installchangelogs + dh_compress + dh_fixperms + dh_gencontrol + dh_md5sums + dh_builddeb -- ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS} } install_linux_image () { diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules index 36d51f60f98d..1f56938ea5d4 100755 --- a/scripts/package/debian/rules +++ b/scripts/package/debian/rules @@ -1,6 +1,8 @@ #!/usr/bin/make -f # SPDX-License-Identifier: GPL-2.0-only +export DEB_RULES_REQUIRES_ROOT := no + include debian/rules.vars ifneq (,$(filter-out parallel=1,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))) diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian index 93a24712b9a1..070149c985fe 100755 --- a/scripts/package/mkdebian +++ b/scripts/package/mkdebian @@ -193,7 +193,7 @@ Section: kernel Priority: optional Maintainer: $maintainer Rules-Requires-Root: no -Build-Depends: debhelper +Build-Depends: debhelper-compat (= 12) Build-Depends-Arch: bc, bison, cpio, flex, kmod, libelf-dev:native, libssl-dev:native, rsync Homepage: https://www.kernel.org/