diff options
Diffstat (limited to 'debian')
-rw-r--r-- | debian/.gitignore | 1 | ||||
-rw-r--r-- | debian/changelog | 4 | ||||
-rw-r--r-- | debian/copyright | 31 | ||||
-rw-r--r-- | debian/rules.d/tools/bpf/bpftool/Makefile | 29 | ||||
-rw-r--r-- | debian/rules.real | 27 | ||||
-rw-r--r-- | debian/templates/control.tools-unversioned.in | 13 |
6 files changed, 105 insertions, 0 deletions
diff --git a/debian/.gitignore b/debian/.gitignore index 90a733287065..ff620d2b1af4 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -19,6 +19,7 @@ /control /control.md5sum /files +/bpftool/ /hyperv-daemons/ /kernel-image-*-di* /libcpupower*/ diff --git a/debian/changelog b/debian/changelog index 6c11898800df..c99d0275c22e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -40,6 +40,10 @@ linux (5.8-1~exp1) UNRELEASED; urgency=medium * [x86] hyperv-daemons: Correct old names in Conflicts field of unit files * [hppa] Use standard metadata for transitional packages + [ Christian Barcenas ] + * bpftool: add packaging for tools/bpf/bpftool (Closes: #896165) + - Thank you to Noah Meyerhans for the first iteration of packaging. + -- Yves-Alexis Perez <corsac@debian.org> Wed, 24 Jun 2020 21:58:24 +0200 linux (5.7.10-1) unstable; urgency=medium diff --git a/debian/copyright b/debian/copyright index 857d7cda15e1..e93b6f4f99fe 100644 --- a/debian/copyright +++ b/debian/copyright @@ -192,6 +192,37 @@ Copyright: 2014-2015 Red Hat, Inc. 2015 Intel Corporation License: LGPL-2.1 +Files: tools/lib/bpf/* +Copyright: 2015-2020 Linus Torvalds and many others +License: LGPL-2.1 or BSD-2-clause + +Files: tools/bpf/bpftool/* +Copyright: 2017-2020 Linus Torvalds and many others +License: GPL-2 or BSD-2-clause + +License: BSD-2-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + License: GPL-2 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as diff --git a/debian/rules.d/tools/bpf/bpftool/Makefile b/debian/rules.d/tools/bpf/bpftool/Makefile new file mode 100644 index 000000000000..70447d449df4 --- /dev/null +++ b/debian/rules.d/tools/bpf/bpftool/Makefile @@ -0,0 +1,29 @@ +include $(top_rulesdir)/Makefile.inc + +MAKE_BPFTOOL := +$(MAKE) -C $(top_srcdir)/$(OUTDIR) O=$(CURDIR) +MAKE_BPFTOOL += prefix=/usr +MAKE_BPFTOOL += mandir=/usr/share/man +MAKE_BPFTOOL += V=$(KBUILD_VERBOSE) +MAKE_BPFTOOL += ARCH=$(KERNEL_ARCH) + +# dynamically linking with libbfd is not allowed in Debian +MAKE_BPFTOOL += feature-libbfd=0 feature-libbfd-liberty=0 feature-libbfd-liberty-z=0 + +all: + $(MAKE_BPFTOOL) +ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) + $(MAKE_BPFTOOL) doc +endif +# Check that bpftool wasn't linked with libbfd + type ldd + ! ldd $(CURDIR)/bpftool | grep -E '\blibbfd' + +install: + $(MAKE_BPFTOOL) install +ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) + $(MAKE_BPFTOOL) doc-install +# doc-install installs a bpf-helpers.7 that conflicts +# with the one distributed by the manpages package. + rm $(DESTDIR)/usr/share/man/man7/bpf-helpers.7 + rmdir $(DESTDIR)/usr/share/man/man7/ +endif diff --git a/debian/rules.real b/debian/rules.real index d1adba71ff92..d527f131f9d0 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -63,6 +63,7 @@ build-arch-arch: \ $(call if_package, linux-kbuild-$(VERSION), build-kbuild) \ $(call if_package, linux-perf-$(VERSION), build-perf) \ $(call if_package, linux-bootwrapper-$(ABINAME), build-bootwrapper) \ + $(call if_package, bpftool, build-bpftool) \ $(call if_package, usbip, build-usbip) \ $(call if_package, linux-cpupower, build-cpupower) \ $(call if_package, liblockdep-dev, build-liblockdep) \ @@ -76,6 +77,7 @@ binary-arch-arch: \ $(if $(filter-out x-$(VERSION),x$(SOURCE_SUFFIX)), \ $(call if_package, linux-perf$(SOURCE_SUFFIX), install-perf-meta)) \ $(call if_package, linux-bootwrapper-$(ABINAME), install-bootwrapper) \ + $(call if_package, bpftool, install-bpftool) \ $(call if_package, usbip, install-usbip) \ $(call if_package, linux-cpupower, install-cpupower) \ $(call if_package, liblockdep-dev, install-liblockdep) \ @@ -622,6 +624,31 @@ $(STAMPS_DIR)/build-tools-headers: headers_install @$(stamp) +build-bpftool: $(STAMPS_DIR)/build-tools-headers + $(call make-tools,tools/bpf/bpftool) + +install-bpftool: PACKAGE_NAME = bpftool +install-bpftool: DH_OPTIONS = -p$(PACKAGE_NAME) +install-bpftool: DIR = $(CURDIR)/debian/$(PACKAGE_NAME) +install-bpftool: build-bpftool + dh_testdir + dh_testroot + dh_prep + $(call make-tools,tools/bpf/bpftool) install DESTDIR=$(DIR) + dh_installchangelogs +ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) + dh_installdocs +endif + dh_lintian + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + build-kbuild: $(STAMPS_DIR)/build-tools-headers $(call make-tools,scripts) $(call make-tools,tools/objtool) diff --git a/debian/templates/control.tools-unversioned.in b/debian/templates/control.tools-unversioned.in index e8a2a018c90c..3d76f9a7dbbe 100644 --- a/debian/templates/control.tools-unversioned.in +++ b/debian/templates/control.tools-unversioned.in @@ -1,3 +1,16 @@ +Package: bpftool +Build-Profiles: <!stage1 !pkg.linux.notools> +Section: devel +Architecture: linux-any +Build-Depends: + python3-docutils <!stage1 !nodoc !pkg.linux.notools>, + libelf-dev, + zlib1g-dev, +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Inspection and simple manipulation of BPF programs and maps + The bpftool command allows for inspection and simple modification of + Berkeley Packet Filter (BPF) objects on the system. + Package: linux-cpupower Build-Profiles: <!stage1 !pkg.linux.notools> Section: admin |