Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2803699rdd; Sat, 13 Jan 2024 02:44:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6+p59BoNiez8/ydaXBvj94vxBcRIA5Vv9Z9cjlbdsNYAEc4BbqA67g4WqaL3gHIWXmVlq X-Received: by 2002:a05:6808:11cb:b0:3bd:4a9d:5307 with SMTP id p11-20020a05680811cb00b003bd4a9d5307mr3122386oiv.17.1705142681358; Sat, 13 Jan 2024 02:44:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705142681; cv=none; d=google.com; s=arc-20160816; b=I92zRu5blaNMycN7bb0RqQbJl7Rn6urIdGakcEfG3PCTQAOxFqOjeBVIXeGrnjSHud dXfg/xDCCK3R4G+CnU6nn98Sdgd7DTgwTuURPPaFp1AUgcc1QuYc3U+buHhWtNJcr7C7 ilyR95emDNkiHyoSPmdCMhPIU145t0o66THY8fQgJnPN2IApwaTsv/7VVZaLfCPTBLLf JlYU/MWbA5rhXFtHHxXVxqKxixfwarvkWWw6cxeEjMPNT7r2TPaE49Q5t/5ZbU1zJqGB 15TLrDgPERZfQGnLD6ypHYNGqwXeHGmxlAjPygE2XtDDxIBj3Vmsns1g6K5ByroK224Z xxnQ== 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=kMnpIAG2gMEjiyCKWFTwK/EVyhASh3Uoo0oohbC6t08=; fh=TzTqDUMKP/KQaEfE3IrByn8I7Y7VmT/7HASSO3QvYuU=; b=UE/L0e88IBeRRm+ezQTCaWxMJ/RUyRfFGCEXAhMYV1xYBFWuUIXmfT4YltDKF6Gu1l 4Pne+8YAHODFVOFnAAhSP8lno1L/hvgISebVS8ORgFFuh7OmG3UylDaNN3ScOFBlZTjr RyjJCBv6uSea4ycg4+4zplmsu+fRlI3yA3s/sDxwPMLchfs3E/v1cMF9yFJJ+HN5ml3B Z+9YeRX3+sBprqEZgGbm2FnKRr2xcgYMBx225meMlUqpbi9G3C7+bzeiYc4kFxcRK1/F KVKz3olPvuzG+BTO8mTZGKc6Q1EcsGsJ5uYevxczLzq7t3FI7FAi4dho9fTvgh2d4bqK sIUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AfJU9lFp; spf=pass (google.com: domain of linux-kernel+bounces-25266-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25266-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y2-20020a62b502000000b006d9b23ad800si4785718pfe.261.2024.01.13.02.44.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 02:44:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25266-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AfJU9lFp; spf=pass (google.com: domain of linux-kernel+bounces-25266-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25266-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 03325284D37 for ; Sat, 13 Jan 2024 10:44:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63EA92111E; Sat, 13 Jan 2024 10:43:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AfJU9lFp" 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 97B5F21110; Sat, 13 Jan 2024 10:43:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B16F2C43394; Sat, 13 Jan 2024 10:43:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705142634; bh=qojQBt1Bg5uxXkkZTt84eMBF6leDUzIvdOIhZFTxWJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AfJU9lFpqCXpxLe3cUEJVHNlKj9bYF0BnzZ5d6mLCPGGPdtjo3QD6iFKiHXRO5fPa iWFEe87kpbr8Yzh0AM4imdcM0scW3wz1Bo0ziue5WTqkXDbSY7HhmDmlULbtBpFK1E /y1hSwvDHCctxdb266Fu0jmDviqyWpf1+7NInKslbmZPlTkcbw2AZThS94uNAoXPAm KtBfoqHmXVCMkDWwd6ffeee7kqRckzHjbjH4F6fb9nVvC15GEekbc6/9hZ3mYUPih5 86KGP2y38KPmrx58DhYPXJx2cDhxg3krCG/izE6loXYiw1HgAZdnG3K4oIpirCNFyV ZQyMJuSJIDJRA== 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 v2 4/4] kbuild: deb-pkg: call more misc debhelper commands Date: Sat, 13 Jan 2024 19:43:39 +0900 Message-Id: <20240113104339.16131-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240113104339.16131-1-masahiroy@kernel.org> References: <20240113104339.16131-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use dh_prep instead of removing old build directories manually. Use dh_clean instead of removing build directories and debian/files manually. Call dh_testdir and dh_testroot for preliminary checks. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier --- (no changes since v1) scripts/package/builddeb | 8 -------- scripts/package/debian/rules | 6 +++++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/scripts/package/builddeb b/scripts/package/builddeb index d31b16afe0db..e797ad360f7a 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -28,8 +28,6 @@ install_linux_image () { pname=$1 pdir=debian/$1 - rm -rf ${pdir} - # Only some architectures with OF support have this target if is_enabled CONFIG_OF_EARLY_FLATTREE && [ -d "${srctree}/arch/${SRCARCH}/boot/dts" ]; then ${MAKE} -f ${srctree}/Makefile INSTALL_DTBS_PATH="${pdir}/usr/lib/linux-image-${KERNELRELEASE}" dtbs_install @@ -97,8 +95,6 @@ install_linux_image () { install_linux_image_dbg () { pdir=debian/$1 - rm -rf ${pdir} - # Parse modules.order directly because 'make modules_install' may sign, # compress modules, and then run unneeded depmod. while read -r mod; do @@ -128,8 +124,6 @@ install_kernel_headers () { pdir=debian/$1 version=${1#linux-headers-} - rm -rf $pdir - "${srctree}/scripts/package/install-extmod-build" "${pdir}/usr/src/linux-headers-${version}" mkdir -p $pdir/lib/modules/$version/ @@ -139,8 +133,6 @@ install_kernel_headers () { install_libc_headers () { pdir=debian/$1 - rm -rf $pdir - $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH=$pdir/usr # move asm headers to /usr/include//asm to match the structure diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules index 57f1cf7c6b32..ca07243bd5cd 100755 --- a/scripts/package/debian/rules +++ b/scripts/package/debian/rules @@ -42,6 +42,9 @@ package = $($(@:binary-%=%-package)) DH_OPTIONS = -p$(package) define binary + $(Q)dh_testdir $(DH_OPTIONS) + $(Q)dh_testroot $(DH_OPTIONS) + $(Q)dh_prep $(DH_OPTIONS) $(Q)+$(MAKE) $(make-opts) run-command KBUILD_RUN_COMMAND='+$$(srctree)/scripts/package/builddeb $(package)' $(Q)dh_installdocs $(DH_OPTIONS) $(Q)dh_installchangelogs $(DH_OPTIONS) @@ -72,7 +75,8 @@ build-arch: .PHONY: clean clean: - $(Q)rm -rf debian/files debian/linux-* debian/deb-env.vars* debian/*.files + $(Q)dh_clean + $(Q)rm -rf debian/deb-env.vars* debian/*.files $(Q)$(MAKE) ARCH=$(ARCH) clean # If DEB_HOST_ARCH is empty, it is likely that debian/rules was executed -- 2.40.1