On Wed, May 19, 2021 at 7:47 AM Martin Jansa <[email protected]> wrote:
>
> * 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"
>

Thanks for the fixups,

I need to get CI to include usrmerge so I can pick these up faster (I
just added it to the ever growing TODO).

I've queued this and will fire off my own non-usrmerge tests and push
once it passes.

Bruce

> * set -Dinit_script to none when systemd isn't used instead of
>   deleting the files in do_install_append
>
> Signed-off-by: Martin Jansa <[email protected]>
> ---
>  recipes-extended/libvirt/libvirt_7.2.0.bb | 18 +++++++++++-------
>  1 file 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 b569953..19662a7 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 = " \
>         ${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 \
>      "
> --
> 2.30.2
>
>
> 
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6536): 
https://lists.yoctoproject.org/g/meta-virtualization/message/6536
Mute This Topic: https://lists.yoctoproject.org/mt/82934133/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to