diff options
-rw-r--r-- | meta-oe/classes/systemd.bbclass | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass index d8e30f4..db35717 100644 --- a/meta-oe/classes/systemd.bbclass +++ b/meta-oe/classes/systemd.bbclass @@ -58,8 +58,6 @@ def systemd_after_parse(d): for pkg_systemd in systemd_pkgs.split(): service_pkg = 'SYSTEMD_SERVICE' + "_" + pkg_systemd systemd_services = d.getVar(service_pkg, 1) or d.getVar('SYSTEMD_SERVICE', 1) or "" - if systemd_services == "": - raise bb.build.FuncFailed, "\n\n%s inherits systemd but doesn't set SYSTEMD_SERVICE / %s" % (bb_filename, service_pkg) # prepend systemd-packages not already included def systemd_create_package(pkg_systemd): @@ -84,11 +82,11 @@ python __anonymous() { # automatically install all *.service and *.socket supplied in recipe's SRC_URI do_install_append() { - install -d ${D}${systemd_unitdir}/system for service in `find ${WORKDIR} -maxdepth 1 -name '*.service' -o -name '*.socket'` ; do # ensure installing systemd-files only (e.g not avahi *.service) if grep -q '\[Unit\]' $service ; then - install -m 644 $service ${D}${systemd_unitdir}/system + install -d ${D}${systemd_unitdir}/system + install -m 644 $service ${D}${systemd_unitdir}/system fi done } @@ -203,7 +201,8 @@ python populate_packages_prepend () { # run all modifications once when creating package if os.path.exists('${D}'): for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split(): - systemd_generate_package_scripts(pkg_systemd) - systemd_add_rdepends(pkg_systemd) + if d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1) and d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1).strip(): + systemd_generate_package_scripts(pkg_systemd) + systemd_add_rdepends(pkg_systemd) systemd_check_services() } |