From 51e404af981ab18391ca44d121fba71946abcc17 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Tue, 19 Apr 2022 20:10:52 -0400 Subject: [PATCH] xen-tools: remove unused systemd/sysvinit files The commit [ xen: only package xencommon systemd components if systemd is enabled] attempted to only package init.d scripts for non-systemd systems (and vice-versa for unit files). But the xen-tools builds installs the files uncondtionally, so we can end up with unpackaged files in some configurations. We can test on the init system and removed the unused versions of the init to avoid both packging and runtime issues. Signed-off-by: Bruce Ashfield --- recipes-extended/xen/xen-tools.inc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc index 6bbc8cd8..27972c16 100644 --- a/recipes-extended/xen/xen-tools.inc +++ b/recipes-extended/xen/xen-tools.inc @@ -807,13 +807,24 @@ do_install() { done fi - # fixup default path to qemu-system-i386 - sed -i 's#\(test -z "$QEMU_XEN" && QEMU_XEN=\).*$#\1"/usr/bin/qemu-system-i386"#' ${D}/etc/init.d/xencommons - if [ -e ${D}${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service ]; then sed -i 's#ExecStart=.*qemu-system-i386\(.*\)$#ExecStart=/usr/bin/qemu-system-i386\1#' \ ${D}${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service fi + + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + rm -f ${D}/${sysconfdir}/init.d/xencommons + else + # fixup default path to qemu-system-i386 + sed -i 's#\(test -z "$QEMU_XEN" && QEMU_XEN=\).*$#\1"/usr/bin/qemu-system-i386"#' ${D}/etc/init.d/xencommons + + # remove the uncondiontally installed systemd service files + rm -f ${D}/${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service + rm -f ${D}/${systemd_unitdir}/system/xenconsoled.service + rm -f ${D}/${systemd_unitdir}/system/xen-init-dom0.service + rm -f ${D}/${systemd_unitdir}/system/xenstored.service + rm -f ${D}/${systemd_unitdir}/system/var-lib-xenstored.mount + fi } pkg_postinst:${PN}-volatiles() {