[EOAN,UNSTABLE,1/1] UBUNTU: [Debian] package bpftool in linux-tools-common
diff mbox series

Message ID 20190827113253.22584-2-quentin.monnet@netronome.com
State New
Headers show
Series
  • [EOAN,UNSTABLE,1/1] UBUNTU: [Debian] package bpftool in linux-tools-common
Related show

Commit Message

Quentin Monnet Aug. 27, 2019, 11:32 a.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1774815

bpftool is a debugging and introspection tool for BPF elements,
developed by the BPF kernel community. Its source code is located in the
kernel repository, at tools/bpf/bpftool. Package it in linux-tools and
linux-tools-common.

Along the binary, package manual pages and bash completion file. Note
that the generated manual page bpf-helpers.7 is NOT packaged, as this
one is now included in the man-pages repository.

bpftool itself is installed under /usr/sbin/, to be consistent with its
Makefile.

Dependency python-docutils is added to Build-Depends-Indep, in order to
provide rst2man which is necessary to build bpftool's manual pages.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
---
 debian.master/control.stub.in    |  1 +
 debian.master/rules.d/amd64.mk   |  1 +
 debian.master/rules.d/arm64.mk   |  1 +
 debian.master/rules.d/armhf.mk   |  1 +
 debian.master/rules.d/i386.mk    |  1 +
 debian.master/rules.d/ppc64el.mk |  1 +
 debian.master/rules.d/s390x.mk   |  1 +
 debian/rules                     |  2 +-
 debian/rules.d/1-maintainer.mk   |  1 +
 debian/rules.d/2-binary-arch.mk  |  9 +++++++++
 debian/rules.d/3-binary-indep.mk | 12 +++++++++++-
 11 files changed, 29 insertions(+), 2 deletions(-)

Comments

Seth Forshee Aug. 30, 2019, 4:27 p.m. UTC | #1
On Tue, Aug 27, 2019 at 12:32:53PM +0100, Quentin Monnet wrote:
> BugLink: https://bugs.launchpad.net/bugs/1774815
> 
> bpftool is a debugging and introspection tool for BPF elements,
> developed by the BPF kernel community. Its source code is located in the
> kernel repository, at tools/bpf/bpftool. Package it in linux-tools and
> linux-tools-common.
> 
> Along the binary, package manual pages and bash completion file. Note
> that the generated manual page bpf-helpers.7 is NOT packaged, as this
> one is now included in the man-pages repository.
> 
> bpftool itself is installed under /usr/sbin/, to be consistent with its
> Makefile.
> 
> Dependency python-docutils is added to Build-Depends-Indep, in order to
> provide rst2man which is necessary to build bpftool's manual pages.
> 
> Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>

I see a couple of issues, please see below.

> diff --git a/debian.master/control.stub.in b/debian.master/control.stub.in
> index 04d677f8b717..863d4bcdf945 100644
> --- a/debian.master/control.stub.in
> +++ b/debian.master/control.stub.in
> @@ -48,6 +48,7 @@ Build-Depends-Indep:
>   asciidoc <!stage1>,
>   python-sphinx <!stage1>,
>   python-sphinx-rtd-theme <!stage1>,
> + python-docutils <!stage1>,

This package depends on python2, and I think that we need to avoid
introducing any new build dependencies on python2. Would
python3-docutils work instead?

> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -379,6 +379,9 @@ 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)-$*
> @@ -659,6 +662,9 @@ ifeq ($(do_tools_perf),true)
>  	cd $(builddirpa)/tools/perf && \
>  		$(kmake) prefix=/usr HAVE_NO_LIBBFD=1 HAVE_CPLUS_DEMANGLE_SUPPORT=1 CROSS_COMPILE=$(CROSS_COMPILE) NO_LIBPYTHON=1 NO_LIBPERL=1 PYTHON=python2.7
>  endif
> +ifeq ($(do_tools_bpftool),true)
> +	$(kmake) -C $(builddirpa)/tools/bpf/bpftool
> +endif

Shouldn't this set CROSS_COMPILE?

