Commit 5384cc0d authored by Hangbin Liu's avatar Hangbin Liu Committed by Daniel Borkmann

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: fd0a38f9 ("scripts/bpf: Set version attribute for bpf-helpers(7) man page")
Signed-off-by: default avatarMichael Hofmann <mhofmann@redhat.com>
Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Reviewed-by: default avatarQuentin Monnet <qmo@kernel.org>
Acked-by: default avatarAlejandro Colomar <alx@kernel.org>
Link: https://lore.kernel.org/bpf/20240315023443.2364442-1-liuhangbin@gmail.com
parent 44d79142
......@@ -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'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment