diff mbox series

[SRU,N,1/2] UBUNTU: [Packaging] linux-tools: Link directories rather than individual files

Message ID cb933785d57f6ca483f40158f890e75c8e092463.1737473383.git.juerg.haefliger@canonical.com
State New
Headers show
Series python perf module missing in realtime kernel (LP: #2089411) | expand

Commit Message

Juerg Haefliger Jan. 21, 2025, 3:50 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2089411

We currently have individual links for every file provided by linux-tools:
linux-tools/<abi>-<flavor>/foo -> ../../linux-tools-<abi>/foo
linux-tools/<abi>-<flavor>/bar -> ../../linux-tools-<abi>/bar
...

That's not really necessary, link the directory instead:
linux-tools/<abi>-<flavor> -> ../linux-tools-<abi>

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: Agathe Porte <agathe.porte@canonical.com>
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
(backported from commit d79528bb27e98e8a75657eaff6697129bceddeae plucky:linux)
[juergh: Changed $(DEB_SOURCE) -> $(src_pkg_name), context adjustments]
Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
---
 debian/rules.d/2-binary-arch.mk | 40 +++++----------------------------
 1 file changed, 6 insertions(+), 34 deletions(-)

Comments

Andy Whitcroft Jan. 22, 2025, 11:24 a.m. UTC | #1
I do not see how this works in the face of installing both linux-tools and
linux-cloud-tools?  Each would have a conflicting link to their contents?

-apw

On Tue, Jan 21, 2025 at 3:50 PM Juerg Haefliger <
juerg.haefliger@canonical.com> wrote:

> BugLink: https://bugs.launchpad.net/bugs/2089411
>
> We currently have individual links for every file provided by linux-tools:
> linux-tools/<abi>-<flavor>/foo -> ../../linux-tools-<abi>/foo
> linux-tools/<abi>-<flavor>/bar -> ../../linux-tools-<abi>/bar
> ...
>
> That's not really necessary, link the directory instead:
> linux-tools/<abi>-<flavor> -> ../linux-tools-<abi>
>
> Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> Acked-by: Agathe Porte <agathe.porte@canonical.com>
> Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
> (backported from commit d79528bb27e98e8a75657eaff6697129bceddeae
> plucky:linux)
> [juergh: Changed $(DEB_SOURCE) -> $(src_pkg_name), context adjustments]
> Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> ---
>  debian/rules.d/2-binary-arch.mk | 40 +++++----------------------------
>  1 file changed, 6 insertions(+), 34 deletions(-)
>
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/
> 2-binary-arch.mk
> index 6857a12a87e3..ba60cbd0ea74 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -348,43 +348,15 @@ endif
>         rmdir $(pkgdir)/lib/modules/$(abi_release)-$*/_
>
>  ifeq ($(do_linux_tools),true)
> -       # Create the linux-tools tool links
> -       install -d $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -ifeq ($(do_tools_usbip),true)
> -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/usbip
> $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/usbipd
> $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -endif
> -ifeq ($(do_tools_acpidbg),true)
> -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/acpidbg
> $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -endif
> -ifeq ($(do_tools_cpupower),true)
> -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/cpupower
> $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -endif
> -ifeq ($(do_tools_rtla),true)
> -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/rtla
> $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -endif
> -ifeq ($(do_tools_perf),true)
> -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/perf
> $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -ifeq ($(do_tools_perf_jvmti),true)
> -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/libperf-jvmti.so
> $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -endif
> -endif
> -ifeq ($(do_tools_bpftool),true)
> -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/bpftool
> $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -endif
> -ifeq ($(do_tools_x86),true)
> -       $(LN)
> ../../$(src_pkg_name)-tools-$(abi_release)/x86_energy_perf_policy
> $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/turbostat
> $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -endif
> +       # Create the linux-tools tool link
> +       install -d $(toolspkgdir)/usr/lib/linux-tools
> +       $(LN) ../$(src_pkg_name)-tools-$(abi_release)
> $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
>  endif
>  ifeq ($(do_cloud_tools),true)
>  ifeq ($(do_tools_hyperv),true)
> -       # Create the linux-hyperv tool links
> -       install -d $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/hv_kvp_daemon
> $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/hv_vss_daemon
> $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/hv_fcopy_daemon
> $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/lsvmbus
> $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> +       # Create the linux-hyperv tool link
> +       install -d $(cloudpkgdir)/usr/lib/linux-tools
> +       $(LN) ../$(src_pkg_name)-tools-$(abi_release)
> $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
>  endif
>  endif
>
> --
> 2.43.0
>
>
> --
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
>
Juerg Haefliger Jan. 22, 2025, 12:43 p.m. UTC | #2
On Wed, 22 Jan 2025 11:24:42 +0000
Andy Whitcroft <apw@canonical.com> wrote:

> I do not see how this works in the face of installing both linux-tools and
> linux-cloud-tools?  Each would have a conflicting link to their contents?

Darn, you're right. Sigh. linux-cloud-tools should not install into
/usr/lib/linux-tools but /usr/lib/linux-cloud-tools instead. Which probably
breaks the wrapper and other things as well...

Actually I wanted to get rid of those links and provide the
binaries directly with linux-tools-<version>-<flavor>. Yes, that means we
might have duplicate binaries on disk but only if you have multiple flavors
of the same version installed. Who cares? It would make packaging simpler and
remove one level of indirection.

Thoughts?

 ...Juerg

> 
> -apw
> 
> On Tue, Jan 21, 2025 at 3:50 PM Juerg Haefliger <
> juerg.haefliger@canonical.com> wrote:  
> 
> > BugLink: https://bugs.launchpad.net/bugs/2089411
> >
> > We currently have individual links for every file provided by linux-tools:
> > linux-tools/<abi>-<flavor>/foo -> ../../linux-tools-<abi>/foo
> > linux-tools/<abi>-<flavor>/bar -> ../../linux-tools-<abi>/bar
> > ...
> >
> > That's not really necessary, link the directory instead:
> > linux-tools/<abi>-<flavor> -> ../linux-tools-<abi>
> >
> > Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> > Acked-by: Agathe Porte <agathe.porte@canonical.com>
> > Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
> > (backported from commit d79528bb27e98e8a75657eaff6697129bceddeae
> > plucky:linux)
> > [juergh: Changed $(DEB_SOURCE) -> $(src_pkg_name), context adjustments]
> > Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> > ---
> >  debian/rules.d/2-binary-arch.mk | 40 +++++----------------------------
> >  1 file changed, 6 insertions(+), 34 deletions(-)
> >
> > diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/
> > 2-binary-arch.mk
> > index 6857a12a87e3..ba60cbd0ea74 100644
> > --- a/debian/rules.d/2-binary-arch.mk
> > +++ b/debian/rules.d/2-binary-arch.mk
> > @@ -348,43 +348,15 @@ endif
> >         rmdir $(pkgdir)/lib/modules/$(abi_release)-$*/_
> >
> >  ifeq ($(do_linux_tools),true)
> > -       # Create the linux-tools tool links
> > -       install -d $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -ifeq ($(do_tools_usbip),true)
> > -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/usbip
> > $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/usbipd
> > $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -endif
> > -ifeq ($(do_tools_acpidbg),true)
> > -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/acpidbg
> > $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -endif
> > -ifeq ($(do_tools_cpupower),true)
> > -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/cpupower
> > $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -endif
> > -ifeq ($(do_tools_rtla),true)
> > -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/rtla
> > $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -endif
> > -ifeq ($(do_tools_perf),true)
> > -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/perf
> > $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -ifeq ($(do_tools_perf_jvmti),true)
> > -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/libperf-jvmti.so
> > $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -endif
> > -endif
> > -ifeq ($(do_tools_bpftool),true)
> > -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/bpftool
> > $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -endif
> > -ifeq ($(do_tools_x86),true)
> > -       $(LN)
> > ../../$(src_pkg_name)-tools-$(abi_release)/x86_energy_perf_policy
> > $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/turbostat
> > $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -endif
> > +       # Create the linux-tools tool link
> > +       install -d $(toolspkgdir)/usr/lib/linux-tools
> > +       $(LN) ../$(src_pkg_name)-tools-$(abi_release)
> > $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> >  endif
> >  ifeq ($(do_cloud_tools),true)
> >  ifeq ($(do_tools_hyperv),true)
> > -       # Create the linux-hyperv tool links
> > -       install -d $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/hv_kvp_daemon
> > $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/hv_vss_daemon
> > $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/hv_fcopy_daemon
> > $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > -       $(LN) ../../$(src_pkg_name)-tools-$(abi_release)/lsvmbus
> > $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> > +       # Create the linux-hyperv tool link
> > +       install -d $(cloudpkgdir)/usr/lib/linux-tools
> > +       $(LN) ../$(src_pkg_name)-tools-$(abi_release)
> > $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
> >  endif
> >  endif
> >
> > --
> > 2.43.0
> >
> >
> > --
> > kernel-team mailing list
> > kernel-team@lists.ubuntu.com
> > https://lists.ubuntu.com/mailman/listinfo/kernel-team
> >
diff mbox series

Patch

diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 6857a12a87e3..ba60cbd0ea74 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -348,43 +348,15 @@  endif
 	rmdir $(pkgdir)/lib/modules/$(abi_release)-$*/_
 
 ifeq ($(do_linux_tools),true)
-	# Create the linux-tools tool links
-	install -d $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-ifeq ($(do_tools_usbip),true)
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/usbip $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/usbipd $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-endif
-ifeq ($(do_tools_acpidbg),true)
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/acpidbg $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-endif
-ifeq ($(do_tools_cpupower),true)
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/cpupower $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-endif
-ifeq ($(do_tools_rtla),true)
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/rtla $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-endif
-ifeq ($(do_tools_perf),true)
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/perf $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-ifeq ($(do_tools_perf_jvmti),true)
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/libperf-jvmti.so $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-endif
-endif
-ifeq ($(do_tools_bpftool),true)
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/bpftool $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-endif
-ifeq ($(do_tools_x86),true)
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/x86_energy_perf_policy $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/turbostat $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-endif
+	# Create the linux-tools tool link
+	install -d $(toolspkgdir)/usr/lib/linux-tools
+	$(LN) ../$(src_pkg_name)-tools-$(abi_release) $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
 endif
 ifeq ($(do_cloud_tools),true)
 ifeq ($(do_tools_hyperv),true)
-	# Create the linux-hyperv tool links
-	install -d $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/hv_kvp_daemon $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/hv_vss_daemon $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/hv_fcopy_daemon $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
-	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/lsvmbus $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
+	# Create the linux-hyperv tool link
+	install -d $(cloudpkgdir)/usr/lib/linux-tools
+	$(LN) ../$(src_pkg_name)-tools-$(abi_release) $(cloudpkgdir)/usr/lib/linux-tools/$(abi_release)-$*
 endif
 endif