diff options
author | Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> | 2024-10-01 13:54:17 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-10-02 19:54:53 -0700 |
commit | d5a24aa9ba9b2677be08613f1bcf97ad8a057069 (patch) | |
tree | 3815bdde944634ebee73004dbe6fd57257bda083 | |
parent | 5c497aa92ec897247730a39c8962cd96644e4f12 (diff) | |
download | meta-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.conf | 2 | ||||
-rw-r--r-- | meta-webserver/recipes-webadmin/netdata/netdata_1.47.1.bb | 27 |
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 @@ | |||
1 | modules: | ||
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 | " |
17 | SRC_URI[sha256sum] = "fb970a4b571ffd542b7d24220ef806a4c1b56c535e0f549a9978860a9f1dcc9c" | 18 | SRC_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 |
25 | NETDATA_ANONYMOUS ??= "enabled" | 26 | NETDATA_ANONYMOUS ??= "enabled" |
26 | 27 | ||
27 | inherit pkgconfig cmake useradd systemd | 28 | inherit pkgconfig useradd systemd |
29 | # Inherit cmake last to use its do_compile task (and not go's) | ||
30 | inherit_defer ${@bb.utils.filter("PACKAGECONFIG", "go", d)} cmake | ||
28 | 31 | ||
29 | TARGET_CC_ARCH:append:libc-musl = " -D_LARGEFILE64_SOURCE" | 32 | TARGET_CC_ARCH:append:libc-musl = " -D_LARGEFILE64_SOURCE" |
30 | 33 | ||
@@ -34,6 +37,15 @@ LIBS:riscv32 = "-latomic" | |||
34 | LIBS:mips = "-latomic" | 37 | LIBS:mips = "-latomic" |
35 | export LIBS | 38 | export LIBS |
36 | 39 | ||
40 | # Skip go.d plugins QA issues | ||
41 | CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'go', \ | ||
42 | '-Wno-aggressive-loop-optimizations -Wno-nonnull -Wno-stringop-overflow' \ | ||
43 | , '', d)}" | ||
44 | INSANE_SKIP:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'go', 'already-stripped buildpaths', '', d)}" | ||
45 | |||
46 | # network is required by go to get dependent packages | ||
47 | do_compile[network] = "1" | ||
48 | |||
37 | #systemd | 49 | #systemd |
38 | SYSTEMD_PACKAGES = "${PN}" | 50 | SYSTEMD_PACKAGES = "${PN}" |
39 | export SERVICE_FILES = "netdata.service netdata-updater.service netdata-updater.timer" | 51 | export SERVICE_FILES = "netdata.service netdata-updater.service netdata-updater.timer" |
@@ -56,11 +68,19 @@ PACKAGECONFIG[xenstat] = "-DENABLE_PLUGIN_XENSTAT=ON,-DENABLE_PLUGIN_XENSTAT=OFF | |||
56 | PACKAGECONFIG[cups] = "-DENABLE_PLUGIN_CUPS=ON,-DENABLE_PLUGIN_CUPS=OFF,cups" | 68 | PACKAGECONFIG[cups] = "-DENABLE_PLUGIN_CUPS=ON,-DENABLE_PLUGIN_CUPS=OFF,cups" |
57 | PACKAGECONFIG[systemd] = "-DENABLE_PLUGIN_SYSTEMD_JOURNAL=ON,-DENABLE_PLUGIN_SYSTEMD_JOURNAL=OFF,systemd" | 69 | PACKAGECONFIG[systemd] = "-DENABLE_PLUGIN_SYSTEMD_JOURNAL=ON,-DENABLE_PLUGIN_SYSTEMD_JOURNAL=OFF,systemd" |
58 | PACKAGECONFIG[docker] = ",,virtual/docker," | 70 | PACKAGECONFIG[docker] = ",,virtual/docker," |
71 | PACKAGECONFIG[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 |
61 | EXTRA_OECMAKE += "-DENABLE_PLUGIN_EBPF=OFF -DENABLE_PLUGIN_GO=OFF -DBUILD_FOR_PACKAGING=${@bb.utils.contains('DISTRO_FEATURES','systemd','ON','OFF',d)} \ | 74 | EXTRA_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 | ||
77 | do_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 | |||
64 | do_install:append() { | 84 | do_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 |