Skip to contentSkip to conversation

lirc: install systemd units only when using systemd distro feature

PATCH New Khem Raj 1 participant 2 messages Apr 25, 2022

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 lirc: install systemd units only when using systemd distro feature

These files are not needed when init system is not systemd

---
 .../meta-python/recipes-connectivity/lirc/lirc_0.10.1.bb  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
meta-oe/dynamic-layers/meta-python/recipes-connectivity/lirc/lirc_0.10.1.bb +5 -3
index c8929b75a3..f2b751928a 100644
@@ -68,12 +68,14 @@ do_install:append() {
 
     install -m 0755 -d ${D}${sysconfdir}
     install -m 0755 -d ${D}${sysconfdir}/lirc
-    install -m 0755 -d ${D}${systemd_unitdir}/system
     install -m 0755 -d ${D}${libdir}/tmpfiles.d
     install -m 0644 ${WORKDIR}/lircd.conf ${D}${sysconfdir}/lirc/
     install -m 0644 ${WORKDIR}/lirc_options.conf ${D}${sysconfdir}/lirc/
-    install -m 0644 ${WORKDIR}/lircd.service ${D}${systemd_unitdir}/system/
-    install -m 0755 ${WORKDIR}/lircexec.init ${D}${systemd_unitdir}/system/
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        install -m 0755 -d ${D}${systemd_unitdir}/system
+        install -m 0644 ${WORKDIR}/lircd.service ${D}${systemd_unitdir}/system/
+        install -m 0755 ${WORKDIR}/lircexec.init ${D}${systemd_unitdir}/system/
+    fi
     install -m 0644 ${WORKDIR}/lirc.tmpfiles ${D}${libdir}/tmpfiles.d/lirc.conf
     rm -rf ${D}${libdir}/lirc/plugins/*.la
     rmdir ${D}/var/run/lirc ${D}/var/run
Signature · 1 line
2.36.0
author
#1 lore raw

PATCH 2/2 fluentbit: Disable systemd support when systemd distro feature is disabled

---
 ...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(-)
meta-oe/recipes-extended/fluentbit/fluentbit/0001-Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch +1 -1
index b90a62ef19..bf4cda08f0 100644
@@ -24,5 +24,5 @@ Signed-off-by: Khem Raj <[email protected]>
 +        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")
meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch +2 -2
index a185789992..d3822fc8da 100644
@@ -12,7 +12,7 @@ Signed-off-by: Khem Raj <[email protected]>
  
    # 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 <[email protected]>
      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"
meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb +2 -1
index e586262a60..b231cc2878 100644
@@ -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'"
Signature · 1 line
2.36.0