From f18762a6d13d22c5b6137d4818cb229ce32316bf Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 25 Apr 2022 11:54:23 -0700 Subject: fluentbit: Disable systemd support when systemd distro feature is disabled Signed-off-by: Khem Raj (cherry picked from commit f9a935ac8e0129fa91279ec8bff9f8ced93734f2) Signed-off-by: Armin Kuster --- .../0001-Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch | 2 +- .../fluentbit/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 + 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 # 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 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'" -- cgit v1.2.3-54-g00ecf