Thanks,
Seth
Quentin Monnet Aug. 30, 2019, 5:23 p.m. UTC | #2
2019-08-30 11:27 UTC-0500 ~ Seth Forshee <seth.forshee@canonical.com>
> On Tue, Aug 27, 2019 at 12:32:53PM +0100, Quentin Monnet wrote:
>> BugLink: https://bugs.launchpad.net/bugs/1774815
>>
>> bpftool is a debugging and introspection tool for BPF elements,
>> developed by the BPF kernel community. Its source code is located in the
>> kernel repository, at tools/bpf/bpftool. Package it in linux-tools and
>> linux-tools-common.
>>
>> Along the binary, package manual pages and bash completion file. Note
>> that the generated manual page bpf-helpers.7 is NOT packaged, as this
>> one is now included in the man-pages repository.
>>
>> bpftool itself is installed under /usr/sbin/, to be consistent with its
>> Makefile.
>>
>> Dependency python-docutils is added to Build-Depends-Indep, in order to
>> provide rst2man which is necessary to build bpftool's manual pages.
>>
>> Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
> 
> I see a couple of issues, please see below.
> 
>> diff --git a/debian.master/control.stub.in b/debian.master/control.stub.in
>> index 04d677f8b717..863d4bcdf945 100644
>> --- a/debian.master/control.stub.in
>> +++ b/debian.master/control.stub.in
>> @@ -48,6 +48,7 @@ Build-Depends-Indep:
>>   asciidoc <!stage1>,
>>   python-sphinx <!stage1>,
>>   python-sphinx-rtd-theme <!stage1>,
>> + python-docutils <!stage1>,
> 
> This package depends on python2, and I think that we need to avoid
> introducing any new build dependencies on python2. Would
> python3-docutils work instead?

Yes, it also provides rst2man. I will update to python3-docutils.

> 
>> --- a/debian/rules.d/2-binary-arch.mk
>> +++ b/debian/rules.d/2-binary-arch.mk
>> @@ -379,6 +379,9 @@ 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)-$*
>> @@ -659,6 +662,9 @@ ifeq ($(do_tools_perf),true)
>>  	cd $(builddirpa)/tools/perf && \
>>  		$(kmake) prefix=/usr HAVE_NO_LIBBFD=1 HAVE_CPLUS_DEMANGLE_SUPPORT=1 CROSS_COMPILE=$(CROSS_COMPILE) NO_LIBPYTHON=1 NO_LIBPERL=1 PYTHON=python2.7
>>  endif
>> +ifeq ($(do_tools_bpftool),true)
>> +	$(kmake) -C $(builddirpa)/tools/bpf/bpftool
>> +endif
> 
> Shouldn't this set CROSS_COMPILE?

That's right, I missed it, thanks.

I will fix these two issues and repost a new version.

Thanks a lot,
Quentin

Patch
diff mbox series

diff --git a/debian.master/control.stub.in b/debian.master/control.stub.in
index 04d677f8b717..863d4bcdf945 100644
--- a/debian.master/control.stub.in
+++ b/debian.master/control.stub.in
@@ -48,6 +48,7 @@  Build-Depends-Indep:
  asciidoc <!stage1>,
  python-sphinx <!stage1>,
  python-sphinx-rtd-theme <!stage1>,
+ python-docutils <!stage1>,
 Vcs-Git: git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/=SERIES=
 XS-Testsuite: autopkgtest
 #XS-Testsuite-Depends: gcc-4.7 binutils
diff --git a/debian.master/rules.d/amd64.mk b/debian.master/rules.d/amd64.mk
index d17467e63683..9ffa35ccb8df 100644
--- a/debian.master/rules.d/amd64.mk
+++ b/debian.master/rules.d/amd64.mk
@@ -14,6 +14,7 @@  do_tools_usbip  = true
 do_tools_cpupower = true
 do_tools_perf   = true
 do_tools_perf_jvmti = true
+do_tools_bpftool = true
 do_tools_x86	= true
 do_tools_hyperv	= true
 do_tools_host = true
