diff options
Diffstat (limited to 'recipes-extended/libvirt')
18 files changed, 531 insertions, 942 deletions
diff --git a/recipes-extended/libvirt/libvirt-dbus_1.4.1.bb b/recipes-extended/libvirt/libvirt-dbus_1.4.1.bb new file mode 100644 index 00000000..3f6da334 --- /dev/null +++ b/recipes-extended/libvirt/libvirt-dbus_1.4.1.bb @@ -0,0 +1,23 @@ +SUMMARY = "dBus wrapper for libvirt" +DESCRIPTION = "libvirt-dbus wraps libvirt API to provide a high-level object-oriented API better suited for dbus-based applications." +AUTHOR = "Lars Karlitski <lars@karlitski.net> Pavel Hrdina <phrdina@redhat.com> Katerina Koukiou <kkoukiou@redhat.com>" +HOMEPAGE = "https://www.libvirt.org/dbus.html" +BUGTRACKER = "https://gitlab.com/libvirt/libvirt-dbus/-/issues" +SECTION = "libs" +LICENSE = "LGPL-2.1-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" +CVE_PRODUCT = "libvirt-dbus" + +DEPENDS += "glib-2.0 libvirt libvirt-glib python3-docutils-native" + +SRC_URI = "git://gitlab.com/libvirt/libvirt-dbus.git;nobranch=1;protocol=https" + +SRCREV = "0c355bb8921d7cbccf93f41a8615fcd973e64f70" +S = "${WORKDIR}/git" + +inherit meson pkgconfig + +FILES:${PN} += "\ + ${datadir}/dbus-1/* \ + ${datadir}/polkit-1/* \ +" diff --git a/recipes-extended/libvirt/libvirt-glib/0001-meson.build-allow-crosscompiling-gir-and-doc.patch b/recipes-extended/libvirt/libvirt-glib/0001-meson.build-allow-crosscompiling-gir-and-doc.patch new file mode 100644 index 00000000..cd17bbbf --- /dev/null +++ b/recipes-extended/libvirt/libvirt-glib/0001-meson.build-allow-crosscompiling-gir-and-doc.patch @@ -0,0 +1,37 @@ +From 019d727990d41b5d7911895b75bcb021e4cca3c6 Mon Sep 17 00:00:00 2001 +From: Markus Volk <f_l_k@t-online.de> +Date: Mon, 21 Aug 2023 10:23:08 +0200 +Subject: [PATCH] meson.build: allow crosscompiling gir and doc + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Markus Volk <f_l_k@t-online.de> +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 134feb6..a089f42 100644 +--- a/meson.build ++++ b/meson.build +@@ -58,7 +58,7 @@ includedir = join_paths(prefix, get_option('includedir')) + + # gobject introspection + gir = find_program('g-ir-scanner', required: get_option('introspection')) +-enable_introspection = gir.found() and not meson.is_cross_build() ++enable_introspection = gir.found() + + # vala + vapi_opt = get_option('vapi') +@@ -73,7 +73,7 @@ endif + # gtk-doc + if not get_option('docs').disabled() + gtk_doc = find_program('gtkdoc-scan', required: get_option('docs')) +- enable_doc = gtk_doc.found() and not meson.is_cross_build() ++ enable_doc = gtk_doc.found() + else + enable_doc = false + endif +-- +2.41.0 + diff --git a/recipes-extended/libvirt/libvirt-glib_5.0.0.bb b/recipes-extended/libvirt/libvirt-glib_5.0.0.bb new file mode 100644 index 00000000..4435ca0b --- /dev/null +++ b/recipes-extended/libvirt/libvirt-glib_5.0.0.bb @@ -0,0 +1,21 @@ +DESCRIPTION = "A toolkit to interact with the virtualization capabilities of recent versions of Linux." +HOMEPAGE = "http://libvirt.org" +LICENSE = "LGPL-2.1-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" + +DEPENDS = "glib-2.0 libvirt libxml2 libxslt" + +SRC_URI = " \ + git://gitlab.com/libvirt/libvirt-glib;protocol=https;branch=master \ + file://0001-meson.build-allow-crosscompiling-gir-and-doc.patch \ +" + +SRCREV = "9b26bec8828a38fcb3bc0e5f6f33b03fa99c4b68" +S = "${WORKDIR}/git" + +inherit meson pkgconfig gobject-introspection gettext vala gtk-doc + +GIR_MESON_ENABLE_FLAG = 'enabled' +GIR_MESON_DISABLE_FLAG = 'disabled' +GTKDOC_MESON_ENABLE_FLAG = 'enabled' +GTKDOC_MESON_DISABLE_FLAG = 'disabled' diff --git a/recipes-extended/libvirt/libvirt-python.inc b/recipes-extended/libvirt/libvirt-python.inc index 7b87d5e1..40c362d6 100644 --- a/recipes-extended/libvirt/libvirt-python.inc +++ b/recipes-extended/libvirt/libvirt-python.inc @@ -1,24 +1,26 @@ -inherit python3native python3-dir +inherit python3native python3-dir python3targetconfig export STAGING_INCDIR export STAGING_LIBDIR export BUILD_SYS export HOST_SYS -RDEPENDS_${PN}-python += "python3" +RDEPENDS:${PN}-python += "python3" PACKAGECONFIG_${PN}-python[xen] = ",,,xen-python" PACKAGES += "${PN}-python-staticdev ${PN}-python-dev ${PN}-python-dbg ${PN}-python" -FILES_${PN}-python-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" -FILES_${PN}-python-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la" -FILES_${PN}-python-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug/" -FILES_${PN}-python = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*" +FILES:${PN}-python-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" +FILES:${PN}-python-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la" +FILES:${PN}-python-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug/" +FILES:${PN}-python = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*" -SRC_URI += "http://libvirt.org/sources/python/libvirt-python-${PV}.tar.gz;name=libvirt_python" +# Currently the libvirt-python debug libraries contain buildpaths +INSANE_SKIP:${PN}-dbg += "buildpaths" -SRC_URI[libvirt_python.md5sum] = "4cf898350ee9a47f94986d402c153bdb" -SRC_URI[libvirt_python.sha256sum] = "c772421ecc144f098f4ab15db700c62db9b9e6e76b876217edcfd62e9ce02750" +SRC_URI += "http://libvirt.org/sources/python/${BPN}-python-${PV}.tar.gz;name=libvirt_python;subdir=${BP}" + +SRC_URI[libvirt_python.sha256sum] = "a82588f0e7db53eda7b7dbcbc448b0ec43e00a8c77cac69644495299b410c20d" export LIBVIRT_API_PATH = "${S}/docs/libvirt-api.xml" export LIBVIRT_CFLAGS = "-I${S}/include" @@ -38,25 +40,27 @@ python __anonymous () { d.setVar('LIBVIRT_PYTHON_ENABLE', '0') } -do_compile_append() { +do_compile:append() { if [ "${LIBVIRT_PYTHON_ENABLE}" = "1" ]; then # we need the python bindings to look into our source dir, not # the syroot staged pkgconfig entries. So we clear the sysroot # for just this portion. export PKG_CONFIG_SYSROOT_DIR= - cd ${WORKDIR}/${BPN}-python-${PV} && \ + cd ${S}/${BPN}-python-${PV} && \ ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build + cd - fi } -do_install_append() { +do_install:append() { if [ "${LIBVIRT_PYTHON_ENABLE}" = "1" ]; then # we need the python bindings to look into our source dir, not # the syroot staged pkgconfig entries. So we clear the sysroot # for just this portion. export PKG_CONFIG_SYSROOT_DIR= - cd ${WORKDIR}/${BPN}-python-${PV} && \ + cd ${S}/${BPN}-python-${PV} && \ ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py install \ --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS} + cd - fi } diff --git a/recipes-extended/libvirt/libvirt/0001-build-drop-unnecessary-libgnu.la-reference.patch b/recipes-extended/libvirt/libvirt/0001-build-drop-unnecessary-libgnu.la-reference.patch deleted file mode 100644 index f02a5d64..00000000 --- a/recipes-extended/libvirt/libvirt/0001-build-drop-unnecessary-libgnu.la-reference.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 30a056069cb35804434fb036e51ae97f33c02025 Mon Sep 17 00:00:00 2001 -From: Bruce Ashfield <bruce.ashfield@gmail.com> -Date: Sat, 7 Mar 2020 21:36:27 -0500 -Subject: [PATCH] build: drop unnecessary libgnu.la reference - -Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> - ---- - tools/Makefile.am | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/tools/Makefile.am b/tools/Makefile.am -index 2a0a989..93fe283 100644 ---- a/tools/Makefile.am -+++ b/tools/Makefile.am -@@ -168,7 +168,6 @@ virt_host_validate_LDADD = \ - - if WITH_GNUTLS - virt_host_validate_LDADD += ../src/libvirt-net-rpc.la \ -- ../gnulib/lib/libgnu.la \ - $(NULL) - endif - -@@ -270,7 +269,6 @@ BUILT_SOURCES = - - if WITH_GNUTLS - virsh_LDADD += ../src/libvirt-net-rpc.la \ -- ../gnulib/lib/libgnu.la \ - $(NULL) - endif - diff --git a/recipes-extended/libvirt/libvirt/0001-messon.build-remove-build-path-information-to-avoid-.patch b/recipes-extended/libvirt/libvirt/0001-messon.build-remove-build-path-information-to-avoid-.patch new file mode 100644 index 00000000..d9bcef0b --- /dev/null +++ b/recipes-extended/libvirt/libvirt/0001-messon.build-remove-build-path-information-to-avoid-.patch @@ -0,0 +1,55 @@ +From 9660b76325c841a5f5c7d5b2fb439a1fd64105c9 Mon Sep 17 00:00:00 2001 +From: Xiangyu Chen <xiangyu.chen@windriver.com> +Date: Thu, 19 Jan 2023 17:07:37 +0800 +Subject: [PATCH] messon.build: remove build path information to avoid yocto QA + buildpath check warnings + +libvirt debug trace contains source path, and some utils was located to +yocto sysroot folder, those full source path cause yocto QA buildpath check failed and report warnings as below: + +WARNING: libvirt-8.1.0-r0 do_package_qa: QA Issue: File /usr/libexec/libvirt_lxc in package libvirt contains reference to TMPDIR +File /usr/lib64/libvirt.so.0.8001.0 in package libvirt contains reference to TMPDIR +File /usr/lib64/libvirt/lock-driver/lockd.so in package libvirt contains reference to TMPDIR +File /usr/lib64/libvirt/connection-driver/libvirt_driver_lxc.so in package libvirt contains reference to TMPDIR +File /usr/lib64/libvirt/connection-driver/libvirt_driver_storage.so in package libvirt contains reference to TMPDIR +File /usr/lib64/libvirt/connection-driver/libvirt_driver_network.so in package libvirt contains reference to TMPDIR +File /usr/lib64/libvirt/storage-backend/libvirt_storage_backend_fs.so in package libvirt contains reference to TMPDIR +File /usr/lib64/libvirt/storage-backend/libvirt_storage_backend_disk.so in package libvirt contains reference to TMPDIR +File /usr/bin/virt-ssh-helper in package libvirt contains reference to TMPDIR [buildpaths] + + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> +--- + meson.build | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +Index: libvirt-9.2.0/meson.build +=================================================================== +--- libvirt-9.2.0.orig/meson.build ++++ libvirt-9.2.0/meson.build +@@ -26,8 +26,8 @@ + conf = configuration_data() + + conf.set('_GNU_SOURCE', 1) +-conf.set_quoted('abs_top_builddir', meson.project_build_root()) +-conf.set_quoted('abs_top_srcdir', meson.project_source_root()) ++conf.set_quoted('abs_top_builddir', ' ') ++conf.set_quoted('abs_top_srcdir', ' ') + conf.set_quoted('PACKAGE', meson.project_name()) + conf.set_quoted('PACKAGE_NAME', meson.project_name()) + conf.set_quoted('PACKAGE_VERSION', meson.project_version()) +@@ -1770,9 +1770,9 @@ + use_storage = true + + conf.set('WITH_STORAGE_FS', 1) +- conf.set_quoted('MOUNT', mount_prog.full_path()) +- conf.set_quoted('UMOUNT', umount_prog.full_path()) +- conf.set_quoted('MKFS', mkfs_prog.full_path()) ++ conf.set_quoted('MOUNT', '/usr/bin/mount') ++ conf.set_quoted('UMOUNT', '/usr/bin/umount') ++ conf.set_quoted('MKFS', '/usr/sbin/mkfs') + + showmount_prog = find_program('showmount', required: false, dirs: libvirt_sbin_path) + showmount_path = '' diff --git a/recipes-extended/libvirt/libvirt/0001-prevent-gendispatch.pl-generating-build-path-in-code.patch b/recipes-extended/libvirt/libvirt/0001-prevent-gendispatch.pl-generating-build-path-in-code.patch new file mode 100644 index 00000000..defbd7ee --- /dev/null +++ b/recipes-extended/libvirt/libvirt/0001-prevent-gendispatch.pl-generating-build-path-in-code.patch @@ -0,0 +1,43 @@ +From ba915b13b92f3a625633ede43789c1ba780371af Mon Sep 17 00:00:00 2001 +From: Xiangyu Chen <xiangyu.chen@windriver.com> +Date: Wed, 18 Jan 2023 03:19:07 +0000 +Subject: [PATCH] prevent gendispatch.pl generating build path in code comments + +gendispatch.pl will add build dir in code comments which was generated +by itself. those build dir information would cause yocto qa report +warnings like: + +WARNING: libvirt-8.1.0-r0 do_package_qa: +QA Issue: File /usr/src/debug/libvirt/8.1.0-r0/src/access/viraccessapicheckqemu.h in package libvirt-src contains reference to TMPDIR +File /usr/src/debug/libvirt/8.1.0-r0/src/access/viraccessapichecklxc.h in package libvirt-src contains reference to TMPDIR +File /usr/src/debug/libvirt/8.1.0-r0/src/access/viraccessapicheckqemu.c in package libvirt-src contains reference to TMPDIR +File /usr/src/debug/libvirt/8.1.0-r0/src/access/viraccessapichecklxc.c in package libvirt-src contains reference to TMPDIR +File /usr/src/debug/libvirt/8.1.0-r0/src/access/viraccessapicheck.h in package libvirt-src contains reference to TMPDIR +File /usr/src/debug/libvirt/8.1.0-r0/src/access/viraccessapicheck.c in package libvirt-src contains reference to TMPDIR [buildpaths] + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> +--- + src/rpc/gendispatch.pl | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +Index: libvirt-9.2.0/src/rpc/gendispatch.pl +=================================================================== +--- libvirt-9.2.0.orig/src/rpc/gendispatch.pl ++++ libvirt-9.2.0/src/rpc/gendispatch.pl +@@ -449,12 +449,12 @@ + + if ($mode eq "aclsym") { + print <<__EOF__; +-# Automatically generated from $protocol by gendispatch.pl. ++# Automatically generated by gendispatch.pl. + # Do not edit this file. Any changes you make will be lost. + __EOF__ + } else { + print <<__EOF__; +-/* Automatically generated from $protocol by gendispatch.pl. ++/* Automatically generated by gendispatch.pl. + * Do not edit this file. Any changes you make will be lost. + */ + __EOF__ diff --git a/recipes-extended/libvirt/libvirt/0001-ptest-Remove-Windows-1252-check-from-esxutilstest.patch b/recipes-extended/libvirt/libvirt/0001-ptest-Remove-Windows-1252-check-from-esxutilstest.patch index abb0b1af..cabc4cb6 100644 --- a/recipes-extended/libvirt/libvirt/0001-ptest-Remove-Windows-1252-check-from-esxutilstest.patch +++ b/recipes-extended/libvirt/libvirt/0001-ptest-Remove-Windows-1252-check-from-esxutilstest.patch @@ -6,6 +6,8 @@ Subject: [PATCH] ptest: Remove Windows-1252 check from esxutilstest Currently we use iconv from glibc-locale and it does not support Windows-1252 and we don't need support windows character encoding. +Upstream-Status: Inappropriate [embedded specific] + Signed-off-by: He Zhe <zhe.he@windriver.com> --- diff --git a/recipes-extended/libvirt/libvirt/0001-to-fix-build-error.patch b/recipes-extended/libvirt/libvirt/0001-to-fix-build-error.patch deleted file mode 100644 index b0148e5c..00000000 --- a/recipes-extended/libvirt/libvirt/0001-to-fix-build-error.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 3566bcacaa6408fb8f655d1749a20b2f30e0c765 Mon Sep 17 00:00:00 2001 -From: Lei Maohui <leimaohui@cn.fujitsu.com> -Date: Fri, 31 Jul 2015 03:17:07 +0900 -Subject: [PATCH] to fix build error - -The error likes as following - -| Generating internals/command.html.tmp -| /bin/sh: line 3: internals/command.html.tmp: No such file or directory -| rm: Generating internals/locking.html.tmp -| cannot remove `internals/command.html.tmp': No such file or directory -| make[3]: *** [internals/command.html.tmp] Error 1 -| make[3]: *** Waiting for unfinished jobs.... - -Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com> -[ywei: rebased to libvirt-1.3.2] -Signed-off-by: Yunguo Wei <yunguo.wei@windriver.com> -[MA: rebase to v4.3.0] -Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> - ---- - docs/Makefile.am | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/docs/Makefile.am b/docs/Makefile.am -index ce3d296..2c8180f 100644 ---- a/docs/Makefile.am -+++ b/docs/Makefile.am -@@ -366,7 +366,7 @@ EXTRA_DIST= \ - aclperms.htmlinc \ - $(schema_DATA) - --acl_generated = aclperms.htmlinc -+acl.html:: $(srcdir)/aclperms.htmlinc - - aclperms.htmlinc: $(top_srcdir)/src/access/viraccessperm.h \ - $(top_srcdir)/scripts/genaclperms.py Makefile.am -@@ -432,8 +432,7 @@ manpages/%.html.in: manpages/%.rst - $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ - $(RST2HTML) --strict $< > $@ || { rm $@ && exit 1; } - --%.html.tmp: %.html.in site.xsl subsite.xsl page.xsl \ -- $(acl_generated) -+%.html.tmp: %.html.in site.xsl subsite.xsl page.xsl - $(AM_V_GEN)name=`echo $@ | sed -e 's/.tmp//'`; \ - genhtmlin=`echo $@ | sed -e 's/.tmp/.in/'`; \ - rst=`echo $@ | sed -e 's/.html.tmp/.rst/'`; \ diff --git a/recipes-extended/libvirt/libvirt/configure.ac-search-for-rpc-rpc.h-in-the-sysroot.patch b/recipes-extended/libvirt/libvirt/configure.ac-search-for-rpc-rpc.h-in-the-sysroot.patch deleted file mode 100644 index 395d5610..00000000 --- a/recipes-extended/libvirt/libvirt/configure.ac-search-for-rpc-rpc.h-in-the-sysroot.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 79f5975db01af0599860ccca7ef44b0e27105a04 Mon Sep 17 00:00:00 2001 -From: Mark Asselstine <mark.asselstine@windriver.com> -Date: Thu, 10 May 2018 12:05:04 -0400 -Subject: [PATCH] configure.ac: search for rpc/rpc.h in the sysroot - -We want to avoid host contamination and use the sysroot as the base -directory for our search so add the '=' the the '-I' when searching -for libtirpc's rpc.h header. - -Upstream-Status: Inappropriate [old release] - -Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> - ---- - m4/virt-xdr.m4 | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/m4/virt-xdr.m4 b/m4/virt-xdr.m4 -index 8375415..12b51f7 100644 ---- a/m4/virt-xdr.m4 -+++ b/m4/virt-xdr.m4 -@@ -30,10 +30,10 @@ AC_DEFUN([LIBVIRT_CHECK_XDR], [ - ]) - with_xdr="yes" - -- dnl Recent glibc requires -I/usr/include/tirpc for <rpc/rpc.h> -+ dnl Recent glibc requires -I=/usr/include/tirpc for <rpc/rpc.h> - old_CFLAGS=$CFLAGS - AC_CACHE_CHECK([where to find <rpc/rpc.h>], [lv_cv_xdr_cflags], [ -- for add_CFLAGS in '' '-I/usr/include/tirpc' 'missing'; do -+ for add_CFLAGS in '' '-I=/usr/include/tirpc' 'missing'; do - if test x"$add_CFLAGS" = xmissing; then - lv_cv_xdr_cflags=missing; break - fi diff --git a/recipes-extended/libvirt/libvirt/install-missing-file.patch b/recipes-extended/libvirt/libvirt/install-missing-file.patch deleted file mode 100644 index 6aa36df8..00000000 --- a/recipes-extended/libvirt/libvirt/install-missing-file.patch +++ /dev/null @@ -1,50 +0,0 @@ -From aa75f5136066d239d48a21373b3d96ee12378e8d Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Wed, 8 May 2019 17:24:17 +0800 -Subject: [PATCH] Install missing conf file - -openvzutilstest.conf file is needed by openvzutilstest test. - -Upstream-Status: Inapproriate - -Signed-off-by: Catalin Enache <catalin.enache@windriver.com> -[KK: Update context for 1.3.5.] -Signed-off-by: Kai Kang <kai.kang@windriver.com> -[MA: Update context for v4.3.0] -Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> -[DDU: Update context for v5.3.0] -Signed-off-by: Dengke Du <dengke.du@windriver.com> - ---- - tests/Makefile.am | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/tests/Makefile.am b/tests/Makefile.am -index 4a808dd..0c3e799 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -173,6 +173,7 @@ EXTRA_DIST = \ - $(NULL) - - test_helpers = commandhelper ssh -+test_misc = - test_programs = virshtest sockettest \ - virhostcputest virbuftest \ - commandtest seclabeltest \ -@@ -311,6 +312,7 @@ endif WITH_LXC - - if WITH_OPENVZ - test_programs += openvzutilstest -+test_misc += openvzutilstest.conf - endif WITH_OPENVZ - - if WITH_ESX -@@ -1551,7 +1553,7 @@ endif ! WITH_LINUX - - buildtest-TESTS: $(TESTS) $(test_libraries) $(test_helpers) - --PTESTS = $(TESTS) $(test_helpers) test-lib.sh virschematest -+PTESTS = $(TESTS) $(test_helpers) $(test_misc) test-lib.sh virschematest - - install-ptest: - list='$(TESTS) $(test_helpers) test-lib.sh virschematest' diff --git a/recipes-extended/libvirt/libvirt/libvirt-1.0.3-fix-thread-safety-in-lxc-callback-handling.patch b/recipes-extended/libvirt/libvirt/libvirt-1.0.3-fix-thread-safety-in-lxc-callback-handling.patch deleted file mode 100644 index 558d5ef6..00000000 --- a/recipes-extended/libvirt/libvirt/libvirt-1.0.3-fix-thread-safety-in-lxc-callback-handling.patch +++ /dev/null @@ -1,63 +0,0 @@ -From ad5d9cee87357f9f38f62583119606ef95ba10df Mon Sep 17 00:00:00 2001 -From: Bogdan Purcareata <bogdan.purcareata@freescale.com> -Date: Fri, 24 May 2013 16:46:00 +0300 -Subject: [PATCH] Fix thread safety in LXC callback handling - -Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> ---- - src/lxc/lxc_process.c | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - -diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c -index aaa81a7..0eadc67 100644 ---- a/src/lxc/lxc_process.c -+++ b/src/lxc/lxc_process.c -@@ -609,8 +609,13 @@ static void virLXCProcessMonitorExitNotify(virLXCMonitorPtr mon ATTRIBUTE_UNUSED - virLXCProtocolExitStatus status, - virDomainObjPtr vm) - { -+ virLXCDriverPtr driver = lxc_driver; - virLXCDomainObjPrivatePtr priv = vm->privateData; - -+ lxcDriverLock(driver); -+ virObjectLock(vm); -+ lxcDriverUnlock(driver); -+ - switch (status) { - case VIR_LXC_PROTOCOL_EXIT_STATUS_SHUTDOWN: - priv->stopReason = VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN; -@@ -628,6 +633,8 @@ static void virLXCProcessMonitorExitNotify(virLXCMonitorPtr mon ATTRIBUTE_UNUSED - } - VIR_DEBUG("Domain shutoff reason %d (from status %d)", - priv->stopReason, status); -+ -+ virObjectUnlock(vm); - } - - /* XXX a little evil */ -@@ -636,12 +643,21 @@ static void virLXCProcessMonitorInitNotify(virLXCMonitorPtr mon ATTRIBUTE_UNUSED - pid_t initpid, - virDomainObjPtr vm) - { -- virLXCDomainObjPrivatePtr priv = vm->privateData; -+ virLXCDriverPtr driver = lxc_driver; -+ virLXCDomainObjPrivatePtr priv; -+ -+ lxcDriverLock(driver); -+ virObjectLock(vm); -+ lxcDriverUnlock(driver); -+ -+ priv = vm->privateData; - priv->initpid = initpid; - virDomainAuditInit(vm, initpid); - - if (virDomainSaveStatus(lxc_driver->caps, lxc_driver->stateDir, vm) < 0) - VIR_WARN("Cannot update XML with PID for LXC %s", vm->def->name); -+ -+ virObjectUnlock(vm); - } - - static virLXCMonitorCallbacks monitorCallbacks = { --- -1.7.11.7 - diff --git a/recipes-extended/libvirt/libvirt/libvirt-use-pkg-config-to-locate-libcap.patch b/recipes-extended/libvirt/libvirt/libvirt-use-pkg-config-to-locate-libcap.patch deleted file mode 100644 index 87b55915..00000000 --- a/recipes-extended/libvirt/libvirt/libvirt-use-pkg-config-to-locate-libcap.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 94bd514e1b6e602a48285db94e65050f8f0c2585 Mon Sep 17 00:00:00 2001 -From: Bruce Ashfield <bruce.ashfield@windriver.com> -Date: Wed, 8 Apr 2015 13:03:03 -0400 -Subject: [PATCH] libvirt: use pkg-config to locate libcap - -libvirt wants to use pcap-config to locate the exisence and location -of libpcap. oe-core stubs this script and replaces it with pkg-config, -which can lead to the host pcap-config triggering and either breaking -the build or introducing host contamination. - -To fix this issue, we patch configure to use 'pkg-config libcap' to -locate the correct libraries. - -Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> -[MA: Update to apply agains v4.3.0] -Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> - ---- - m4/virt-libpcap.m4 | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/m4/virt-libpcap.m4 b/m4/virt-libpcap.m4 -index 605c2fd..e0ab018 100644 ---- a/m4/virt-libpcap.m4 -+++ b/m4/virt-libpcap.m4 -@@ -23,14 +23,14 @@ AC_DEFUN([LIBVIRT_ARG_LIBPCAP], [ - - AC_DEFUN([LIBVIRT_CHECK_LIBPCAP], [ - LIBPCAP_REQUIRED="1.5.0" -- LIBPCAP_CONFIG="pcap-config" -+ LIBPCAP_CONFIG="pkg-config libpcap" - LIBPCAP_CFLAGS="" - LIBPCAP_LIBS="" - - if test "x$with_libpcap" != "xno"; then - case $with_libpcap in -- ''|yes|check) LIBPCAP_CONFIG="pcap-config" ;; -- *) LIBPCAP_CONFIG="$with_libpcap/bin/pcap-config" ;; -+ ''|yes|check) LIBPCAP_CONFIG="pkg-config libpcap" ;; -+ *) LIBPCAP_CONFIG="$with_libpcap/bin/pkg-config libpcap" ;; - esac - AS_IF([test "x$LIBPCAP_CONFIG" != "x"], [ - AC_MSG_CHECKING(libpcap $LIBPCAP_CONFIG >= $LIBPCAP_REQUIRED ) diff --git a/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch b/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch deleted file mode 100644 index 3cf9e839..00000000 --- a/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 74bff2509080912ea8abf1de8fd95fa2412b659a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com> -Date: Thu, 11 Apr 2013 11:37:25 +0200 -Subject: [PATCH] qemu: fix crash in qemuOpen - -commit 74bff2509080912ea8abf1de8fd95fa2412b659a from upsteam -git://libvirt.org/libvirt.git - -If the path part of connection URI is not present, cfg is used -unitialized. - -https://bugzilla.redhat.com/show_bug.cgi?id=950855 ---- - src/qemu/qemu_driver.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 2c0d7d1..0d41e39 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -1026,6 +1026,7 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn, - goto cleanup; - } - -+ cfg = virQEMUDriverGetConfig(qemu_driver); - if (conn->uri->path == NULL) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("no QEMU URI path given, try %s"), -@@ -1033,7 +1034,6 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn, - goto cleanup; - } - -- cfg = virQEMUDriverGetConfig(qemu_driver); - if (cfg->privileged) { - if (STRNEQ(conn->uri->path, "/system") && - STRNEQ(conn->uri->path, "/session")) { --- -1.7.1 - diff --git a/recipes-extended/libvirt/libvirt/runptest.patch b/recipes-extended/libvirt/libvirt/runptest.patch deleted file mode 100644 index f6bc7736..00000000 --- a/recipes-extended/libvirt/libvirt/runptest.patch +++ /dev/null @@ -1,116 +0,0 @@ -From d210838a4433dd254c1a11b08b804ebe9ff5f378 Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Wed, 8 May 2019 10:20:47 +0800 -Subject: [PATCH] Add 'install-ptest' rule - -Change TESTS_ENVIRONMENT to allow running outside build dir. - -Upstream-status: Pending -Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com> -[KK: Update context for 1.3.5.] -Signed-off-by: Kai Kang <kai.kang@windriver.com> -[MA: Allow separate source and build dirs] -Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> -[ZH: add missing test_helper files] -Signed-off-by: He Zhe <zhe.he@windriver.com> -[MA: Update context for v4.3.0] -Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> -[DDU: Update context for v5.3.0] -Signed-off-by: Dengke Du <dengke.du@windriver.com> - ---- - tests/Makefile.am | 68 +++++++++++++++++++++++++++++++++++++++++------ - 1 file changed, 60 insertions(+), 8 deletions(-) - -diff --git a/tests/Makefile.am b/tests/Makefile.am -index ada5b8f..4a808dd 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -28,11 +28,13 @@ AM_CPPFLAGS = \ - - WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS) - -+PTEST_DIR ?= $(libdir)/libvirt/ptest -+ - AM_CFLAGS = \ -- -Dabs_builddir="\"$(abs_builddir)\"" \ -- -Dabs_top_builddir="\"$(abs_top_builddir)\"" \ -- -Dabs_srcdir="\"$(abs_srcdir)\"" \ -- -Dabs_top_srcdir="\"$(abs_top_srcdir)\"" \ -+ -Dabs_builddir="\"$(PTEST_DIR)/tests\"" \ -+ -Dabs_top_builddir="\"$(PTEST_DIR)\"" \ -+ -Dabs_srcdir="\"$(PTEST_DIR)/tests\"" \ -+ -Dabs_top_srcdir="\"$(PTEST_DIR)\"" \ - $(LIBXML_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(LIBNL_CFLAGS) \ -@@ -474,10 +476,10 @@ TESTS = $(test_programs) \ - - VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT) - TESTS_ENVIRONMENT = \ -- abs_top_builddir="$(abs_top_builddir)" \ -- abs_top_srcdir="$(abs_top_srcdir)" \ -- abs_builddir="$(abs_builddir)" \ -- abs_srcdir="$(abs_srcdir)" \ -+ abs_top_builddir="$(PTEST_DIR)" \ -+ abs_top_srcdir="$(PTEST_DIR)" \ -+ abs_builddir="$(PTEST_DIR)/tests" \ -+ abs_srcdir="$(PTEST_DIR)/tests" \ - LIBVIRT_AUTOSTART=0 \ - LC_ALL=C \ - VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \ -@@ -1547,4 +1549,54 @@ else ! WITH_LINUX - EXTRA_DIST += virscsitest.c - endif ! WITH_LINUX - -+buildtest-TESTS: $(TESTS) $(test_libraries) $(test_helpers) -+ -+PTESTS = $(TESTS) $(test_helpers) test-lib.sh virschematest -+ -+install-ptest: -+ list='$(TESTS) $(test_helpers) test-lib.sh virschematest' -+ install -d $(DEST_DIR)/tools -+ @(if [ -d ../tools/.libs ] ; then cd ../tools/.libs; fi; \ -+ install * $(DEST_DIR)/tools) -+ install -d $(DEST_DIR)/src/network -+ cp $(top_srcdir)/src/network/*.xml $(DEST_DIR)/src/network -+ install -d $(DEST_DIR)/src/cpu_map -+ cp $(top_srcdir)/src/cpu_map/*.xml $(DEST_DIR)/src/cpu_map -+ install ../src/libvirt_iohelper $(DEST_DIR)/src -+ install -D ../src/libvirtd $(DEST_DIR)/src/libvirtd -+ install -d $(DEST_DIR)/src/remote -+ install -D $(top_srcdir)/../build/src/remote/libvirtd.conf $(DEST_DIR)/src/remote/libvirtd.conf -+ install -d $(DEST_DIR)/src/remote/.libs -+ @(if [ -d ../src/remote/.libs ] ; then cd ../src/remote/.libs; fi; \ -+ install * $(DEST_DIR)/src/remote/.libs) -+ install -d $(DEST_DIR)/src/.libs -+ @(if [ -d ../src/.libs ] ; then cd ../src/.libs; fi; \ -+ install * $(DEST_DIR)/src/.libs) -+ install -d $(DEST_DIR)/docs/schemas -+ cp $(top_srcdir)/docs/schemas/*.rng $(DEST_DIR)/docs/schemas -+ cp -r $(top_srcdir)/build-aux $(DEST_DIR) -+ install -d $(DEST_DIR)/examples/xml -+ cp -r $(top_srcdir)/examples/xml/test $(DEST_DIR)/examples/xml -+ install -d $(DEST_DIR)/tests/.libs -+ find . -type d -name "*xml2xml*" -exec cp -r {} $(DEST_DIR)/tests \; -+ find . -type d -name "*data" -exec cp -r {} $(DEST_DIR)/tests \; -+ @(for file in $(PTESTS); do \ -+ if [ -f .libs/$$file ]; then \ -+ install .libs/$$file $(DEST_DIR)/tests; \ -+ elif [ -f $(srcdir)/$$file ]; then \ -+ install $(srcdir)/$$file $(DEST_DIR)/tests; \ -+ else \ -+ install $(builddir)/$$file $(DEST_DIR)/tests; \ -+ fi; \ -+ done;) -+ @(if [ -d .libs ]; then install .libs/*.so $(DEST_DIR)/tests/.libs; fi;) -+ cp ../config.h $(DEST_DIR) -+ cp Makefile $(DEST_DIR)/tests -+ sed -i -e 's/^Makefile:/_Makefile:/' $(DEST_DIR)/tests/Makefile -+ cp ../Makefile $(DEST_DIR) -+ sed -i -e 's|^Makefile:|_Makefile:|' $(DEST_DIR)/Makefile -+ sed -i -e 's|$(BUILD_DIR)|$(PTEST_DIR)|g' $(DEST_DIR)/tests/Makefile -+ sed -i -e 's|$(BUILD_DIR)|$(PTEST_DIR)|g' $(DEST_DIR)/Makefile -+ sed -i -e 's|^\(.*\.log:\) \(.*EXEEXT.*\)|\1|g' $(DEST_DIR)/tests/Makefile -+ - CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda diff --git a/recipes-extended/libvirt/libvirt/tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch b/recipes-extended/libvirt/libvirt/tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch deleted file mode 100644 index bb500fde..00000000 --- a/recipes-extended/libvirt/libvirt/tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 7dc21edd851b260485b432c096f8e90f6fa07778 Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Tue, 7 May 2019 15:26:32 +0800 -Subject: [PATCH] tools: add libvirt-net-rpc to virt-host-validate when TLS is - enabled - -When gnu-tls is enabled for libvirt references to virNetTLSInit are -generated in libvirt. Any binaries linking against libvirt, must also -link against libvirt-net-rpc which provides the implementation. - -Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> -[ywei: rebased to libvirt-1.3.2] -Signed-off-by: Yunguo Wei <yunguo.wei@windriver.com> -[MA: rebase to v4.3.0] -Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> -[ddu: rebase to v5.3.0] -Signed-off-by: Dengke Du <dengke.du@windriver.com> - ---- - examples/Makefile.am | 20 ++++++++++++++++++++ - tools/Makefile.am | 12 ++++++++++++ - 2 files changed, 32 insertions(+) - -diff --git a/examples/Makefile.am b/examples/Makefile.am -index ad635bd..a94f41d 100644 ---- a/examples/Makefile.am -+++ b/examples/Makefile.am -@@ -74,6 +74,10 @@ LDADD = \ - $(top_builddir)/src/libvirt-admin.la \ - $(NULL) - -+if WITH_GNUTLS -+LDADD += $(top_builddir)/src/libvirt-net-rpc.la -+endif -+ - noinst_PROGRAMS = \ - c/admin/client_close \ - c/admin/client_info \ -@@ -111,6 +115,22 @@ c_misc_openauth_SOURCES = c/misc/openauth.c - examplesdir = $(docdir)/examples - - adminexamplesdir = $(examplesdir)/c/admin -+ -+if WITH_GNUTLS -+dominfo_info1_LDADD = $(top_builddir)/src/libvirt-net-rpc.la \ -+ $(LDADD) \ -+ $(NULL) -+domsuspend_suspend_LDADD = $(top_builddir)/src/libvirt-net-rpc.la \ -+ $(LDADD) \ -+ $(NULL) -+hellolibvirt_hellolibvirt_LDADD = $(top_builddir)/src/libvirt-net-rpc.la \ -+ $(LDADD) \ -+ $(NULL) -+openauth_openauth_LDADD = $(top_builddir)/src/libvirt-net-rpc.la \ -+ $(LDADD) \ -+ $(NULL) -+endif -+ - adminexamples_DATA = $(ADMIN_EXAMPLES) - - domainexamplesdir = $(examplesdir)/c/domain -diff --git a/tools/Makefile.am b/tools/Makefile.am -index 53df930..2a0a989 100644 ---- a/tools/Makefile.am -+++ b/tools/Makefile.am -@@ -166,6 +166,12 @@ virt_host_validate_LDADD = \ - $(GLIB_LIBS) \ - $(NULL) - -+if WITH_GNUTLS -+virt_host_validate_LDADD += ../src/libvirt-net-rpc.la \ -+ ../gnulib/lib/libgnu.la \ -+ $(NULL) -+endif -+ - virt_host_validate_CFLAGS = \ - $(AM_CFLAGS) \ - $(NULL) -@@ -262,6 +268,12 @@ virt_admin_CFLAGS = \ - $(READLINE_CFLAGS) - BUILT_SOURCES = - -+if WITH_GNUTLS -+virsh_LDADD += ../src/libvirt-net-rpc.la \ -+ ../gnulib/lib/libgnu.la \ -+ $(NULL) -+endif -+ - if WITH_WIN_ICON - virsh_LDADD += virsh_win_icon.$(OBJEXT) - diff --git a/recipes-extended/libvirt/libvirt_10.0.0.bb b/recipes-extended/libvirt/libvirt_10.0.0.bb new file mode 100644 index 00000000..8e54406a --- /dev/null +++ b/recipes-extended/libvirt/libvirt_10.0.0.bb @@ -0,0 +1,333 @@ +DESCRIPTION = "A toolkit to interact with the virtualization capabilities of recent versions of Linux." +HOMEPAGE = "http://libvirt.org" +LICENSE = "LGPL-2.1-or-later & GPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING.LESSER;md5=4b54a1fd55a448865a0b32d41598759d" +SECTION = "console/tools" + +DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \ + iptables dnsmasq readline libtasn1 libxslt-native acl libdevmapper libtirpc \ + python3-docutils-native \ + ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'shadow-native', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'gnutls', 'gnutls-native', '', d)}" + +# libvirt-guests.sh needs gettext.sh +# +RDEPENDS:${PN} = "gettext-runtime" + +RDEPENDS:libvirt-libvirtd += "bridge-utils iptables pm-utils dnsmasq netcat-openbsd ebtables" +RDEPENDS:libvirt-libvirtd:append:x86-64 = " dmidecode" +RDEPENDS:libvirt-libvirtd:append:x86 = " dmidecode" +RDEPENDS:libvirt-libvirtd:append:arm = " dmidecode" +RDEPENDS:libvirt-libvirtd:append:aarch64 = " dmidecode" + +#connman blocks the 53 port and libvirtd can't start its DNS service +RCONFLICTS:${PN}_libvirtd = "connman" + +SRC_URI = "http://libvirt.org/sources/${BP}.tar.xz;name=libvirt \ + file://libvirtd.sh \ + file://libvirtd.conf \ + file://dnsmasq.conf \ + file://hook_support.py \ + file://gnutls-helper.py;subdir=${BP} \ + file://0001-prevent-gendispatch.pl-generating-build-path-in-code.patch \ + file://0001-messon.build-remove-build-path-information-to-avoid-.patch \ + " + +SRC_URI[libvirt.sha256sum] = "8ba2e72ec8bdd2418554a1474c42c35704c30174b7611eaf9a16544b71bcf00a" + +inherit meson gettext update-rc.d pkgconfig systemd useradd perlnative +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM:${PN} = "-r qemu; -r kvm" +USERADD_PARAM:${PN} = "-r -g qemu -G kvm qemu" + + +EXTRA_OEMESON += "--cross-file ${WORKDIR}/meson-${PN}.cross" +do_write_config:append() { + cat >${WORKDIR}/meson-${PN}.cross <<EOF +[binaries] +iptables = '/usr/sbin/iptables' +ip6tables = '/usr/sbin/ip6tables' +dmidecode = '/usr/sbin/dmidecode' +ebtables = '/sbin/ebtables' +dnsmasq = '/usr/bin/dnsmasq' +EOF +} + +ALLOW_EMPTY:${PN} = "1" +INSANE_SKIP:${PN} += "empty-dirs" + +PACKAGES =+ "${PN}-libvirtd ${PN}-virsh" + +ALLOW_EMPTY:${PN}-libvirtd = "1" + +FILES:${PN}-libvirtd = " \ + ${sysconfdir}/init.d \ + ${sysconfdir}/sysctl.d \ + ${sysconfdir}/logrotate.d \ + ${sysconfdir}/libvirt/libvirtd.conf \ + /usr/lib/sysctl.d/60-libvirtd.conf \ + /usr/lib/sysctl.d/60-qemu-postcopy-migration.conf \ + ${sbindir}/libvirtd \ + ${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)} \ + " + +FILES:${PN}-virsh = " \ + ${bindir}/virsh \ + ${datadir}/bash-completion/completions/virsh \ +" + +FILES:${PN} += "${libdir}/libvirt/connection-driver \ + ${datadir}/augeas \ + ${@bb.utils.contains('PACKAGECONFIG', 'polkit', '${datadir}/polkit-1', '', d)} \ + ${datadir}/bash-completion/completions/vsh \ + ${datadir}/bash-completion/completions/virt-admin \ + /usr/lib/firewalld/ \ + " + +FILES:${PN}-dbg += "${libdir}/libvirt/connection-driver/.debug ${libdir}/libvirt/lock-driver/.debug" +FILES:${PN}-staticdev += "${libdir}/*.a ${libdir}/libvirt/connection-driver/*.a ${libdir}/libvirt/lock-driver/*.a" + +CONFFILES:${PN} += "${sysconfdir}/libvirt/libvirt.conf \ + ${sysconfdir}/libvirt/lxc.conf \ + ${sysconfdir}/libvirt/qemu-lockd.conf \ + ${sysconfdir}/libvirt/qemu.conf \ + ${sysconfdir}/libvirt/virt-login-shell.conf \ + ${sysconfdir}/libvirt/virtlockd.conf" + +CONFFILES:${PN}-libvirtd = "${sysconfdir}/logrotate.d/libvirt ${sysconfdir}/logrotate.d/libvirt.lxc \ + ${sysconfdir}/logrotate.d/libvirt.qemu ${sysconfdir}/logrotate.d/libvirt.uml \ + ${sysconfdir}/libvirt/libvirtd.conf \ + /usr/lib/sysctl.d/libvirtd.conf" + +INITSCRIPT_PACKAGES = "${PN}-libvirtd" +INITSCRIPT_NAME:${PN}-libvirtd = "libvirtd" +INITSCRIPT_PARAMS:${PN}-libvirtd = "defaults 72" + +SYSTEMD_PACKAGES = "${PN}-libvirtd" +SYSTEMD_SERVICE:${PN}-libvirtd = " \ + libvirtd.service \ + virtlockd.service \ + libvirt-guests.service \ + virtlockd.socket \ + " + +# xen-minimal config +#PACKAGECONFIG ??= "xen libxl xen-inotify test remote libvirtd" + +# full config +PACKAGECONFIG ??= "gnutls qemu yajl openvz vmware vbox esx lxc test remote \ + libvirtd netcf udev python fuse firewalld libpcap \ + ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux audit libcap-ng', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'libxl', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'polkit', 'polkit', '', d)} \ + " + +# qemu is NOT compatible with mips64, powerpc and riscv32 +PACKAGECONFIG:remove:mipsarchn32 = "qemu" +PACKAGECONFIG:remove:mipsarchn64 = "qemu" +PACKAGECONFIG:remove:powerpc = "qemu" +PACKAGECONFIG:remove:riscv32 = "qemu" + +# numactl is NOT compatible with arm +PACKAGECONFIG:remove:arm = "numactl" +PACKAGECONFIG:remove:armeb = "numactl" + +# enable,disable,depends,rdepends +# +PACKAGECONFIG[gnutls] = ",,,gnutls-bin" +PACKAGECONFIG[qemu] = "-Ddriver_qemu=enabled -Dqemu_user=qemu -Dqemu_group=qemu,-Ddriver_qemu=disabled,qemu," +PACKAGECONFIG[yajl] = "-Dyajl=enabled,-Dyajl=disabled,yajl,yajl" +PACKAGECONFIG[libxl] = "-Ddriver_libxl=enabled,-Ddriver_libxl=disabled,xen," +PACKAGECONFIG[openvz] = "-Ddriver_openvz=enabled,-Ddriver_openvz=disabled,," +PACKAGECONFIG[vmware] = "-Ddriver_vmware=enabled,-Ddriver_vmware=disabled,," +PACKAGECONFIG[vbox] = "-Ddriver_vbox=enabled,-Ddriver_vbox=disabled,," +PACKAGECONFIG[esx] = "-Ddriver_esx=enabled,-Ddriver_esx=disabled,," +PACKAGECONFIG[hyperv] = "-Ddriver_hyperv=enabled,-Ddriver_hyperv=disabled,," +PACKAGECONFIG[polkit] = "-Dpolkit=enabled,-Dpolkit=disabled,polkit,polkit" +PACKAGECONFIG[lxc] = "-Ddriver_lxc=enabled,-Ddriver_lxc=disabled,lxc," +PACKAGECONFIG[test] = "-Ddriver_test=enabled,-Ddriver_test=disabled,," +PACKAGECONFIG[remote] = "-Ddriver_remote=enabled,-Ddriver_remote=disabled,," +PACKAGECONFIG[libvirtd] = "-Ddriver_libvirtd=enabled,-Ddriver_libvirtd=disabled,," +PACKAGECONFIG[netcf] = "-Dnetcf=enabled,-Dnetcf=disabled,netcf,netcf" +PACKAGECONFIG[dtrace] = "-Ddtrace=enabled,-Ddtrace=disabled,," +PACKAGECONFIG[udev] = "-Dudev=enabled -Dpciaccess=enabled,-Dudev=disabled,udev libpciaccess," +PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux," +PACKAGECONFIG[python] = ",,python3," +PACKAGECONFIG[sasl] = "-Dsasl=enabled,-Dsasl=disabled,cyrus-sasl,cyrus-sasl" +PACKAGECONFIG[numactl] = "-Dnumactl=enabled,-Dnumactl=disabled,numactl," +PACKAGECONFIG[fuse] = "-Dfuse=enabled,-Dfuse=disabled,fuse3," +PACKAGECONFIG[audit] = "-Daudit=enabled,-Daudit=disabled,audit," +PACKAGECONFIG[libcap-ng] = "-Dcapng=enabled,-Dcapng=disabled,libcap-ng," +PACKAGECONFIG[wireshark] = "-Dwireshark_dissector=enabled,-Dwireshark_dissector=disabled,wireshark libwsutil," +PACKAGECONFIG[apparmor_profiles] = "-Dapparmor_profiles=enabled, -Dapparmor_profiles=disabled," +PACKAGECONFIG[firewalld] = "-Dfirewalld=enabled, -Dfirewalld=disabled," +PACKAGECONFIG[libpcap] = "-Dlibpcap=enabled, -Dlibpcap=disabled,libpcap,libpcap" +PACKAGECONFIG[numad] = "-Dnumad=enabled, -Dnumad=disabled," + +# Enable the Python tool support +require libvirt-python.inc + +do_compile() { + cd ${B}/src + # There may be race condition, but without creating these directories + # in the source tree, generation of files fails. + for i in access admin logging esx locking rpc hyperv lxc \ + remote network storage interface nwfilter node_device \ + secret vbox qemu; do + mkdir -p $i; + done + + cd ${B} + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${B}/src:" + ninja all +} + +do_install:prepend() { + # so the install routines can find the libvirt.pc in the source dir + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${B}/src:" +} + +do_install:append() { + install -d ${D}/etc/init.d + install -d ${D}/etc/libvirt + install -d ${D}/etc/dnsmasq.d + + install -m 0755 ${UNPACKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd + install -m 0644 ${UNPACKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf + + if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then + # This will wind up in the libvirtd package, but will NOT be invoked by default. + # + mv ${D}/${libexecdir}/libvirt-guests.sh ${D}/${sysconfdir}/init.d + fi + + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + 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 + + # We can't use 'notify' when we don't support 'sd_notify' dbus capabilities. + # Change default LIBVIRTD_ARGS to start libvirtd in the right mode. + sed -i -e 's/Type=notify/Type=forking/' \ + -e '/Type=forking/a PIDFile=/run/libvirtd.pid' \ + -e 's/\(Environment=LIBVIRTD_ARGS="--timeout 120"\)/#\1\nEnvironment=LIBVIRTD_ARGS="--listen --daemon"/' \ + ${D}/${systemd_system_unitdir}/libvirtd.service + fi + + # The /run/libvirt directories created by the Makefile are + # wiped out in volatile, we need to create these at boot. + rm -rf ${D}/run + install -d ${D}${sysconfdir}/default/volatiles + echo "d root root 0755 /run/libvirt none" \ + > ${D}${sysconfdir}/default/volatiles/99_libvirt + echo "d root root 0755 /run/libvirt/lockd none" \ + >> ${D}${sysconfdir}/default/volatiles/99_libvirt + echo "d root root 0755 /run/libvirt/lxc none" \ + >> ${D}${sysconfdir}/default/volatiles/99_libvirt + echo "d root root 0755 /run/libvirt/network none" \ + >> ${D}${sysconfdir}/default/volatiles/99_libvirt + echo "d root root 0755 /run/libvirt/qemu none" \ + >> ${D}${sysconfdir}/default/volatiles/99_libvirt + + # Manually set permissions and ownership to match polkit recipe + if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then + install -d -m 0700 ${D}/${datadir}/polkit-1/rules.d + chown polkitd ${D}/${datadir}/polkit-1/rules.d + chgrp root ${D}/${datadir}/polkit-1/rules.d + else + rm -rf ${D}/${datadir}/polkit-1 + fi + + # disable seccomp_sandbox + if [ -e ${D}${sysconfdir}/libvirt/qemu.conf ] ; then + 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 + for hook in "daemon" "lxc" "network" "qemu" + do + install -m 0755 ${UNPACKDIR}/hook_support.py ${D}/etc/libvirt/hooks/${hook} + done + + # Force the main dnsmasq instance to bind only to specified interfaces and + # to not bind to virbr0. Libvirt will run its own instance on this interface. + install -m 644 ${UNPACKDIR}/dnsmasq.conf ${D}/${sysconfdir}/dnsmasq.d/libvirt-daemon + + # remove .la references to our working diretory + for i in `find ${D}${libdir} -type f -name *.la`; do + sed -i -e 's#-L${B}/src/.libs##g' $i + done + + sed -i -e 's/^\(unix_sock_group\ =\ \).*/\1"kvm"/' ${D}/etc/libvirt/libvirtd.conf + sed -i -e 's/^\(unix_sock_rw_perms\ =\ \).*/\1"0776"/' ${D}/etc/libvirt/libvirtd.conf + + case ${MACHINE_ARCH} in + *mips*) + break + ;; + *) + if ${@bb.utils.contains('PACKAGECONFIG', 'qemu', 'true', 'false', d)}; then + chown -R qemu:qemu ${D}/${localstatedir}/lib/libvirt/qemu + echo "d qemu qemu 0755 ${localstatedir}/cache/libvirt/qemu none" \ + >> ${D}${sysconfdir}/default/volatiles/99_libvirt + break + fi + ;; + esac + + if ${@bb.utils.contains('PACKAGECONFIG','gnutls','true','false',d)}; then + # Generate sample keys and certificates. + ${S}/gnutls-helper.py -y + + # Deploy all sample keys and certificates of CA, server and client + # to target so that libvirtd is able to boot successfully and local + # connection via 127.0.0.1 is available out of box. + install -d ${D}/etc/pki/CA + install -d ${D}/etc/pki/libvirt/private + install -m 0755 ${S}/gnutls-helper.py ${D}/${bindir} + install -m 0644 cakey.pem ${D}/${sysconfdir}/pki/libvirt/private/cakey.pem + install -m 0644 cacert.pem ${D}/${sysconfdir}/pki/CA/cacert.pem + install -m 0644 serverkey.pem ${D}/${sysconfdir}/pki/libvirt/private/serverkey.pem + install -m 0644 servercert.pem ${D}/${sysconfdir}/pki/libvirt/servercert.pem + install -m 0644 clientkey.pem ${D}/${sysconfdir}/pki/libvirt/private/clientkey.pem + install -m 0644 clientcert.pem ${D}/${sysconfdir}/pki/libvirt/clientcert.pem + + # Force the connection to be tls. + sed -i -e 's/^\(listen_tls\ =\ .*\)/#\1/' -e 's/^\(listen_tcp\ =\ .*\)/#\1/' ${D}/etc/libvirt/libvirtd.conf + fi + + # virt-login-shell needs to run with setuid permission + chmod 4755 ${D}${bindir}/virt-login-shell +} + +EXTRA_OEMESON += " \ + -Dinit_script=${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','none', d)} \ + -Drunstatedir=/run \ + -Dtests=enabled \ + " + +# gcc9 end up mis-compiling qemuxml2argvtest.o with Og which then +# crashes on target, so remove -Og and use -O2 as workaround +SELECTED_OPTIMIZATION:remove:virtclass-multilib-lib32:mipsarch = "-Og" +SELECTED_OPTIMIZATION:append:virtclass-multilib-lib32:mipsarch = " -O2" + +pkg_postinst:${PN}() { + if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then + /etc/init.d/populate-volatile.sh update + fi + mkdir -m 711 -p $D/data/images +} + +python () { + if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): + d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") +} diff --git a/recipes-extended/libvirt/libvirt_6.3.0.bb b/recipes-extended/libvirt/libvirt_6.3.0.bb deleted file mode 100644 index 229c56eb..00000000 --- a/recipes-extended/libvirt/libvirt_6.3.0.bb +++ /dev/null @@ -1,415 +0,0 @@ -DESCRIPTION = "A toolkit to interact with the virtualization capabilities of recent versions of Linux." -HOMEPAGE = "http://libvirt.org" -LICENSE = "LGPLv2.1+ & GPLv2+" -LICENSE_${PN}-ptest = "GPLv2+ & LGPLv2.1+" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://COPYING.LESSER;md5=4b54a1fd55a448865a0b32d41598759d" -SECTION = "console/tools" - -DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \ - iptables dnsmasq readline libtasn1 libxslt-native acl libdevmapper libtirpc \ - python3-docutils-native \ - ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'shadow-native', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'gnutls', 'gnutls-native', '', d)}" - -# libvirt-guests.sh needs gettext.sh -# -RDEPENDS_${PN} = "gettext-runtime" - -RDEPENDS_${PN}-ptest += "make gawk perl bash" - -RDEPENDS_libvirt-libvirtd += "bridge-utils iptables pm-utils dnsmasq netcat-openbsd" -RDEPENDS_libvirt-libvirtd_append_x86-64 = " dmidecode" -RDEPENDS_libvirt-libvirtd_append_x86 = " dmidecode" - -#connman blocks the 53 port and libvirtd can't start its DNS service -RCONFLICTS_${PN}_libvirtd = "connman" - -SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.xz;name=libvirt \ - file://tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch \ - file://libvirtd.sh \ - file://libvirtd.conf \ - file://dnsmasq.conf \ - file://runptest.patch \ - file://run-ptest \ - file://libvirt-use-pkg-config-to-locate-libcap.patch \ - file://0001-to-fix-build-error.patch \ - file://install-missing-file.patch \ - file://0001-ptest-Remove-Windows-1252-check-from-esxutilstest.patch \ - file://configure.ac-search-for-rpc-rpc.h-in-the-sysroot.patch \ - file://0001-build-drop-unnecessary-libgnu.la-reference.patch \ - file://hook_support.py \ - file://gnutls-helper.py \ - " - -SRC_URI[libvirt.md5sum] = "1bd4435f77924f5ec9928b538daf4a02" -SRC_URI[libvirt.sha256sum] = "74069438d34082336e99a88146349e21130552b96efc3b7c562f6878127996f5" - -inherit autotools gettext update-rc.d pkgconfig ptest systemd useradd perlnative -USERADD_PACKAGES = "${PN}" -GROUPADD_PARAM_${PN} = "-r qemu; -r kvm" -USERADD_PARAM_${PN} = "-r -g qemu -G kvm qemu" - -# Override the default set in autotools.bbclass so that we will use relative pathnames -# to our local m4 files. This prevents an "Argument list too long" error during configuration -# if our project is in a directory with an absolute pathname of more than about 125 characters. -# -acpaths = "-I ./m4" - -CACHED_CONFIGUREVARS += "\ -ac_cv_path_XMLCATLOG=/usr/bin/xmlcatalog \ -ac_cv_path_AUGPARSE=/usr/bin/augparse \ -ac_cv_path_DNSMASQ=/usr/bin/dnsmasq \ -ac_cv_path_BRCTL=/usr/sbin/brctl \ -ac_cv_path_TC=/sbin/tc \ -ac_cv_path_UDEVADM=/sbin/udevadm \ -ac_cv_path_MODPROBE=/sbin/modprobe \ -ac_cv_path_IP_PATH=/bin/ip \ -ac_cv_path_IPTABLES_PATH=/usr/sbin/iptables \ -ac_cv_path_IP6TABLES_PATH=/usr/sbin/ip6tables \ -ac_cv_path_MOUNT=/bin/mount \ -ac_cv_path_UMOUNT=/bin/umount \ -ac_cv_path_MKFS=/usr/sbin/mkfs \ -ac_cv_path_SHOWMOUNT=/usr/sbin/showmount \ -ac_cv_path_PVCREATE=/usr/sbin/pvcreate \ -ac_cv_path_VGCREATE=/usr/sbin/vgcreate \ -ac_cv_path_LVCREATE=/usr/sbin/lvcreate \ -ac_cv_path_PVREMOVE=/usr/sbin/pvremove \ -ac_cv_path_VGREMOVE=/usr/sbin/vgremove \ -ac_cv_path_LVREMOVE=/usr/sbin/lvremove \ -ac_cv_path_LVCHANGE=/usr/sbin/lvchange \ -ac_cv_path_VGCHANGE=/usr/sbin/vgchange \ -ac_cv_path_VGSCAN=/usr/sbin/vgscan \ -ac_cv_path_PVS=/usr/sbin/pvs \ -ac_cv_path_VGS=/usr/sbin/vgs \ -ac_cv_path_LVS=/usr/sbin/lvs \ -ac_cv_path_PARTED=/usr/sbin/parted \ -ac_cv_path_DMSETUP=/usr/sbin/dmsetup" - -# Ensure that libvirt uses polkit rather than policykit, whether the host has -# pkcheck installed or not, and ensure the path is correct per our config. -CACHED_CONFIGUREVARS += "ac_cv_path_PKCHECK_PATH=${bindir}/pkcheck" - -# Some other possible paths we are not yet setting -#ac_cv_path_RPCGEN= -#ac_cv_path_XSLTPROC= -#ac_cv_path_RADVD= -#ac_cv_path_UDEVSETTLE= -#ac_cv_path_EBTABLES_PATH= -#ac_cv_path_PKG_CONFIG= -#ac_cv_path_ac_pt_PKG_CONFIG -#ac_cv_path_POLKIT_AUTH= -#ac_cv_path_DTRACE= -#ac_cv_path_ISCSIADM= -#ac_cv_path_MSGFMT= -#ac_cv_path_GMSGFMT= -#ac_cv_path_XGETTEXT= -#ac_cv_path_MSGMERGE= -#ac_cv_path_SCRUB= -#ac_cv_path_PYTHON= - -ALLOW_EMPTY_${PN} = "1" - -PACKAGES =+ "${PN}-libvirtd ${PN}-virsh" - -ALLOW_EMPTY_${PN}-libvirtd = "1" - -FILES_${PN}-libvirtd = " \ - ${sysconfdir}/init.d \ - ${sysconfdir}/sysctl.d \ - ${sysconfdir}/logrotate.d \ - ${sysconfdir}/libvirt/libvirtd.conf \ - /usr/lib/sysctl.d/60-libvirtd.conf \ - ${sbindir}/libvirtd \ - ${systemd_unitdir}/system/* \ - ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', '${libexecdir}/libvirt-guests.sh', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'gnutls', '${sysconfdir}/pki/libvirt/* ${sysconfdir}/pki/CA/*', '', d)} \ - " - -FILES_${PN}-virsh = " \ - ${bindir}/virsh \ - ${datadir}/bash-completion/completions/virsh \ -" - -FILES_${PN} += "${libdir}/libvirt/connection-driver \ - ${datadir}/augeas \ - ${@bb.utils.contains('PACKAGECONFIG', 'polkit', '${datadir}/polkit-1', '', d)} \ - ${datadir}/bash-completion/completions/vsh \ - ${datadir}/bash-completion/completions/virt-admin \ - /usr/lib/firewalld/zones/libvirt.xml \ - " - -FILES_${PN}-dbg += "${libdir}/libvirt/connection-driver/.debug ${libdir}/libvirt/lock-driver/.debug" -FILES_${PN}-staticdev += "${libdir}/*.a ${libdir}/libvirt/connection-driver/*.a ${libdir}/libvirt/lock-driver/*.a" - -CONFFILES_${PN} += "${sysconfdir}/libvirt/libvirt.conf \ - ${sysconfdir}/libvirt/lxc.conf \ - ${sysconfdir}/libvirt/qemu-lockd.conf \ - ${sysconfdir}/libvirt/qemu.conf \ - ${sysconfdir}/libvirt/virt-login-shell.conf \ - ${sysconfdir}/libvirt/virtlockd.conf" - -CONFFILES_${PN}-libvirtd = "${sysconfdir}/logrotate.d/libvirt ${sysconfdir}/logrotate.d/libvirt.lxc \ - ${sysconfdir}/logrotate.d/libvirt.qemu ${sysconfdir}/logrotate.d/libvirt.uml \ - ${sysconfdir}/libvirt/libvirtd.conf \ - /usr/lib/sysctl.d/libvirtd.conf" - -INITSCRIPT_PACKAGES = "${PN}-libvirtd" -INITSCRIPT_NAME_${PN}-libvirtd = "libvirtd" -INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72" - -SYSTEMD_PACKAGES = "${PN}-libvirtd" -SYSTEMD_SERVICE_${PN}-libvirtd = " \ - libvirtd.service \ - virtlockd.service \ - libvirt-guests.service \ - virtlockd.socket \ - " - - -PRIVATE_LIBS_${PN}-ptest = " \ - libvirt-lxc.so.0 \ - libvirt.so.0 \ - libvirt-qemu.so.0 \ - lockd.so \ - libvirt_driver_secret.so \ - libvirt_driver_nodedev.so \ - libvirt_driver_vbox.so \ - libvirt_driver_interface.so \ - libvirt_driver_uml.so \ - libvirt_driver_network.so \ - libvirt_driver_nwfilter.so \ - libvirt_driver_qemu.so \ - libvirt_driver_storage.so \ - libvirt_driver_lxc.so \ - " - -# xen-minimal config -#PACKAGECONFIG ??= "xen libxl xen-inotify test remote libvirtd" - -# full config -PACKAGECONFIG ??= "qemu yajl openvz vmware vbox esx iproute2 lxc test \ - remote macvtap libvirtd netcf udev python ebtables \ - fuse iproute2 firewalld libpcap \ - ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux audit libcap-ng', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'libxl', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'polkit', 'polkit', '', d)} \ - " - -# qemu is NOT compatible with mips64 -PACKAGECONFIG_remove_mipsarchn32 = "qemu" -PACKAGECONFIG_remove_mipsarchn64 = "qemu" - -# numactl is NOT compatible with arm -PACKAGECONFIG_remove_arm = "numactl" -PACKAGECONFIG_remove_armeb = "numactl" - -# enable,disable,depends,rdepends -# -PACKAGECONFIG[gnutls] = ",,,gnutls-bin" -PACKAGECONFIG[qemu] = "--with-qemu --with-qemu-user=qemu --with-qemu-group=qemu,--without-qemu,qemu," -PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl" -PACKAGECONFIG[libxl] = "--with-libxl=${STAGING_DIR_TARGET}/lib,--without-libxl,xen," -PACKAGECONFIG[openvz] = "--with-openvz,--without-openvz,," -PACKAGECONFIG[vmware] = "--with-vmware,--without-vmware,," -PACKAGECONFIG[vbox] = "--with-vbox,--without-vbox,," -PACKAGECONFIG[esx] = "--with-esx,--without-esx,," -PACKAGECONFIG[hyperv] = "--with-hyperv,--without-hyperv,," -PACKAGECONFIG[polkit] = "--with-polkit,--without-polkit,polkit,polkit" -PACKAGECONFIG[lxc] = "--with-lxc,--without-lxc, lxc," -PACKAGECONFIG[test] = "--with-test=yes,--with-test=no,," -PACKAGECONFIG[remote] = "--with-remote,--without-remote,," -PACKAGECONFIG[macvtap] = "--with-macvtap=yes,--with-macvtap=no,libnl,libnl" -PACKAGECONFIG[libvirtd] = "--with-libvirtd,--without-libvirtd,," -PACKAGECONFIG[netcf] = "--with-netcf,--without-netcf,netcf,netcf" -PACKAGECONFIG[dtrace] = "--with-dtrace,--without-dtrace,," -PACKAGECONFIG[udev] = "--with-udev --with-pciaccess,--without-udev,udev libpciaccess," -PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux," -PACKAGECONFIG[ebtables] = "ac_cv_path_EBTABLES_PATH=/sbin/ebtables,ac_cv_path_EBTABLES_PATH=,ebtables,ebtables" -PACKAGECONFIG[python] = ",,python3," -PACKAGECONFIG[sasl] = "--with-sasl,--without-sasl,cyrus-sasl,cyrus-sasl" -PACKAGECONFIG[iproute2] = "ac_cv_path_IP_PATH=/sbin/ip,ac_cv_path_IP_PATH=,iproute2,iproute2" -PACKAGECONFIG[numactl] = "--with-numactl,--without-numactl,numactl," -PACKAGECONFIG[fuse] = "--with-fuse,--without-fuse,fuse," -PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit," -PACKAGECONFIG[libcap-ng] = "--with-capng,--without-capng,libcap-ng," -PACKAGECONFIG[wireshark] = "--with-wireshark-dissector,--without-wireshark-dissector,wireshark libwsutil," -PACKAGECONFIG[apparmor-profiles] = "--with-apparmor-profiles, --without-apparmor-profiles," -PACKAGECONFIG[firewalld] = "--with-firewalld, --without-firewalld," -PACKAGECONFIG[libpcap] = "--with-libpcap, --without-libpcap,libpcap,libpcap" -PACKAGECONFIG[numad] = "--with-numad, --without-numad," - -# Enable the Python tool support -require libvirt-python.inc - -do_compile() { - cd ${B}/src - # There may be race condition, but without creating these directories - # in the source tree, generation of files fails. - for i in access admin logging esx locking rpc hyperv lxc \ - remote network storage interface nwfilter node_device \ - secret vbox qemu; do - mkdir -p $i; - done - - cd ${B} - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${B}/src:" - oe_runmake all -} - -do_install_prepend() { - # so the install routines can find the libvirt.pc in the source dir - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${B}/src:" -} - -do_install_append() { - install -d ${D}/etc/init.d - install -d ${D}/etc/libvirt - install -d ${D}/etc/dnsmasq.d - - install -m 0755 ${WORKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd - install -m 0644 ${WORKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf - - if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then - # This will wind up in the libvirtd package, but will NOT be invoked by default. - # - mv ${D}/${libexecdir}/libvirt-guests.sh ${D}/${sysconfdir}/init.d - fi - - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - # 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=${localstatedir}/run/libvirtd.pid' \ - ${D}/${systemd_unitdir}/system/libvirtd.service - fi - - # The /var/run/libvirt directories created by the Makefile - # are wiped out in volatile, we need to create these at boot. - rm -rf ${D}${localstatedir}/run - install -d ${D}${sysconfdir}/default/volatiles - echo "d root root 0755 ${localstatedir}/run/libvirt none" \ - > ${D}${sysconfdir}/default/volatiles/99_libvirt - echo "d root root 0755 ${localstatedir}/run/libvirt/lockd none" \ - >> ${D}${sysconfdir}/default/volatiles/99_libvirt - echo "d root root 0755 ${localstatedir}/run/libvirt/lxc none" \ - >> ${D}${sysconfdir}/default/volatiles/99_libvirt - echo "d root root 0755 ${localstatedir}/run/libvirt/network none" \ - >> ${D}${sysconfdir}/default/volatiles/99_libvirt - echo "d root root 0755 ${localstatedir}/run/libvirt/qemu none" \ - >> ${D}${sysconfdir}/default/volatiles/99_libvirt - - # Manually set permissions and ownership to match polkit recipe - if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then - install -d -m 0700 ${D}/${datadir}/polkit-1/rules.d - chown polkitd ${D}/${datadir}/polkit-1/rules.d - chgrp root ${D}/${datadir}/polkit-1/rules.d - else - rm -rf ${D}/${datadir}/polkit-1 - fi - - # disable seccomp_sandbox - if [ -e ${D}${sysconfdir}/libvirt/qemu.conf ] ; then - 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 - for hook in "daemon" "lxc" "network" "qemu" - do - install -m 0755 ${WORKDIR}/hook_support.py ${D}/etc/libvirt/hooks/${hook} - done - - # Force the main dnsmasq instance to bind only to specified interfaces and - # to not bind to virbr0. Libvirt will run its own instance on this interface. - install -m 644 ${WORKDIR}/dnsmasq.conf ${D}/${sysconfdir}/dnsmasq.d/libvirt-daemon - - # remove .la references to our working diretory - for i in `find ${D}${libdir} -type f -name *.la`; do - sed -i -e 's#-L${B}/src/.libs##g' $i - done - - sed -i -e 's/^\(unix_sock_group\ =\ \).*/\1"kvm"/' ${D}/etc/libvirt/libvirtd.conf - sed -i -e 's/^\(unix_sock_rw_perms\ =\ \).*/\1"0776"/' ${D}/etc/libvirt/libvirtd.conf - - case ${MACHINE_ARCH} in - *mips*) - break - ;; - *) - chown -R qemu:qemu ${D}/${localstatedir}/lib/libvirt/qemu - echo "d qemu qemu 0755 ${localstatedir}/cache/libvirt/qemu none" \ - >> ${D}${sysconfdir}/default/volatiles/99_libvirt - break - ;; - esac - - if ${@bb.utils.contains('PACKAGECONFIG','gnutls','true','false',d)}; then - # Generate sample keys and certificates. - cd ${WORKDIR} - ${WORKDIR}/gnutls-helper.py -y - - # Deploy all sample keys and certificates of CA, server and client - # to target so that libvirtd is able to boot successfully and local - # connection via 127.0.0.1 is available out of box. - install -d ${D}/etc/pki/CA - install -d ${D}/etc/pki/libvirt/private - install -m 0755 ${WORKDIR}/gnutls-helper.py ${D}/${bindir} - install -m 0644 ${WORKDIR}/cakey.pem ${D}/${sysconfdir}/pki/libvirt/private/cakey.pem - install -m 0644 ${WORKDIR}/cacert.pem ${D}/${sysconfdir}/pki/CA/cacert.pem - install -m 0644 ${WORKDIR}/serverkey.pem ${D}/${sysconfdir}/pki/libvirt/private/serverkey.pem - install -m 0644 ${WORKDIR}/servercert.pem ${D}/${sysconfdir}/pki/libvirt/servercert.pem - install -m 0644 ${WORKDIR}/clientkey.pem ${D}/${sysconfdir}/pki/libvirt/private/clientkey.pem - install -m 0644 ${WORKDIR}/clientcert.pem ${D}/${sysconfdir}/pki/libvirt/clientcert.pem - - # Force the connection to be tls. - sed -i -e 's/^\(listen_tls\ =\ .*\)/#\1/' -e 's/^\(listen_tcp\ =\ .*\)/#\1/' ${D}/etc/libvirt/libvirtd.conf - fi - - # virt-login-shell needs to run with setuid permission - chmod 4755 ${D}${bindir}/virt-login-shell -} - -EXTRA_OECONF += " \ - --with-init-script=systemd \ - --with-test-suite \ - " - -# gcc9 end up mis-compiling qemuxml2argvtest.o with Og which then -# crashes on target, so remove -Og and use -O2 as workaround -SELECTED_OPTIMIZATION_remove_virtclass-multilib-lib32_mipsarch = "-Og" -SELECTED_OPTIMIZATION_append_virtclass-multilib-lib32_mipsarch = " -O2" - -EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH} SYSTEMD_UNIT_DIR=${systemd_system_unitdir}" - -PRIVATE_LIBS_${PN}-ptest_append = "libvirt-admin.so.0" - -do_compile_ptest() { - oe_runmake -C tests buildtest-TESTS -} - -do_install_ptest() { - oe_runmake -C tests install-ptest - - find ${S}/tests -maxdepth 1 -type d -exec cp -r {} ${D}${PTEST_PATH}/tests/ \; - - # remove .la files for ptest, they aren't required and can trigger QA errors - for i in `find ${D}${PTEST_PATH} -type f \( -name *.la -o -name *.o \)`; do - rm -f $i - done -} - -pkg_postinst_${PN}() { - if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then - /etc/init.d/populate-volatile.sh update - fi - mkdir -m 711 -p $D/data/images -} - -python () { - if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): - d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") -} |