From c857c880f31a89b7857bf01f1f48227c41bf8a93 Mon Sep 17 00:00:00 2001 From: Vladimir Kobal Date: Mon, 31 Aug 2020 16:01:59 +0300 Subject: Don't install eBPF plugin components when they shouldn't be installed (#9844) --- configure.ac | 7 +++++++ netdata-installer.sh | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b3ff4ba785..190f3cd50a 100644 --- a/configure.ac +++ b/configure.ac @@ -167,6 +167,12 @@ AC_ARG_ENABLE( , [enable_jsonc="detect"] ) +AC_ARG_ENABLE( + [ebpf], + [AS_HELP_STRING([--disable-ebpf], [Disable eBPF support @<:@default autodetect@:>@])], + , + [enable_ebpf="detect"] +) # ----------------------------------------------------------------------------- # Check if cloud is enabled and if the functionality is available @@ -968,6 +974,7 @@ AC_CHECK_FILE( AC_MSG_CHECKING([if ebpf.plugin should be enabled]) if test "${build_target}" = "linux" -a \ + "${enable_ebpf}" != "no" -a \ "${have_libelf}" = "yes" -a \ "${have_bpf}" = "yes" -a \ "${have_libbpf}" = "yes"; then diff --git a/netdata-installer.sh b/netdata-installer.sh index eba7f1be9c..e7392f472c 100755 --- a/netdata-installer.sh +++ b/netdata-installer.sh @@ -299,7 +299,7 @@ while [ -n "${1}" ]; do "--disable-telemetry") NETDATA_DISABLE_TELEMETRY=1 ;; "--disable-go") NETDATA_DISABLE_GO=1 ;; "--enable-ebpf") NETDATA_DISABLE_EBPF=0 ;; - "--disable-ebpf") NETDATA_DISABLE_EBPF=1 ;; + "--disable-ebpf") NETDATA_DISABLE_EBPF=1 NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--disable-ebpf/} --disable-ebpf" ;; "--disable-cloud") if [ -n "${NETDATA_REQUIRE_CLOUD}" ]; then echo "Cloud explicitly enabled, ignoring --disable-cloud." @@ -1435,6 +1435,12 @@ should_install_ebpf() { return 1 fi + if [ "$(uname -s)" != "Linux" ]; then + run_failed "Currently eBPF is only supported on Linux." + defer_error "Currently eBPF is only supported on Linux." + return 1 + fi + # Check Kernel Config if ! run "${INSTALLER_DIR}"/packaging/check-kernel-config.sh; then echo >&2 "Warning: Kernel unsupported or missing required config (eBPF may not work on your system)" -- cgit v1.2.3