From eff667c136570fa52ed51e2c8d3c38502272b4fb Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Fri, 9 Dec 2016 17:31:23 +0100 Subject: Make systemd optional --- recipes-sota/ostree/ostree_git.bb | 9 +++++---- recipes-sota/rvi-sota-client/rvi-sota-client_git.bb | 8 +++++--- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'recipes-sota') diff --git a/recipes-sota/ostree/ostree_git.bb b/recipes-sota/ostree/ostree_git.bb index d444669..b6adf9b 100644 --- a/recipes-sota/ostree/ostree_git.bb +++ b/recipes-sota/ostree/ostree_git.bb @@ -14,7 +14,9 @@ S = "${WORKDIR}/git" BBCLASSEXTEND = "native" -DEPENDS += "attr libarchive glib-2.0 pkgconfig gpgme libgsystem fuse libsoup-2.4 e2fsprogs systemd" +DEPENDS += "attr libarchive glib-2.0 pkgconfig gpgme libgsystem fuse libsoup-2.4 e2fsprogs" +DEPENDS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}" + DEPENDS_remove_class-native = "systemd-native" RDEPENDS_${PN} = "python util-linux-libuuid util-linux-libblkid util-linux-libmount libcap xz os-release" @@ -25,7 +27,7 @@ EXTRA_OEMAKE = "CFLAGS='-g'" EXTRA_OECONF_append_class-native = " --enable-wrpseudo-compat" SYSTEMD_REQUIRED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}" -SYSTEMD_REQUIRED_class-native = "" +SYSTEMD_REQUIRED_class-native = "false" SYSTEMD_SERVICE_${PN} = "ostree-prepare-root.service ostree-remount.service" SYSTEMD_SERVICE_${PN}_class-native = "" @@ -52,8 +54,7 @@ do_compile_prepend() { export SYSTEMD_REQUIRED do_install_append() { - if [ -n ${SYSTEMD_REQUIRED} ]; then - install -p -D ${S}/src/boot/ostree-prepare-root.service ${D}${systemd_unitdir}/system/ostree-prepare-root.service + if [ "$SYSTEMD_REQUIRED" == "true" ]; then install -p -D ${S}/src/boot/ostree-remount.service ${D}${systemd_unitdir}/system/ostree-remount.service fi } diff --git a/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb b/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb index 9a7ec10..a9a9c2c 100644 --- a/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb +++ b/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb @@ -21,7 +21,7 @@ FILES_${PN} = " \ ${bindir}/system_info.sh \ ${sysconfdir}/sota_client.version \ ${sysconfdir}/sota_certificates \ - ${systemd_unitdir}/system/sota_client.service \ + ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/sota_client.service', '', d)} \ ${bindir}/sota_ostree.sh \ " @@ -134,8 +134,10 @@ do_install() { install -m 0755 run/system_info.sh ${D}${bindir} install -m 0755 run/sota_ostree.sh ${D}${bindir} - install -d ${D}${systemd_unitdir}/system - install -c ${S}/run/sota_client.service ${D}${systemd_unitdir}/system + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${systemd_unitdir}/system + install -c ${S}/run/sota_client.service ${D}${systemd_unitdir}/system + fi install -d ${D}${sysconfdir} install -c ${S}/run/sota_certificates ${D}${sysconfdir} -- cgit v1.2.3-54-g00ecf