diff mbox series

[meta-oe] fluentbit: Disable upstart scripts

Message ID 20230324013052.50554-1-raj.khem@gmail.com
State New
Headers show
Series [meta-oe] fluentbit: Disable upstart scripts | expand

Commit Message

Khem Raj March 24, 2023, 1:30 a.m. UTC
They are not cross compile friendly as they poke into build host
directories to determine if system is upstart based and it can fail
build on such hosts e.g. ubuntu

If someone is still using upstart with OE then please fix it and send a
better fix upstream to re-enable it here.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...-not-check-for-upstart-on-build-host.patch | 46 +++++++++++++++++++
 .../fluentbit/fluentbit_1.9.7.bb              |  1 +
 2 files changed, 47 insertions(+)
 create mode 100644 meta-oe/recipes-extended/fluentbit/fluentbit/0007-cmake-Do-not-check-for-upstart-on-build-host.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0007-cmake-Do-not-check-for-upstart-on-build-host.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0007-cmake-Do-not-check-for-upstart-on-build-host.patch
new file mode 100644
index 0000000000..71bdd34eeb
--- /dev/null
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0007-cmake-Do-not-check-for-upstart-on-build-host.patch
@@ -0,0 +1,46 @@ 
+From c41653e856d05ed430d22f8b311714ff756a0e0b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 23 Mar 2023 18:05:27 -0700
+Subject: [PATCH] cmake: Do not check for upstart on build host
+
+Some ubuntu distros might have this directory /usr/share/upstart around
+and yocto based distros not using systemd will process this piece of
+code and falsely assume that target supports upstart, which may not be
+true in case of cross-compilation.
+
+This also can end up in configure errors e.g.
+
+| CMake Error at src/CMakeLists.txt:496 (install):
+|   install DIRECTORY given unknown argument "/etc/td-agent-bit/".
+|
+|
+| -- Configuring incomplete, errors occurred!
+
+Upstream-Status: Inappropriate [ Cross-compile Specific ]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/CMakeLists.txt | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index bb30b2a..c63b6d8 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -486,14 +486,6 @@ if(FLB_BINARY)
+       )
+     install(FILES ${FLB_SYSTEMD_SCRIPT} COMPONENT binary DESTINATION ${SYSTEMD_UNITDIR})
+     install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR} COMPONENT binary)
+-  elseif(IS_DIRECTORY /usr/share/upstart)
+-    set(FLB_UPSTART_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.conf")
+-    configure_file(
+-      "${PROJECT_SOURCE_DIR}/init/upstart.in"
+-      ${FLB_UPSTART_SCRIPT}
+-      )
+-    install(FILES ${FLB_UPSTART_SCRIPT} COMPONENT binary DESTINATION /etc/init)
+-    install(DIRECTORY DESTINATION COMPONENT binary ${FLB_INSTALL_CONFDIR})
+   else()
+     # FIXME: should we support Sysv init script ?
+   endif()
+-- 
+2.40.0
+
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.7.bb b/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.7.bb
index f626168421..26238e51f1 100644
--- a/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.7.bb
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.7.bb
@@ -22,6 +22,7 @@  SRC_URI = "https://releases.fluentbit.io/1.9/source-${PV}.tar.gz;subdir=fluent-b
            file://0004-Use-correct-type-to-store-return-from-flb_kv_item_cr.patch \
            file://0005-stackdriver-Fix-return-type-mismatch.patch \
            file://0006-monkey-Fix-TLS-detection-testcase.patch \
+           file://0007-cmake-Do-not-check-for-upstart-on-build-host.patch \
            "
 SRC_URI:remove:x86 = "file://0002-mbedtls-Remove-unused-variable.patch"
 SRC_URI:append:libc-musl = "\