diff --git a/debian.master/rules.d/arm64.mk b/debian.master/rules.d/arm64.mk
index 05e22310d30e..32f27c724c9a 100644
--- a/debian.master/rules.d/arm64.mk
+++ b/debian.master/rules.d/arm64.mk
@@ -17,6 +17,7 @@  do_tools_usbip  = true
 do_tools_cpupower = true
 do_tools_perf   = true
 do_tools_perf_jvmti = true
+do_tools_bpftool = true
 
 do_dtbs		= true
 do_zfs		= true
diff --git a/debian.master/rules.d/armhf.mk b/debian.master/rules.d/armhf.mk
index d516ae13454c..085e8acdc8aa 100644
--- a/debian.master/rules.d/armhf.mk
+++ b/debian.master/rules.d/armhf.mk
@@ -14,5 +14,6 @@  do_tools_usbip  = true
 do_tools_cpupower = true
 do_tools_perf	= true
 do_tools_perf_jvmti = true
+do_tools_bpftool = true
 
 do_dtbs		= true
diff --git a/debian.master/rules.d/i386.mk b/debian.master/rules.d/i386.mk
index ca34b9759d1e..06ac6ea33563 100644
--- a/debian.master/rules.d/i386.mk
+++ b/debian.master/rules.d/i386.mk
@@ -13,6 +13,7 @@  do_tools_usbip  = true
 do_tools_cpupower = true
 do_tools_perf   = true
 do_tools_perf_jvmti = true
+do_tools_bpftool = true
 do_tools_x86	= true
 do_tools_hyperv = true
 do_extras_package = true
diff --git a/debian.master/rules.d/ppc64el.mk b/debian.master/rules.d/ppc64el.mk
index c540bacaa166..3934ef482a57 100644
--- a/debian.master/rules.d/ppc64el.mk
+++ b/debian.master/rules.d/ppc64el.mk
@@ -15,6 +15,7 @@  do_tools_usbip    = true
 do_tools_cpupower = true
 do_tools_perf	  = true
 do_tools_perf_jvmti = true
+do_tools_bpftool  = true
 
 #do_flavour_image_package = false
 do_zfs		= true
diff --git a/debian.master/rules.d/s390x.mk b/debian.master/rules.d/s390x.mk
index dad66b1a674f..cbc188507892 100644
--- a/debian.master/rules.d/s390x.mk
+++ b/debian.master/rules.d/s390x.mk
@@ -16,5 +16,6 @@  do_tools_usbip    = true
 do_tools_cpupower = true
 do_tools_perf     = true
 do_tools_perf_jvmti = true
+do_tools_bpftool  = true
 
 do_zfs		= true
diff --git a/debian/rules b/debian/rules
index 0953195f5ab1..2edbd7485b8f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -33,7 +33,7 @@  include $(DROOT)/rules.d/0-common-vars.mk
 # Maintainer targets
 include $(DROOT)/rules.d/1-maintainer.mk
 
-do_linux_tools=$(sort $(filter-out false,$(do_tools_usbip) $(do_tools_cpupower) $(do_tools_perf) $(do_tools_x86)))
+do_linux_tools=$(sort $(filter-out false,$(do_tools_usbip) $(do_tools_cpupower) $(do_tools_perf) $(do_tools_bpftool) $(do_tools_x86)))
 do_cloud_tools=$(sort $(filter-out false,$(do_tools_hyperv)))
 do_tools_common?=true
 do_tools_host?=false
diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
index e71bf3c281ef..bce24fc1d82f 100644
--- a/debian/rules.d/1-maintainer.mk
+++ b/debian/rules.d/1-maintainer.mk
@@ -85,6 +85,7 @@  printenv:
 	@echo "do_linux_tools            = $(do_linux_tools)"
 	@echo " do_tools_cpupower         = $(do_tools_cpupower)"
 	@echo " do_tools_perf             = $(do_tools_perf)"
+	@echo " do_tools_bpftool          = $(do_tools_bpftool)"
 	@echo " do_tools_x86              = $(do_tools_x86)"
 	@echo " do_tools_host             = $(do_tools_host)"
 	@echo "do_cloud_tools            = $(do_cloud_tools)"
diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index f3ab06748cf6..3fd9cd5956be 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -379,6 +379,9 @@  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)-$*
@@ -659,6 +662,9 @@  ifeq ($(do_tools_perf),true)
 	cd $(builddirpa)/tools/perf && \
 		$(kmake) prefix=/usr HAVE_NO_LIBBFD=1 HAVE_CPLUS_DEMANGLE_SUPPORT=1 CROSS_COMPILE=$(CROSS_COMPILE) NO_LIBPYTHON=1 NO_LIBPERL=1 PYTHON=python2.7
 endif
+ifeq ($(do_tools_bpftool),true)
+	$(kmake) -C $(builddirpa)/tools/bpf/bpftool
+endif
 ifeq ($(do_tools_x86),true)
 	cd $(builddirpa)/tools/power/x86/x86_energy_perf_policy && make CROSS_COMPILE=$(CROSS_COMPILE)
 	cd $(builddirpa)/tools/power/x86/turbostat && make CROSS_COMPILE=$(CROSS_COMPILE)
@@ -703,6 +709,9 @@  ifeq ($(do_tools_perf_jvmti),true)
 	install -m755 $(builddirpa)/tools/perf/libperf-jvmti.so $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
 endif
 endif
+ifeq ($(do_tools_bpftool),true)
+	install -m755 $(builddirpa)/tools/bpf/bpftool/bpftool $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
+endif
 ifeq ($(do_tools_x86),true)
 	install -m755 $(builddirpa)/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy \
 		$(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk
index 6c847da42bd4..870a6b8ddfa2 100644
--- a/debian/rules.d/3-binary-indep.mk
+++ b/debian/rules.d/3-binary-indep.mk
@@ -84,6 +84,7 @@  install-tools: toolspkg = $(tools_common_pkg_name)
 install-tools: toolsbin = $(CURDIR)/debian/$(toolspkg)/usr/bin
 install-tools: toolssbin = $(CURDIR)/debian/$(toolspkg)/usr/sbin
 install-tools: toolsman = $(CURDIR)/debian/$(toolspkg)/usr/share/man
+install-tools: toolsbashcomp = $(CURDIR)/debian/$(toolspkg)/usr/share/bash-completion/completions
 install-tools: hosttoolspkg = $(hosttools_pkg_name)
 install-tools: hosttoolsbin = $(CURDIR)/debian/$(hosttoolspkg)/usr/bin
 install-tools: hosttoolsman = $(CURDIR)/debian/$(hosttoolspkg)/usr/share/man
@@ -102,7 +103,10 @@  ifeq ($(do_tools_common),true)
 	rsync -a tools/ $(builddir)/tools/tools/
 
 	install -d $(toolsbin)
+	install -d $(toolssbin)
 	install -d $(toolsman)/man1
+	install -d $(toolsman)/man8
+	install -d $(toolsbashcomp)
 
 	install -m755 debian/tools/generic $(toolsbin)/usbip
 	install -m755 debian/tools/generic $(toolsbin)/usbipd
@@ -113,6 +117,13 @@  ifeq ($(do_tools_common),true)
 
 	install -m755 debian/tools/generic $(toolsbin)/perf
 
+	install -m755 debian/tools/generic $(toolssbin)/bpftool
+	make -C $(builddir)/tools/tools/bpf/bpftool doc
+	install -m644 $(builddir)/tools/tools/bpf/bpftool/Documentation/*.8 \
+		$(toolsman)/man8
+	install -m644 $(builddir)/tools/tools/bpf/bpftool/bash-completion/bpftool \
+		$(toolsbashcomp)
+
 	install -m755 debian/tools/generic $(toolsbin)/x86_energy_perf_policy
 	install -m755 debian/tools/generic $(toolsbin)/turbostat
 
@@ -120,7 +131,6 @@  ifeq ($(do_tools_common),true)
 	install -m644 $(builddir)/tools/tools/perf/Documentation/*.1 \
 		$(toolsman)/man1
 
-	install -d $(toolsman)/man8
 	install -m644 $(CURDIR)/tools/power/x86/x86_energy_perf_policy/*.8 $(toolsman)/man8
 	install -m644 $(CURDIR)/tools/power/x86/turbostat/*.8 $(toolsman)/man8