[meta-oe][PATCH 2/2] fluentbit: Disable systemd support when systemd distro feature is disabled


Khem Raj
 

Signed-off-by: Khem Raj <raj.khem@...>
---
...Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch | 2 +-
.../fluentbit/cross-build-init-system-detection.patch | 4 ++--
meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb | 3 ++-
3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0001-Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch
index b90a62ef19..bf4cda08f0 100644
--- a/meta-oe/recipes-extended/fluentbit/fluentbit/0001-Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch
@@ -24,5 +24,5 @@ Signed-off-by: Khem Raj <raj.khem@...>
+ install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION /lib/systemd/system)
+ endif()
install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR})
- elseif(IS_DIRECTORY /usr/share/upstart OR FLB_UPSTART)
+ elseif(FLB_UPSTART)
set(FLB_UPSTART_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.conf")
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch
index a185789992..d3822fc8da 100644
--- a/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch
@@ -12,7 +12,7 @@ Signed-off-by: Khem Raj <raj.kheem@...>

# Detect init system, install upstart, systemd or init.d script
- if(IS_DIRECTORY /lib/systemd/system)
-+ if(IS_DIRECTORY /lib/systemd/system OR FLB_SYSTEMD)
++ if(FLB_SYSTEMD)
set(FLB_SYSTEMD_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.service")
configure_file(
"${PROJECT_SOURCE_DIR}/init/systemd.in"
@@ -21,7 +21,7 @@ Signed-off-by: Khem Raj <raj.kheem@...>
install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION /lib/systemd/system)
install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR})
- elseif(IS_DIRECTORY /usr/share/upstart)
-+ elseif(IS_DIRECTORY /usr/share/upstart OR FLB_UPSTART)
++ elseif(FLB_UPSTART)
set(FLB_UPSTART_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.conf")
configure_file(
"${PROJECT_SOURCE_DIR}/init/upstart.in"
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb b/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb
index e586262a60..b231cc2878 100644
--- a/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb
@@ -48,7 +48,8 @@ EXTRA_OECMAKE += "-DFLB_LUAJIT=Off -DFLB_FILTER_LUA=Off "
# Disable Library and examples
EXTRA_OECMAKE += "-DFLB_SHARED_LIB=Off -DFLB_EXAMPLES=Off "

-EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES','systemd','-DFLB_SYSTEMD=On -DSYSTEMD_DIR=${systemd_system_unitdir}','',d)}"
+# Enable systemd iff systemd is in DISTRO_FEATURES
+EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES','systemd','-DFLB_SYSTEMD=On -DSYSTEMD_DIR=${systemd_system_unitdir}','-DFLB_SYSTEMD=Off',d)}"

EXTRA_OECMAKE:append:riscv64 = " -DFLB_DEPS='atomic'"
EXTRA_OECMAKE:append:riscv32 = " -DFLB_DEPS='atomic'"
--
2.36.0

Join openembedded-devel@lists.openembedded.org to automatically receive all group messages.