mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-09-23 11:21:11 +00:00
Major version jump (1.x → 2.x series). Key upstream changes:
* 2.x dropped the legacy Netdata Cloud Agent-Cloud-Link (ACLK) and
merged cloud-connectivity into the main binary; ENABLE_ACLK and
ENABLE_CLOUD cmake options removed. OpenSSL and libcurl are now
mandatory build dependencies (no longer optional via PACKAGECONFIG).
* Improved database engine, new collectors (systemd-units, OTel,
scripts plugin), and expanded Go plugin with SNMP overhaul.
* 2.10.x stabilization: fix ZFS-related crashes, eBPF shared-memory
pool leak, SNMP counter wrapping, database engine memory safety.
* 2.10.4: larger patch for stability, memory safety, and crash
resilience across database engine, streaming, and collectors;
backports new macOS hardware sensor collectors.
Recipe changes:
* Add curl and openssl to mandatory DEPENDS (both now REQUIRED by
cmake); remove PACKAGECONFIG[openssl] and PACKAGECONFIG[cloud].
* Remove webui_v0/v1/v2 PACKAGECONFIG entries and associated
do_install block (the webui architecture changed in 2.x).
* Remove -DENABLE_ACLK=OFF from EXTRA_OECMAKE (option no longer
exists); keep -DENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE=OFF.
* Refresh 0002-Do-not-hardcode-systemd-unit-directories.patch for
2.10.4 (the BUILD_FOR_PACKAGING/systemd service install blocks
shifted ~1119 lines; same substitution preserved).
* 2.x vendors its own libsensors copy which needs flex/bison to
generate its config lexer/parser at build time; add flex-native
and bison-native to DEPENDS.
* Protobuf detection now runs unconditionally (used by several 2.x
exporters/collectors even with the remote-write exporter disabled);
add protobuf and protobuf-native to DEPENDS and point cmake at the
native protoc via Protobuf_PROTOC_EXECUTABLE.
* Disable several 2.x features that reach out to the network at
configure time and cannot work in an offline build:
- ENABLE_PLUGIN_OTEL / ENABLE_PLUGIN_OTEL_SIGNAL_VIEWER (pull in
Rust/Corrosion via CMake FetchContent)
- ENABLE_PLUGIN_SCRIPTS (requires Go, same as ENABLE_PLUGIN_GO)
- ENABLE_ML (FetchContent-downloads dlib)
- ENABLE_LIBBACKTRACE (ExternalProject-downloads libbacktrace)
- ENABLE_DASHBOARD, now exposed as PACKAGECONFIG[dashboard] and
off by default (the local agent dashboard isn't shipped in the
release tarball; enabling it makes cmake fetch it from
app.netdata.cloud at configure time)
* BUILD_FOR_PACKAGING=ON now also installs sysusers.d/tmpfiles.d
snippets under ${nonarch_libdir}; remove them in do_install since
user creation is handled by useradd.bbclass and tmpfiles by our own
netdata-volatiles.conf, avoiding an "installed but not shipped" QA
failure from duplicate/unmanaged files.
* Fix three new-in-2.x reproducibility leaks that embed host build
paths into the packages (buildpaths QA, an error in oe-core's default
ERROR_QA):
- Add 0003-Do-not-record-the-configure-command-line-in-the-binar.patch:
2.x bakes the full cmake invocation into config.h for
"netdata -W buildinfo"; the collected flags include --sysroot= and
-ffile-prefix-map= and so leak ${WORKDIR} into the binary.
- Add 0004-libsensors-do-not-emit-line-directives-in-generated-s.patch:
pass bison -l / flex -L so the generated conf-parse.[ch] and
conf-lex.c do not carry absolute #line paths (these live in file
contents, so -ffile-prefix-map cannot rewrite them).
- Remove the shipped build-info-cmake-cache.gz in do_install: it is a
gzipped CMakeCache.txt kept only for buildinfo reporting and is full
of host paths.
Verified with buildpaths promoted back to ERROR_QA: netdata builds and
packages with no buildpaths diagnostics and no /home path remains
anywhere under the package tree.
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
169 lines
7.4 KiB
BlitzBasic
169 lines
7.4 KiB
BlitzBasic
SUMMARY = "Real-time performance monitoring"
|
|
DESCRIPTION = "Netdata is high-fidelity infrastructure monitoring and troubleshooting. \
|
|
Open-source, free, preconfigured, opinionated, and always real-time."
|
|
HOMEPAGE = "https://github.com/netdata/netdata/"
|
|
LICENSE = "GPL-3.0-only"
|
|
LIC_FILES_CHKSUM = "file://LICENSE;md5=fc9b848046ef54b5eaee6071947abd24"
|
|
|
|
DEPENDS += "\
|
|
bison-native \
|
|
curl \
|
|
flex-native \
|
|
json-c \
|
|
libuv \
|
|
libyaml \
|
|
lz4 \
|
|
openssl \
|
|
protobuf \
|
|
protobuf-native \
|
|
util-linux \
|
|
zlib \
|
|
"
|
|
|
|
SRC_URI = "\
|
|
https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BPN}-v${PV}.tar.gz \
|
|
file://0002-Do-not-hardcode-systemd-unit-directories.patch \
|
|
file://0003-Do-not-record-the-configure-command-line-in-the-binar.patch \
|
|
file://0004-libsensors-do-not-emit-line-directives-in-generated-s.patch \
|
|
file://netdata.conf \
|
|
file://netdata-volatiles.conf \
|
|
${@bb.utils.contains('PACKAGECONFIG', 'go', 'file://go.d.conf', '', d)} \
|
|
"
|
|
SRC_URI[sha256sum] = "d1ae949863925d626b1d42a53000bcca2c239718e0b0ddc6a3f3f5029b21cdfe"
|
|
|
|
UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/tags"
|
|
UPSTREAM_CHECK_REGEX = "${BPN}/releases/tag/v(?P<pver>(?!1\.99)\d+(?:\.\d+)*)"
|
|
|
|
S = "${UNPACKDIR}/${BPN}-v${PV}"
|
|
|
|
# Stop sending anonymous statistics to Google Analytics
|
|
NETDATA_ANONYMOUS ??= "enabled"
|
|
|
|
inherit pkgconfig useradd systemd
|
|
# Inherit cmake last to use its do_compile task (and not go's)
|
|
inherit_defer ${@bb.utils.filter("PACKAGECONFIG", "go", d)} cmake
|
|
|
|
TARGET_CC_ARCH:append:libc-musl = " -D_LARGEFILE64_SOURCE"
|
|
|
|
LIBS:toolchain-clang:x86 = "-latomic"
|
|
LIBS:riscv64 = "-latomic"
|
|
LIBS:riscv32 = "-latomic"
|
|
LIBS:mips = "-latomic"
|
|
export LIBS
|
|
|
|
# Skip go.d plugins QA issues
|
|
CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'go', \
|
|
'-Wno-aggressive-loop-optimizations -Wno-nonnull -Wno-stringop-overflow' \
|
|
, '', d)}"
|
|
INSANE_SKIP:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'go', 'already-stripped buildpaths', '', d)}"
|
|
|
|
# network is required by go to get dependent packages
|
|
do_compile[network] = "${@bb.utils.contains('PACKAGECONFIG', 'go', '1', '0', d)}"
|
|
|
|
#systemd
|
|
SYSTEMD_PACKAGES = "${PN}"
|
|
export SERVICE_FILES = "netdata.service netdata-updater.service netdata-updater.timer"
|
|
SYSTEMD_SERVICE:${PN} = "${SERVICE_FILES}"
|
|
SYSTEMD_AUTO_ENABLE:${PN} = "enable"
|
|
|
|
#User specific
|
|
USERADD_PACKAGES = "${PN}"
|
|
USERADD_PARAM:${PN} = "--system --no-create-home --home-dir ${localstatedir}/run/netdata \
|
|
${@bb.utils.contains('PACKAGECONFIG','docker','--groups docker','',d)} --user-group netdata"
|
|
|
|
PACKAGECONFIG ??= "freeipmi ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
|
|
PACKAGECONFIG[brotli] = ",,brotli"
|
|
PACKAGECONFIG[freeipmi] = "-DENABLE_PLUGIN_FREEIPMI=ON,-DENABLE_PLUGIN_FREEIPMI=OFF,freeipmi"
|
|
PACKAGECONFIG[nfacct] = "-DENABLE_PLUGIN_NFACCT=ON,-DENABLE_PLUGIN_NFACCT=OFF,libmnl"
|
|
# needs meta-virtualization
|
|
PACKAGECONFIG[xenstat] = "-DENABLE_PLUGIN_XENSTAT=ON,-DENABLE_PLUGIN_XENSTAT=OFF,xen-tools"
|
|
PACKAGECONFIG[cups] = "-DENABLE_PLUGIN_CUPS=ON,-DENABLE_PLUGIN_CUPS=OFF,cups"
|
|
PACKAGECONFIG[systemd] = "-DENABLE_PLUGIN_SYSTEMD_JOURNAL=ON,-DENABLE_PLUGIN_SYSTEMD_JOURNAL=OFF,systemd"
|
|
PACKAGECONFIG[docker] = ",,virtual/docker, virtual/docker"
|
|
PACKAGECONFIG[go] = "-DENABLE_PLUGIN_GO=ON, -DENABLE_PLUGIN_GO=OFF"
|
|
# The local agent dashboard is not shipped in the release tarball; enabling it
|
|
# makes CMake download https://app.netdata.cloud/agent.tar.gz at configure
|
|
# time, which cannot work in an offline build. Off by default.
|
|
PACKAGECONFIG[dashboard] = "-DENABLE_DASHBOARD=ON,-DENABLE_DASHBOARD=OFF"
|
|
|
|
# ebpf doesn't compile (or detect) the cross compilation well.
|
|
# Several 2.x features fetch sources at configure time, which cannot work in
|
|
# an offline build, so they are disabled here:
|
|
# - ENABLE_PLUGIN_OTEL / ENABLE_PLUGIN_OTEL_SIGNAL_VIEWER pull Rust/Corrosion
|
|
# via CMake FetchContent.
|
|
# - ENABLE_PLUGIN_SCRIPTS requires Go (as does ENABLE_PLUGIN_GO).
|
|
# - ENABLE_ML FetchContent-downloads dlib.
|
|
# - ENABLE_LIBBACKTRACE ExternalProject-downloads libbacktrace.
|
|
# Protobuf is detected unconditionally and needs the native protoc.
|
|
EXTRA_OECMAKE += "-DENABLE_PLUGIN_EBPF=OFF \
|
|
-DENABLE_PLUGIN_OTEL=OFF -DENABLE_PLUGIN_OTEL_SIGNAL_VIEWER=OFF \
|
|
-DENABLE_PLUGIN_SCRIPTS=OFF \
|
|
-DENABLE_ML=OFF \
|
|
-DENABLE_LIBBACKTRACE=OFF \
|
|
-DProtobuf_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \
|
|
-DBUILD_FOR_PACKAGING=${@bb.utils.contains('DISTRO_FEATURES','systemd','ON','OFF',d)} \
|
|
-DENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE=OFF -DCMAKE_INSTALL_PREFIX='${base_prefix}'"
|
|
|
|
do_compile:append() {
|
|
# Go dependencies are protected with read-only permissions, but would prevent cleaning
|
|
if ${@bb.utils.contains('PACKAGECONFIG', 'go', 'true', 'false', d)}; then
|
|
chmod -R a+w ${B}/pkg
|
|
fi
|
|
}
|
|
|
|
do_install:append() {
|
|
#set S UID for plugins
|
|
chown root:netdata ${D}${libexecdir}/netdata/plugins.d/apps.plugin
|
|
chmod 4750 ${D}${libexecdir}/netdata/plugins.d/apps.plugin
|
|
rm -rf ${D}/${localstatedir}/
|
|
|
|
if ${@bb.utils.contains('PACKAGECONFIG', 'xenstat', 'true', 'false', d)}; then
|
|
# Set S UID for xenstat plugin
|
|
chown root:netdata ${D}${libexecdir}/netdata/plugins.d/xenstat.plugin
|
|
chmod 4750 ${D}${libexecdir}/netdata/plugins.d/xenstat.plugin
|
|
fi
|
|
|
|
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
|
|
# Install systemd unit files
|
|
install -Dm 0644 ${UNPACKDIR}/netdata-volatiles.conf ${D}${sysconfdir}/tmpfiles.d/netdata.conf
|
|
fi
|
|
|
|
# Install default netdata.conf
|
|
install -d ${D}${sysconfdir}/netdata
|
|
install -m 0644 ${UNPACKDIR}/netdata.conf ${D}${sysconfdir}/netdata/
|
|
if ${@bb.utils.contains('PACKAGECONFIG', 'go', 'true', 'false', d)}; then
|
|
install -m 0644 ${UNPACKDIR}/go.d.conf ${D}${sysconfdir}/netdata/
|
|
fi
|
|
sed -i -e 's,@@datadir,${datadir},g' ${D}${sysconfdir}/netdata/netdata.conf
|
|
sed -i -e 's,@@libdir,${libdir},g' ${D}${sysconfdir}/netdata/netdata.conf
|
|
sed -i -e 's,@@libexecdir,${libexecdir},g' ${D}${sysconfdir}/netdata/netdata.conf
|
|
sed -i -e 's,@@localstatedir,${localstatedir},g' ${D}${sysconfdir}/netdata/netdata.conf
|
|
sed -i -e 's,@@sysconfdir,${sysconfdir},g' ${D}${sysconfdir}/netdata/netdata.conf
|
|
|
|
if [ "${NETDATA_ANONYMOUS}" = "enabled" ]; then
|
|
touch ${D}${sysconfdir}/netdata/.opt-out-from-anonymous-statistics
|
|
fi
|
|
|
|
install --group netdata --owner netdata --directory ${D}${localstatedir}/cache/netdata
|
|
install --group netdata --owner netdata --directory ${D}${localstatedir}/lib/netdata
|
|
|
|
# BUILD_FOR_PACKAGING installs its own sysusers.d/tmpfiles.d snippets, but
|
|
# user creation is handled by useradd.bbclass and tmpfiles by our own
|
|
# netdata-volatiles.conf above, so drop the upstream ones to avoid
|
|
# shipping duplicate/unmanaged files.
|
|
rm -rf ${D}${nonarch_libdir}/sysusers.d ${D}${nonarch_libdir}/tmpfiles.d
|
|
|
|
# 2.x ships a gzipped copy of CMakeCache.txt purely so that
|
|
# "netdata -W buildinfo" can report it; it is full of host build paths.
|
|
# It carries no runtime value in a cross build, so drop it.
|
|
rm -f ${D}${datadir}/netdata/build-info-cmake-cache.gz
|
|
}
|
|
|
|
FILES:${PN} += "\
|
|
${localstatedir}/cache/netdata/ \
|
|
${localstatedir}/lib/netdata/ \
|
|
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/journald@netdata.conf.d', '', d)} \
|
|
"
|
|
|
|
RDEPENDS:${PN} = "bash python3-core zlib"
|