mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-11 04:49:58 +00:00
systemd.bbclass: allow recipe to inherit systemd with empty SYSTEMD_SERVICE
* I have use case where common recipe does inherit systemd and only some BSP's are bbappending some SERVICEs to it * install was moved intentionaly, so that /lib/systemd/system is not created if there is no .service file (causing QA Warning about unpackaged dir) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
@@ -58,8 +58,6 @@ def systemd_after_parse(d):
|
|||||||
for pkg_systemd in systemd_pkgs.split():
|
for pkg_systemd in systemd_pkgs.split():
|
||||||
service_pkg = 'SYSTEMD_SERVICE' + "_" + pkg_systemd
|
service_pkg = 'SYSTEMD_SERVICE' + "_" + pkg_systemd
|
||||||
systemd_services = d.getVar(service_pkg, 1) or d.getVar('SYSTEMD_SERVICE', 1) or ""
|
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
|
# prepend systemd-packages not already included
|
||||||
def systemd_create_package(pkg_systemd):
|
def systemd_create_package(pkg_systemd):
|
||||||
@@ -84,11 +82,11 @@ python __anonymous() {
|
|||||||
|
|
||||||
# automatically install all *.service and *.socket supplied in recipe's SRC_URI
|
# automatically install all *.service and *.socket supplied in recipe's SRC_URI
|
||||||
do_install_append() {
|
do_install_append() {
|
||||||
install -d ${D}${systemd_unitdir}/system
|
|
||||||
for service in `find ${WORKDIR} -maxdepth 1 -name '*.service' -o -name '*.socket'` ; do
|
for service in `find ${WORKDIR} -maxdepth 1 -name '*.service' -o -name '*.socket'` ; do
|
||||||
# ensure installing systemd-files only (e.g not avahi *.service)
|
# ensure installing systemd-files only (e.g not avahi *.service)
|
||||||
if grep -q '\[Unit\]' $service ; then
|
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
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -203,7 +201,8 @@ python populate_packages_prepend () {
|
|||||||
# run all modifications once when creating package
|
# run all modifications once when creating package
|
||||||
if os.path.exists('${D}'):
|
if os.path.exists('${D}'):
|
||||||
for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split():
|
for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split():
|
||||||
systemd_generate_package_scripts(pkg_systemd)
|
if d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1) and d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1).strip():
|
||||||
systemd_add_rdepends(pkg_systemd)
|
systemd_generate_package_scripts(pkg_systemd)
|
||||||
|
systemd_add_rdepends(pkg_systemd)
|
||||||
systemd_check_services()
|
systemd_check_services()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user