From patchwork Fri Jun 4 02:47:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 1487548 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fx6cl3svCz9s24; Fri, 4 Jun 2021 12:47:35 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lozrv-00035e-M2; Fri, 04 Jun 2021 02:47:31 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lozrt-00034M-Ke for kernel-team@lists.ubuntu.com; Fri, 04 Jun 2021 02:47:29 +0000 Received: from mail-oi1-f200.google.com ([209.85.167.200]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lozrt-00062V-D2 for kernel-team@lists.ubuntu.com; Fri, 04 Jun 2021 02:47:29 +0000 Received: by mail-oi1-f200.google.com with SMTP id 23-20020aca11170000b02901f182d8a121so3963801oir.19 for ; Thu, 03 Jun 2021 19:47:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iYt4mTjy6DuEMq/Ow7JuqNpp7cnoeEutZvzOpLgHobM=; b=ZC2Wgn3p8jSFX3Bc2Ua6CQFa9k2oOFj3vHgWEsGDKnvmfCtoxFAn15b/uL3hhZLGuu vqhWiI3KQC0CC4JCDKdl37aw5cXsFhblR45uvPGf5HsZn2SqioJ9vc1H26PGXC/WgqNR hW0xgzn4krCKJXWnSG2d0dBGZkjThknvOP4jT5YzpNeSRVxL51qu8aOIBT7WO+UqbcGG PnTC5gDujEshd/Bxauf4p6BgBY5PydgNaGE19HDIV+Lo/HpAcix+VSfRXT1LZ/aV97Kz pJWmERrWM3ArLduSxGQcj8c4MTZDV7gMkWx1/mqI7FL1yMER3mxRlzo+rRwjzCjZC7fH oKgg== X-Gm-Message-State: AOAM533qAFapbETghQ281cu4VjlP8td5ByZYRGjti6LPmPknC7WfwQxu SIcL/dt56nDHxPGvlXGiXkiiqdq1rS9cbRwSBZ8NQhN4q9x/4LYmFjzzL7SdBTiBrm2e6Qvfg1T ZPiXzmwsT6xjnCUGu4tTDbp7XC7JBWvOuNd5pBQfgfg== X-Received: by 2002:a4a:d41a:: with SMTP id n26mr1901361oos.66.1622774848406; Thu, 03 Jun 2021 19:47:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVJ6tQy7Da9nMyw/Hc09lGcg0A7QfVqYmx4keUg0zr2tFuURBZphU2j+vqFoSd1KuG3QWxsg== X-Received: by 2002:a4a:d41a:: with SMTP id n26mr1901353oos.66.1622774848174; Thu, 03 Jun 2021 19:47:28 -0700 (PDT) Received: from localhost ([2605:a601:ac0f:820:49de:d1a8:57e3:739e]) by smtp.gmail.com with ESMTPSA id p25sm178822ood.4.2021.06.03.19.47.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 19:47:27 -0700 (PDT) From: Seth Forshee To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 6/6][Unstable] UBUNTU: [Debian] fix ownership for files installed during build Date: Thu, 3 Jun 2021 21:47:19 -0500 Message-Id: <20210604024719.650626-7-seth.forshee@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210604024719.650626-1-seth.forshee@canonical.com> References: <20210604024719.650626-1-seth.forshee@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1930713 We now install some files during build. This may be run separately from building packages, in which case fakeroot will not record the correct ownership in package archives. Fix this by adding a new fixowner target which fixes the ownership for the files installed during the build and is a dependency of the build targets. Signed-off-by: Seth Forshee --- debian/rules.d/2-binary-arch.mk | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index 7e2c8b7ae169..700c1e65491d 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -35,11 +35,35 @@ $(stampdir)/stamp-prepare-tree-%: $(commonconfdir)/config.common.$(family) $(arc $(build_cd) $(kmake) $(build_O) -j1 syncconfig prepare scripts touch $@ +# Fix ownership for files potentially installed while not under fakeroot +fixowner-%: pkgdir_bin = $(CURDIR)/debian/$(bin_pkg_name)-$* +fixowner-%: pkgdir = $(CURDIR)/debian/$(mods_pkg_name)-$* +fixowner-%: pkgdir_ex = $(CURDIR)/debian/$(mods_extra_pkg_name)-$* +fixowner-%: pkgdir_bldinfo = $(CURDIR)/debian/$(bldinfo_pkg_name)-$* +fixowner-%: dbgpkgdir = $(CURDIR)/debian/$(bin_pkg_name)-$*-dbgsym +fixowner-%: signingv = $(CURDIR)/debian/$(bin_pkg_name)-signing/$(release)-$(revision) +fixowner-%: toolspkgdir = $(CURDIR)/debian/$(tools_flavour_pkg_name)-$* +fixowner-%: cloudpkgdir = $(CURDIR)/debian/$(cloud_flavour_pkg_name)-$* +fixowner-%: basepkg = $(hdrs_pkg_name) +fixowner-%: indeppkg = $(indep_hdrs_pkg_name) +fixowner-%: $(stampdir)/stamp-install-% + @echo Debug: $@ + [ -e $(pkgdir_bin) ] && find $(pkgdir_bin) -print0 | xargs -0 chown 0:0 || true + [ -e $(pkgdir) ] && find $(pkgdir) -print0 | xargs -0 chown 0:0 || true + [ -e $(pkgdir_ex) ] && find $(pkgdir_ex) -print0 | xargs -0 chown 0:0 || true + [ -e $(pkgdir_bldinfo) ] && find $(pkgdir_bldinfo) -print0 | xargs -0 chown 0:0 || true + [ -e $(dbgpkgdir) ] && find $(dbgpkgdir) -print0 | xargs -0 chown 0:0 || true + [ -e $(signingv) ] && find $(signingv) -print0 | xargs -0 chown 0:0 || true + [ -e $(toolspkgdir) ] && find $(toolspkgdir) -print0 | xargs -0 chown 0:0 || true + [ -e $(cloudpkgdir) ] && find $(cloudpkgdir) -print0 | xargs -0 chown 0:0 || true + [ -e $(basepkg) ] && find $(basepkg) -print0 | xargs -0 chown 0:0 || true + [ -e $(indeppkg) ] && find $(indeppkg) -print0 | xargs -0 chown 0:0 || true + # Used by developers as a shortcut to prepare a tree for compilation. prepare-%: $(stampdir)/stamp-prepare-% @echo Debug: $@ # Used by developers to allow efficient pre-building without fakeroot. -build-%: $(stampdir)/stamp-install-% +build-%: fixowner-% @echo Debug: $@ # Do the actual build, including image and modules