[PATCH 6/6][Unstable] UBUNTU: [Debian] fix ownership for files installed during build

Andy Whitcroft apw at canonical.com
Thu Jun 3 13:22:56 UTC 2021


The tools conditional nesting is a bit tortuous.  I wonder given the remedy
is the same in each case if there is value in converting something like
this once per package:

    [ -e $(pkgdir_bin) ] && find $(pkgdir_bin) -print0 | xargs -0 chown 0:0

-apw


14:17 <https://chat.canonical.com/canonical/pl/w8ss9brfobgtpdegmrni3jsbee>

[ -e $(pkgdir_bin) ] && find $(pkgdir_bin) -print0 | xargs -0 chown 0:0
On Thu, 3 Jun 2021 at 14:06, Seth Forshee <seth.forshee at canonical.com>
wrote:

> 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 <seth.forshee at canonical.com>
> ---
>  debian/rules.d/2-binary-arch.mk | 38 ++++++++++++++++++++++++++++++++-
>  1 file changed, 37 insertions(+), 1 deletion(-)
>
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/
> 2-binary-arch.mk
> index 7e2c8b7ae169..cbfc604607f7 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -35,11 +35,47 @@ $(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: $@
> +       find $(pkgdir_bin) -print0 | xargs -0 chown 0:0
> +       find $(pkgdir) -print0 | xargs -0 chown 0:0
> +ifeq ($(do_extras_package),true)
> +       find $(pkgdir_ex) -print0 | xargs -0 chown 0:0
> +endif
> +       find $(pkgdir_bldinfo) -print0 | xargs -0 chown 0:0
> +ifneq ($(skipdbg),true)
> +       find $(dbgpkgdir) -print0 | xargs -0 chown 0:0
> +endif
> +ifeq ($(any_signed),true)
> +       find $(signingv) -print0 | xargs -0 chown 0:0
> +endif
> +ifeq ($(do_linux_tools),true)
> +       find $(toolspkgdir) -print0 | xargs -0 chown 0:0
> +ifeq ($(do_cloud_tools),true)
> +ifeq ($(do_tools_hyperv),true)
> +       find $(cloudpkgdir) -print0 | xargs -0 chown 0:0
> +endif
> +endif
> +endif
> +       find $(basepkg) -print0 | xargs -0 chown 0:0
> +       find $(indeppkg) -print0 | xargs -0 chown 0:0
> +
>  # 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
> --
> 2.31.1
>
>
> --
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20210603/70df48d1/attachment-0001.html>


More information about the kernel-team mailing list