From fa7ee06bd615e21f48c42668f1d161c16741b9a9 Mon Sep 17 00:00:00 2001 From: Jan Vermaete Date: Sun, 3 Nov 2024 15:30:38 +0100 Subject: [PATCH] netdata: WebUI choice between all (default), v0, v1 or v2 Added a PACKAGECONFIG to select the version of the WebUI to be installed. When not set, all versions (v0, v1 and v2) will be installed. What is the default of Netdata. Enabling only the v1 version makes the package 25% smaller. More info: https://github.com/netdata/netdata/issues/15640#issuecomment-1946041083 Signed-off-by: Jan Vermaete Signed-off-by: Khem Raj --- .../netdata/netdata_1.47.5.bb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/meta-webserver/recipes-webadmin/netdata/netdata_1.47.5.bb b/meta-webserver/recipes-webadmin/netdata/netdata_1.47.5.bb index 88dbe19e47..7693335dac 100644 --- a/meta-webserver/recipes-webadmin/netdata/netdata_1.47.5.bb +++ b/meta-webserver/recipes-webadmin/netdata/netdata_1.47.5.bb @@ -75,6 +75,10 @@ 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" +# WebUI (packageconfig not set: v0, v1 & v2) +PACKAGECONFIG[webui_v0] = ",,,,,webui_v1 webui_v2" +PACKAGECONFIG[webui_v1] = ",,,,,webui_v0 webui_v2" +PACKAGECONFIG[webui_v2] = ",,,,,webui_v0 webui_v1" # ebpf doesn't compile (or detect) the cross compilation well EXTRA_OECMAKE += "-DENABLE_PLUGIN_EBPF=OFF -DBUILD_FOR_PACKAGING=${@bb.utils.contains('DISTRO_FEATURES','systemd','ON','OFF',d)} \ @@ -123,6 +127,22 @@ do_install:append() { install --group netdata --owner netdata --directory ${D}${localstatedir}/cache/netdata install --group netdata --owner netdata --directory ${D}${localstatedir}/lib/netdata + # webUI + if "${@bb.utils.contains('PACKAGECONFIG', 'webui_v0', 'true', 'false', d)}"; then + rm -rf ${D}${datadir}/netdata/web/v1 + rm -rf ${D}${datadir}/netdata/web/v2 + install -m 0644 ${D}${datadir}/netdata/web/v0/index.html ${D}${datadir}/netdata/web/ + fi + if "${@bb.utils.contains('PACKAGECONFIG', 'webui_v1', 'true', 'false', d)}"; then + rm -rf ${D}${datadir}/netdata/web/v0 + rm -rf ${D}${datadir}/netdata/web/v2 + install -m 0644 ${D}${datadir}/netdata/web/v1/index.html ${D}${datadir}/netdata/web/ + fi + if "${@bb.utils.contains('PACKAGECONFIG', 'webui_v2', 'true', 'false', d)}"; then + rm -rf ${D}${datadir}/netdata/web/v0 + rm -rf ${D}${datadir}/netdata/web/v1 + install -m 0644 ${D}${datadir}/netdata/web/v2/index.html ${D}${datadir}/netdata/web/ + fi chown -R netdata:netdata ${D}${datadir}/netdata/web }