On 6/12/2018 10:57 PM, Bruce Ashfield wrote:


On Tue, Jun 12, 2018 at 6:37 PM, Jeremy Puhlman <jpuhl...@mvista.com <mailto:jpuhl...@mvista.com>> wrote:

    /etc/libvirt/qemu.conf doesn't exist if qemu is disabled causing a
    build failure.

    Signed-off-by: Jeremy Puhlman <jpuhl...@mvista.com
    <mailto:jpuhl...@mvista.com>>
    ---
     recipes-extended/libvirt/libvirt_4.3.0.bb
    <http://libvirt_4.3.0.bb> | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)

    diff --git a/recipes-extended/libvirt/libvirt_4.3.0.bb
    <http://libvirt_4.3.0.bb>
    b/recipes-extended/libvirt/libvirt_4.3.0.bb <http://libvirt_4.3.0.bb>
    index ef51b9e..5cae02b 100644
    --- a/recipes-extended/libvirt/libvirt_4.3.0.bb
    <http://libvirt_4.3.0.bb>
    +++ b/recipes-extended/libvirt/libvirt_4.3.0.bb
    <http://libvirt_4.3.0.bb>
    @@ -266,8 +266,10 @@ do_install_append() {
            fi

            # disable seccomp_sandbox
    -       sed -i '/^#seccomp_sandbox = 1/aseccomp_sandbox = 0' \
    -           ${D}${sysconfdir}/libvirt/qemu.conf
    +        if ${@bb.utils.contains('PACKAGECONFIG', 'qemu', 'true',
    'false', d)}; then


Rather than key off the package config, why not just test for the file's existence and then only operate on it if it is there ? That is always safe, simpler and protects us from build failures if the behaviour/output of libvirt changes with respect to qemu in the future.

We could argue that we could check both, or warn if the package config is on, but the file isn't present .. but I'd still prefer to just keep it simple and all basic shell operations.

That's reasonable. I was more or less just following the pattern of the other PACKAGECONFIG checks, i.e. systemd and polkit. I can change it to a file check, if that would work better.


Cheers,

Bruce

    +          sed -i '/^#seccomp_sandbox = 1/aseccomp_sandbox = 0' \
    +              ${D}${sysconfdir}/libvirt/qemu.conf
    +        fi

            # Add hook support for libvirt
            mkdir -p ${D}/etc/libvirt/hooks
-- 2.6.2

-- _______________________________________________
    meta-virtualization mailing list
    meta-virtualization@yoctoproject.org
    <mailto:meta-virtualization@yoctoproject.org>
    https://lists.yoctoproject.org/listinfo/meta-virtualization
    <https://lists.yoctoproject.org/listinfo/meta-virtualization>




--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"

--
Jeremy A. Puhlman
jpuhl...@mvista.com

-- 
_______________________________________________
meta-virtualization mailing list
meta-virtualization@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-virtualization

Reply via email to