aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <benh@debian.org>2020-08-14 00:59:33 +0100
committerBen Hutchings <benh@debian.org>2020-08-14 00:59:33 +0100
commitc1a6f85ef9d7a6ec7c0fa1dbc83e98c1e9efdfdd (patch)
tree261de18ee8fa5be5ef28bb7e8b2cb61354c8cdf5
parent2f339928aa9b44f7892ea69ff4e56a45893b434e (diff)
downloadkernel_replicant_linux-c1a6f85ef9d7a6ec7c0fa1dbc83e98c1e9efdfdd.tar.gz
kernel_replicant_linux-c1a6f85ef9d7a6ec7c0fa1dbc83e98c1e9efdfdd.tar.bz2
kernel_replicant_linux-c1a6f85ef9d7a6ec7c0fa1dbc83e98c1e9efdfdd.zip
bpftool: Fix version string in recursive builds
-rw-r--r--debian/changelog1
-rw-r--r--debian/patches/bugfix/all/bpftool-fix-version-string-in-recursive-builds.patch30
-rw-r--r--debian/patches/series1
3 files changed, 32 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index c99d0275c22e..318e9e2f897a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -39,6 +39,7 @@ linux (5.8-1~exp1) UNRELEASED; urgency=medium
* [x86] hyperv-daemons: Complete renaming of init scripts
* [x86] hyperv-daemons: Correct old names in Conflicts field of unit files
* [hppa] Use standard metadata for transitional packages
+ * bpftool: Fix version string in recursive builds
[ Christian Barcenas ]
* bpftool: add packaging for tools/bpf/bpftool (Closes: #896165)
diff --git a/debian/patches/bugfix/all/bpftool-fix-version-string-in-recursive-builds.patch b/debian/patches/bugfix/all/bpftool-fix-version-string-in-recursive-builds.patch
new file mode 100644
index 000000000000..6d0b93d2fbe6
--- /dev/null
+++ b/debian/patches/bugfix/all/bpftool-fix-version-string-in-recursive-builds.patch
@@ -0,0 +1,30 @@
+From: Ben Hutchings <benh@debian.org>
+Date: Fri, 14 Aug 2020 00:43:54 +0100
+Subject: bpftool: Fix version string in recursive builds
+Forwarded: https://lore.kernel.org/bpf/20200813235837.GA497088@decadent.org.uk/T/#u
+
+When bpftool is built as part of a Debian package build, which itself
+uses make, "bpftool version" shows:
+
+ bpftool vmake[4]: Entering directory /build/linux-5.8/tools/bpf/bpftool 5.8.8.0 make[4]: Leaving directory /build/linux-5.8
+
+Although we pass the "--no-print-directory" option, this is overridden
+by the environment variable "MAKEFLAGS=w". Clear MAKEFLAGS for the
+"make kernelversion" command.
+
+I have no explanation for the doubled ".8" in the version string, but
+this seems to fix that as well.
+
+Signed-off-by: Ben Hutchings <benh@debian.org>
+---
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -25,7 +25,7 @@ endif
+
+ LIBBPF = $(LIBBPF_PATH)libbpf.a
+
+-BPFTOOL_VERSION := $(shell make -rR --no-print-directory -sC ../../.. kernelversion)
++BPFTOOL_VERSION := $(shell MAKEFLAGS= make -rR --no-print-directory -sC ../../.. kernelversion)
+
+ $(LIBBPF): FORCE
+ $(if $(LIBBPF_OUTPUT),@mkdir -p $(LIBBPF_OUTPUT))
diff --git a/debian/patches/series b/debian/patches/series
index b5e440b016ec..3c4a7f5984c4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -124,6 +124,7 @@ bugfix/all/libcpupower-hide-private-function.patch
bugfix/all/cpupower-fix-checks-for-cpu-existence.patch
bugfix/all/tools-perf-pmu-events-fix-reproducibility.patch
bugfix/all/0005-libtraceevent-Add-dependency-on-libdl.patch
+bugfix/all/bpftool-fix-version-string-in-recursive-builds.patch
# overlay: allow mounting in user namespaces
debian/overlayfs-permit-mounts-in-userns.patch