summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHangbin Liu <liuhangbin@gmail.com>2024-03-15 10:34:43 +0800
committerDaniel Borkmann <daniel@iogearbox.net>2024-03-15 14:46:31 +0100
commit5384cc0d1a88c27448a6a4e65b8abe6486de8012 (patch)
treedfdacc7b2a061c0559f54c538ee6b8ce23e3811f /scripts
parent44d79142ede8162fd67bf8ca4ddbda1fbcfa94f1 (diff)
scripts/bpf_doc: Use silent mode when exec make cmd
When getting kernel version via make, the result may be polluted by other output, like directory change info. e.g. $ export MAKEFLAGS="-w" $ make kernelversion make: Entering directory '/home/net' 6.8.0 make: Leaving directory '/home/net' This will distort the reStructuredText output and make latter rst2man failed like: [...] bpf-helpers.rst:20: (WARNING/2) Field list ends without a blank line; unexpected unindent. [...] Using silent mode would help. e.g. $ make -s --no-print-directory kernelversion 6.8.0 Fixes: fd0a38f9c37d ("scripts/bpf: Set version attribute for bpf-helpers(7) man page") Signed-off-by: Michael Hofmann <mhofmann@redhat.com> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Quentin Monnet <qmo@kernel.org> Acked-by: Alejandro Colomar <alx@kernel.org> Link: https://lore.kernel.org/bpf/20240315023443.2364442-1-liuhangbin@gmail.com
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bpf_doc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/bpf_doc.py b/scripts/bpf_doc.py
index 4606944984ee..c55878bddfdd 100755
--- a/scripts/bpf_doc.py
+++ b/scripts/bpf_doc.py
@@ -414,8 +414,8 @@ class PrinterRST(Printer):
version = version.stdout.decode().rstrip()
except:
try:
- version = subprocess.run(['make', 'kernelversion'], cwd=linuxRoot,
- capture_output=True, check=True)
+ version = subprocess.run(['make', '-s', '--no-print-directory', 'kernelversion'],
+ cwd=linuxRoot, capture_output=True, check=True)
version = version.stdout.decode().rstrip()
except:
return 'Linux'