Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2804391rdb; Tue, 26 Dec 2023 05:54:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfg9Ti4NfY+VJ9fsa4NImKQXFS4NnEmRfBDk4fWJU1fgnFkP2qNLTYAeEOo42Ci2YrvyEw X-Received: by 2002:a05:620a:11a5:b0:779:dbe5:cd84 with SMTP id c5-20020a05620a11a500b00779dbe5cd84mr9034412qkk.36.1703598853689; Tue, 26 Dec 2023 05:54:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703598853; cv=none; d=google.com; s=arc-20160816; b=TPzU0TlUkO/M9besWi0G4DFVHoOQLGVktLRf9znxXyQfv8BpRo+z+q1SWnnL6M+1eI Hq+5n+ZEZ56v8vBGbf4osQXcMYas4cJXKqtDJgY6vY6UHfAULQc+NR0SWLmuEPFuxQrf RHcHW6/KIg7PDnWiSMh992G9Iz5gT5CuWUYx0tt2GhSD2Ei5A6QaP1IlhLqRDScSofCj JgNr6+5TUHKVS6epIVZzua8dxDZ4NSiuDvXvtjl7F9jP+QdhW83dh4j/YVlkDlqcKtCs 306BNRAPBEsb6MTBsK8C/+HZHUcskuBV0WjoznI6HCWv7sA85iHNVjqoRMX2mWBrUdgi T+yQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11535-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id qp7-20020a05620a388700b007811e1a6ffcsi10817886qkn.195.2023.12.26.05.54.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 05:54:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11535-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11535-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5C3001C21EC1 for ; Tue, 26 Dec 2023 13:54:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B2A451007; 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="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 Content-Transfer-Encoding: 8bit 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/ -- 2.40.1