]>
Commit | Line | Data |
---|---|---|
ffc1c2fe SL |
1 | From 1dfa0d18eae37a05226beef2235d5997b7632dc6 Mon Sep 17 00:00:00 2001 |
2 | From: Sasha Levin <sashal@kernel.org> | |
3 | Date: Fri, 15 Mar 2024 10:34:43 +0800 | |
4 | Subject: scripts/bpf_doc: Use silent mode when exec make cmd | |
5 | ||
6 | From: Hangbin Liu <liuhangbin@gmail.com> | |
7 | ||
8 | [ Upstream commit 5384cc0d1a88c27448a6a4e65b8abe6486de8012 ] | |
9 | ||
10 | When getting kernel version via make, the result may be polluted by other | |
11 | output, like directory change info. e.g. | |
12 | ||
13 | $ export MAKEFLAGS="-w" | |
14 | $ make kernelversion | |
15 | make: Entering directory '/home/net' | |
16 | 6.8.0 | |
17 | make: Leaving directory '/home/net' | |
18 | ||
19 | This will distort the reStructuredText output and make latter rst2man | |
20 | failed like: | |
21 | ||
22 | [...] | |
23 | bpf-helpers.rst:20: (WARNING/2) Field list ends without a blank line; unexpected unindent. | |
24 | [...] | |
25 | ||
26 | Using silent mode would help. e.g. | |
27 | ||
28 | $ make -s --no-print-directory kernelversion | |
29 | 6.8.0 | |
30 | ||
31 | Fixes: fd0a38f9c37d ("scripts/bpf: Set version attribute for bpf-helpers(7) man page") | |
32 | Signed-off-by: Michael Hofmann <mhofmann@redhat.com> | |
33 | Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> | |
34 | Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> | |
35 | Reviewed-by: Quentin Monnet <qmo@kernel.org> | |
36 | Acked-by: Alejandro Colomar <alx@kernel.org> | |
37 | Link: https://lore.kernel.org/bpf/20240315023443.2364442-1-liuhangbin@gmail.com | |
38 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
39 | --- | |
40 | scripts/bpf_doc.py | 4 ++-- | |
41 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
42 | ||
43 | diff --git a/scripts/bpf_doc.py b/scripts/bpf_doc.py | |
44 | index 0669bac5e900e..3f899cc7e99a9 100755 | |
45 | --- a/scripts/bpf_doc.py | |
46 | +++ b/scripts/bpf_doc.py | |
47 | @@ -414,8 +414,8 @@ class PrinterRST(Printer): | |
48 | version = version.stdout.decode().rstrip() | |
49 | except: | |
50 | try: | |
51 | - version = subprocess.run(['make', 'kernelversion'], cwd=linuxRoot, | |
52 | - capture_output=True, check=True) | |
53 | + version = subprocess.run(['make', '-s', '--no-print-directory', 'kernelversion'], | |
54 | + cwd=linuxRoot, capture_output=True, check=True) | |
55 | version = version.stdout.decode().rstrip() | |
56 | except: | |
57 | return 'Linux' | |
58 | -- | |
59 | 2.43.0 | |
60 |