mirror of
git://git.yoctoproject.org/meta-virtualization.git
synced 2025-07-19 12:50:22 +02:00
libvirt: fix do_install with usrmerge
* meson build uses these paths: ./src/meson.build: systemd_unit_dir = prefix / 'lib' / 'systemd' / 'system' ./tools/meson.build: install_dir: prefix / 'lib' / 'systemd' / 'system', with usrmerge it fails with: sed: can't read TOPDIR/tmp-glibc/work/core2-64-oe-linux/libvirt/7.2.0-r0/image//usr/lib/systemd/system/libvirtd.service: No such file or directory because systemd_unitdir and systemd_system_unitdir are different with and without usrmerge in DISTRO_FEATURES: env.libvirt-without-usrmerge:export systemd_unitdir="/lib/systemd" env.libvirt-with-usrmerge:export systemd_unitdir="/usr/lib/systemd" env.libvirt-without-usrmerge:export systemd_system_unitdir="/lib/systemd/system" env.libvirt-with-usrmerge:export systemd_system_unitdir="/usr/lib/systemd/system" * set -Dinit_script to none when systemd isn't used instead of deleting the files in do_install_append Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
parent
51c195d761
commit
950386a988
|
@ -65,7 +65,7 @@ FILES_${PN}-libvirtd = " \
|
|||
${sysconfdir}/libvirt/libvirtd.conf \
|
||||
/usr/lib/sysctl.d/60-libvirtd.conf \
|
||||
${sbindir}/libvirtd \
|
||||
${systemd_unitdir}/system/* \
|
||||
${systemd_system_unitdir} \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', '${libexecdir}/libvirt-guests.sh', d)} \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'gnutls', '${sysconfdir}/pki/libvirt/* ${sysconfdir}/pki/CA/*', '', d)} \
|
||||
"
|
||||
|
@ -199,17 +199,21 @@ do_install_append() {
|
|||
fi
|
||||
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
|
||||
mkdir -p ${D}/lib
|
||||
mv ${D}/usr/lib/systemd ${D}/lib
|
||||
if [ "${systemd_system_unitdir}" != "${prefix}/lib/systemd/system" ] ; then
|
||||
# ./src/meson.build: systemd_unit_dir = prefix / 'lib' / 'systemd' / 'system'
|
||||
# ./tools/meson.build: install_dir: prefix / 'lib' / 'systemd' / 'system',
|
||||
mkdir -p ${D}${systemd_system_unitdir}
|
||||
mv ${D}${prefix}/lib/systemd/system/* ${D}${systemd_system_unitdir}
|
||||
rmdir ${D}${prefix}/lib/systemd/system ${D}${prefix}/lib/systemd
|
||||
fi
|
||||
|
||||
# This variable is used by libvirtd.service to start libvirtd in the right mode
|
||||
sed -i '/#LIBVIRTD_ARGS="--listen"/a LIBVIRTD_ARGS="--listen --daemon"' ${D}/${sysconfdir}/sysconfig/libvirtd
|
||||
|
||||
# We can't use 'notify' when we don't support 'sd_notify' dbus capabilities.
|
||||
sed -i -e 's/Type=notify/Type=forking/' \
|
||||
-e '/Type=forking/a PIDFile=/run/libvirtd.pid' \
|
||||
${D}/${systemd_unitdir}/system/libvirtd.service
|
||||
else
|
||||
rm -rf ${D}/usr/lib/systemd
|
||||
${D}/${systemd_system_unitdir}/libvirtd.service
|
||||
fi
|
||||
|
||||
# The /run/libvirt directories created by the Makefile are
|
||||
|
@ -302,7 +306,7 @@ do_install_append() {
|
|||
}
|
||||
|
||||
EXTRA_OEMESON += " \
|
||||
-Dinit_script=systemd \
|
||||
-Dinit_script=${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','none', d)} \
|
||||
-Drunstatedir=/run \
|
||||
-Dtests=enabled \
|
||||
"
|
||||
|
|
Loading…
Reference in New Issue
Block a user