1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

Merge pull request #21722 from yuwata/bpf-framework

build: include BPF_FRAMEWORK in version string
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-12-10 17:18:24 +01:00 committed by GitHub
commit 40676ce6f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 135 additions and 116 deletions

View File

@ -194,6 +194,12 @@ const char* const systemd_features =
/* other stuff that doesn't fit above */ /* other stuff that doesn't fit above */
#if BPF_FRAMEWORK
" +BPF_FRAMEWORK"
#else
" -BPF_FRAMEWORK"
#endif
#if HAVE_XKBCOMMON #if HAVE_XKBCOMMON
" +XKBCOMMON" " +XKBCOMMON"
#else #else

View File

@ -1,6 +1,9 @@
# SPDX-License-Identifier: LGPL-2.1+ # SPDX-License-Identifier: LGPL-2.1+
if conf.get('BPF_FRAMEWORK') == 1 if conf.get('BPF_FRAMEWORK') != 1
subdir_done()
endif
clang_flags = [ clang_flags = [
'-Wno-compare-distinct-pointer-types', '-Wno-compare-distinct-pointer-types',
'-O2', '-O2',
@ -58,4 +61,3 @@ if conf.get('BPF_FRAMEWORK') == 1
's', 's',
'@INPUT@' '@INPUT@'
] ]
endif

View File

@ -1,6 +1,9 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
if conf.get('BPF_FRAMEWORK') == 1 if conf.get('BPF_FRAMEWORK') != 1
subdir_done()
endif
restrict_fs_bpf_o_unstripped = custom_target( restrict_fs_bpf_o_unstripped = custom_target(
'restrict-fs.bpf.unstripped.o', 'restrict-fs.bpf.unstripped.o',
input : 'restrict-fs.bpf.c', input : 'restrict-fs.bpf.c',
@ -19,4 +22,3 @@ if conf.get('BPF_FRAMEWORK') == 1
output : 'restrict-fs.skel.h', output : 'restrict-fs.skel.h',
command : skel_h_cmd, command : skel_h_cmd,
capture : true) capture : true)
endif

View File

@ -1,6 +1,9 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
if conf.get('BPF_FRAMEWORK') == 1 if conf.get('BPF_FRAMEWORK') != 1
subdir_done()
endif
restrict_ifaces_bpf_o_unstripped = custom_target( restrict_ifaces_bpf_o_unstripped = custom_target(
'restrict-ifaces.bpf.unstripped.o', 'restrict-ifaces.bpf.unstripped.o',
input : 'restrict-ifaces.bpf.c', input : 'restrict-ifaces.bpf.c',
@ -19,4 +22,3 @@ if conf.get('BPF_FRAMEWORK') == 1
output : 'restrict-ifaces.skel.h', output : 'restrict-ifaces.skel.h',
command : skel_h_cmd, command : skel_h_cmd,
capture : true) capture : true)
endif

View File

@ -1,6 +1,9 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
if conf.get('BPF_FRAMEWORK') == 1 if conf.get('BPF_FRAMEWORK') != 1
subdir_done()
endif
socket_bind_bpf_o_unstripped = custom_target( socket_bind_bpf_o_unstripped = custom_target(
'socket-bind.bpf.unstripped.o', 'socket-bind.bpf.unstripped.o',
input : 'socket-bind.bpf.c', input : 'socket-bind.bpf.c',
@ -19,4 +22,3 @@ if conf.get('BPF_FRAMEWORK') == 1
output : 'socket-bind.skel.h', output : 'socket-bind.skel.h',
command : skel_h_cmd, command : skel_h_cmd,
capture : true) capture : true)
endif

View File

@ -36,7 +36,7 @@ teardown() {
KERNEL_VERSION="$(uname -r)" KERNEL_VERSION="$(uname -r)"
KERNEL_MAJOR="${KERNEL_VERSION%%.*}" KERNEL_MAJOR="${KERNEL_VERSION%%.*}"
KERNEL_MINOR="${KERNEL_VERSION#$KERNEL_MAJOR.}" KERNEL_MINOR="${KERNEL_VERSION#"$KERNEL_MAJOR".}"
KERNEL_MINOR="${KERNEL_MINOR%%.*}" KERNEL_MINOR="${KERNEL_MINOR%%.*}"
MAJOR_REQUIRED=5 MAJOR_REQUIRED=5
@ -47,6 +47,11 @@ if [[ "$KERNEL_MAJOR" -lt $MAJOR_REQUIRED || ("$KERNEL_MAJOR" -eq $MAJOR_REQUIRE
exit 0 exit 0
fi fi
if systemctl --version | grep -q -F "-BPF_FRAMEWORK"; then
echo "bpf-framework is disabled" >>/skipped
exit 0
fi
trap teardown EXIT trap teardown EXIT
setup setup