summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>2024-10-01 13:54:17 +0200
committerKhem Raj <raj.khem@gmail.com>2024-10-02 19:54:53 -0700
commitd5a24aa9ba9b2677be08613f1bcf97ad8a057069 (patch)
tree3815bdde944634ebee73004dbe6fd57257bda083
parent5c497aa92ec897247730a39c8962cd96644e4f12 (diff)
downloadmeta-openembedded-d5a24aa9ba9b2677be08613f1bcf97ad8a057069.tar.gz
netdata: add go plugin PACKAGECONFIG
Many netdata plugins are written in go, add a PACKAGECONFIG to enable them. Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-webserver/recipes-webadmin/netdata/netdata/go.d.conf2
-rw-r--r--meta-webserver/recipes-webadmin/netdata/netdata_1.47.1.bb27
2 files changed, 27 insertions, 2 deletions
diff --git a/meta-webserver/recipes-webadmin/netdata/netdata/go.d.conf b/meta-webserver/recipes-webadmin/netdata/netdata/go.d.conf
new file mode 100644
index 0000000000..e0b3a0b18c
--- /dev/null
+++ b/meta-webserver/recipes-webadmin/netdata/netdata/go.d.conf
@@ -0,0 +1,2 @@
1modules:
2 logind: yes
diff --git a/meta-webserver/recipes-webadmin/netdata/netdata_1.47.1.bb b/meta-webserver/recipes-webadmin/netdata/netdata_1.47.1.bb
index ef8e05c8d5..33a4299dde 100644
--- a/meta-webserver/recipes-webadmin/netdata/netdata_1.47.1.bb
+++ b/meta-webserver/recipes-webadmin/netdata/netdata_1.47.1.bb
@@ -13,6 +13,7 @@ SRC_URI = " \
13 file://0002-Do-not-hardcode-systemd-unit-directories.patch \ 13 file://0002-Do-not-hardcode-systemd-unit-directories.patch \
14 file://netdata.conf \ 14 file://netdata.conf \
15 file://netdata-volatiles.conf \ 15 file://netdata-volatiles.conf \
16 ${@bb.utils.contains('PACKAGECONFIG', 'go', 'file://go.d.conf', '', d)} \
16 " 17 "
17SRC_URI[sha256sum] = "fb970a4b571ffd542b7d24220ef806a4c1b56c535e0f549a9978860a9f1dcc9c" 18SRC_URI[sha256sum] = "fb970a4b571ffd542b7d24220ef806a4c1b56c535e0f549a9978860a9f1dcc9c"
18 19
@@ -24,7 +25,9 @@ S = "${WORKDIR}/${BPN}-v${PV}"
24# Stop sending anonymous statistics to Google Analytics 25# Stop sending anonymous statistics to Google Analytics
25NETDATA_ANONYMOUS ??= "enabled" 26NETDATA_ANONYMOUS ??= "enabled"
26 27
27inherit pkgconfig cmake useradd systemd 28inherit pkgconfig useradd systemd
29# Inherit cmake last to use its do_compile task (and not go's)
30inherit_defer ${@bb.utils.filter("PACKAGECONFIG", "go", d)} cmake
28 31
29TARGET_CC_ARCH:append:libc-musl = " -D_LARGEFILE64_SOURCE" 32TARGET_CC_ARCH:append:libc-musl = " -D_LARGEFILE64_SOURCE"
30 33
@@ -34,6 +37,15 @@ LIBS:riscv32 = "-latomic"
34LIBS:mips = "-latomic" 37LIBS:mips = "-latomic"
35export LIBS 38export LIBS
36 39
40# Skip go.d plugins QA issues
41CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'go', \
42 '-Wno-aggressive-loop-optimizations -Wno-nonnull -Wno-stringop-overflow' \
43 , '', d)}"
44INSANE_SKIP:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'go', 'already-stripped buildpaths', '', d)}"
45
46# network is required by go to get dependent packages
47do_compile[network] = "1"
48
37#systemd 49#systemd
38SYSTEMD_PACKAGES = "${PN}" 50SYSTEMD_PACKAGES = "${PN}"
39export SERVICE_FILES = "netdata.service netdata-updater.service netdata-updater.timer" 51export SERVICE_FILES = "netdata.service netdata-updater.service netdata-updater.timer"
@@ -56,11 +68,19 @@ PACKAGECONFIG[xenstat] = "-DENABLE_PLUGIN_XENSTAT=ON,-DENABLE_PLUGIN_XENSTAT=OFF
56PACKAGECONFIG[cups] = "-DENABLE_PLUGIN_CUPS=ON,-DENABLE_PLUGIN_CUPS=OFF,cups" 68PACKAGECONFIG[cups] = "-DENABLE_PLUGIN_CUPS=ON,-DENABLE_PLUGIN_CUPS=OFF,cups"
57PACKAGECONFIG[systemd] = "-DENABLE_PLUGIN_SYSTEMD_JOURNAL=ON,-DENABLE_PLUGIN_SYSTEMD_JOURNAL=OFF,systemd" 69PACKAGECONFIG[systemd] = "-DENABLE_PLUGIN_SYSTEMD_JOURNAL=ON,-DENABLE_PLUGIN_SYSTEMD_JOURNAL=OFF,systemd"
58PACKAGECONFIG[docker] = ",,virtual/docker," 70PACKAGECONFIG[docker] = ",,virtual/docker,"
71PACKAGECONFIG[go] = "-DENABLE_PLUGIN_GO=ON, -DENABLE_PLUGIN_GO=OFF"
59 72
60# ebpf doesn't compile (or detect) the cross compilation well 73# ebpf doesn't compile (or detect) the cross compilation well
61EXTRA_OECMAKE += "-DENABLE_PLUGIN_EBPF=OFF -DENABLE_PLUGIN_GO=OFF -DBUILD_FOR_PACKAGING=${@bb.utils.contains('DISTRO_FEATURES','systemd','ON','OFF',d)} \ 74EXTRA_OECMAKE += "-DENABLE_PLUGIN_EBPF=OFF -DBUILD_FOR_PACKAGING=${@bb.utils.contains('DISTRO_FEATURES','systemd','ON','OFF',d)} \
62 -DENABLE_ACLK=OFF -DENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE=OFF -DCMAKE_INSTALL_PREFIX='${base_prefix}'" 75 -DENABLE_ACLK=OFF -DENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE=OFF -DCMAKE_INSTALL_PREFIX='${base_prefix}'"
63 76
77do_compile:append() {
78 # Go dependencies are protected with read-only permissions, but would prevent cleaning
79 if ${@bb.utils.contains('PACKAGECONFIG', 'go', 'true', 'false', d)}; then
80 chmod -R a+w ${B}/pkg
81 fi
82}
83
64do_install:append() { 84do_install:append() {
65 #set S UID for plugins 85 #set S UID for plugins
66 chmod 4755 ${D}${libexecdir}/netdata/plugins.d/apps.plugin 86 chmod 4755 ${D}${libexecdir}/netdata/plugins.d/apps.plugin
@@ -74,6 +94,9 @@ do_install:append() {
74 # Install default netdata.conf 94 # Install default netdata.conf
75 install -d ${D}${sysconfdir}/netdata 95 install -d ${D}${sysconfdir}/netdata
76 install -m 0644 ${UNPACKDIR}/netdata.conf ${D}${sysconfdir}/netdata/ 96 install -m 0644 ${UNPACKDIR}/netdata.conf ${D}${sysconfdir}/netdata/
97 if ${@bb.utils.contains('PACKAGECONFIG', 'go', 'true', 'false', d)}; then
98 install -m 0644 ${UNPACKDIR}/go.d.conf ${D}${sysconfdir}/netdata/
99 fi
77 sed -i -e 's,@@datadir,${datadir},g' ${D}${sysconfdir}/netdata/netdata.conf 100 sed -i -e 's,@@datadir,${datadir},g' ${D}${sysconfdir}/netdata/netdata.conf
78 sed -i -e 's,@@libdir,${libdir},g' ${D}${sysconfdir}/netdata/netdata.conf 101 sed -i -e 's,@@libdir,${libdir},g' ${D}${sysconfdir}/netdata/netdata.conf
79 sed -i -e 's,@@libexecdir,${libexecdir},g' ${D}${sysconfdir}/netdata/netdata.conf 102 sed -i -e 's,@@libexecdir,${libexecdir},g' ${D}${sysconfdir}/netdata/netdata.conf