diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2021-05-19 13:47:40 +0200 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-05-19 09:26:02 -0400 |
commit | 950386a9887688b91f328771271185149613d650 (patch) | |
tree | 4e349dd1331d1217d1f06648cc138d4dc021efd6 /recipes-extended | |
parent | 51c195d7612e0b37b04e6867ff74484f8247f39c (diff) | |
download | meta-virtualization-950386a9887688b91f328771271185149613d650.tar.gz |
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>
Diffstat (limited to 'recipes-extended')
-rw-r--r-- | recipes-extended/libvirt/libvirt_7.2.0.bb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/recipes-extended/libvirt/libvirt_7.2.0.bb b/recipes-extended/libvirt/libvirt_7.2.0.bb index b5699536..19662a7f 100644 --- a/recipes-extended/libvirt/libvirt_7.2.0.bb +++ b/recipes-extended/libvirt/libvirt_7.2.0.bb | |||
@@ -65,7 +65,7 @@ FILES_${PN}-libvirtd = " \ | |||
65 | ${sysconfdir}/libvirt/libvirtd.conf \ | 65 | ${sysconfdir}/libvirt/libvirtd.conf \ |
66 | /usr/lib/sysctl.d/60-libvirtd.conf \ | 66 | /usr/lib/sysctl.d/60-libvirtd.conf \ |
67 | ${sbindir}/libvirtd \ | 67 | ${sbindir}/libvirtd \ |
68 | ${systemd_unitdir}/system/* \ | 68 | ${systemd_system_unitdir} \ |
69 | ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', '${libexecdir}/libvirt-guests.sh', d)} \ | 69 | ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', '${libexecdir}/libvirt-guests.sh', d)} \ |
70 | ${@bb.utils.contains('PACKAGECONFIG', 'gnutls', '${sysconfdir}/pki/libvirt/* ${sysconfdir}/pki/CA/*', '', d)} \ | 70 | ${@bb.utils.contains('PACKAGECONFIG', 'gnutls', '${sysconfdir}/pki/libvirt/* ${sysconfdir}/pki/CA/*', '', d)} \ |
71 | " | 71 | " |
@@ -199,17 +199,21 @@ do_install_append() { | |||
199 | fi | 199 | fi |
200 | 200 | ||
201 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | 201 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
202 | mkdir -p ${D}/lib | 202 | if [ "${systemd_system_unitdir}" != "${prefix}/lib/systemd/system" ] ; then |
203 | mv ${D}/usr/lib/systemd ${D}/lib | 203 | # ./src/meson.build: systemd_unit_dir = prefix / 'lib' / 'systemd' / 'system' |
204 | # ./tools/meson.build: install_dir: prefix / 'lib' / 'systemd' / 'system', | ||
205 | mkdir -p ${D}${systemd_system_unitdir} | ||
206 | mv ${D}${prefix}/lib/systemd/system/* ${D}${systemd_system_unitdir} | ||
207 | rmdir ${D}${prefix}/lib/systemd/system ${D}${prefix}/lib/systemd | ||
208 | fi | ||
209 | |||
204 | # This variable is used by libvirtd.service to start libvirtd in the right mode | 210 | # This variable is used by libvirtd.service to start libvirtd in the right mode |
205 | sed -i '/#LIBVIRTD_ARGS="--listen"/a LIBVIRTD_ARGS="--listen --daemon"' ${D}/${sysconfdir}/sysconfig/libvirtd | 211 | sed -i '/#LIBVIRTD_ARGS="--listen"/a LIBVIRTD_ARGS="--listen --daemon"' ${D}/${sysconfdir}/sysconfig/libvirtd |
206 | 212 | ||
207 | # We can't use 'notify' when we don't support 'sd_notify' dbus capabilities. | 213 | # We can't use 'notify' when we don't support 'sd_notify' dbus capabilities. |
208 | sed -i -e 's/Type=notify/Type=forking/' \ | 214 | sed -i -e 's/Type=notify/Type=forking/' \ |
209 | -e '/Type=forking/a PIDFile=/run/libvirtd.pid' \ | 215 | -e '/Type=forking/a PIDFile=/run/libvirtd.pid' \ |
210 | ${D}/${systemd_unitdir}/system/libvirtd.service | 216 | ${D}/${systemd_system_unitdir}/libvirtd.service |
211 | else | ||
212 | rm -rf ${D}/usr/lib/systemd | ||
213 | fi | 217 | fi |
214 | 218 | ||
215 | # The /run/libvirt directories created by the Makefile are | 219 | # The /run/libvirt directories created by the Makefile are |
@@ -302,7 +306,7 @@ do_install_append() { | |||
302 | } | 306 | } |
303 | 307 | ||
304 | EXTRA_OEMESON += " \ | 308 | EXTRA_OEMESON += " \ |
305 | -Dinit_script=systemd \ | 309 | -Dinit_script=${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','none', d)} \ |
306 | -Drunstatedir=/run \ | 310 | -Drunstatedir=/run \ |
307 | -Dtests=enabled \ | 311 | -Dtests=enabled \ |
308 | " | 312 | " |