From 8e634ac487386b8d7e4d7ec26f9aa367ce7d9738 Mon Sep 17 00:00:00 2001 From: Dengke Du Date: Thu, 9 May 2019 17:53:28 +0800 Subject: libvirt: upgrade to 5.3.0 1. remove the uml configure option because new version libvirt drop it 2. rebase three patches for new source codes Signed-off-by: Dengke Du Signed-off-by: Bruce Ashfield --- recipes-extended/libvirt/libvirt-python.inc | 4 +- .../libvirt/libvirt/install-missing-file.patch | 17 +- recipes-extended/libvirt/libvirt/runptest.patch | 56 ++-- ...ibvirt-net-rpc-to-virt-host-validate-when.patch | 33 +- recipes-extended/libvirt/libvirt_4.9.0.bb | 347 --------------------- recipes-extended/libvirt/libvirt_5.3.0.bb | 347 +++++++++++++++++++++ 6 files changed, 395 insertions(+), 409 deletions(-) delete mode 100644 recipes-extended/libvirt/libvirt_4.9.0.bb create mode 100644 recipes-extended/libvirt/libvirt_5.3.0.bb diff --git a/recipes-extended/libvirt/libvirt-python.inc b/recipes-extended/libvirt/libvirt-python.inc index ae43ba80..95543282 100644 --- a/recipes-extended/libvirt/libvirt-python.inc +++ b/recipes-extended/libvirt/libvirt-python.inc @@ -18,8 +18,8 @@ FILES_${PN}-python = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*" SRC_URI += "http://libvirt.org/sources/python/libvirt-python-${PV}.tar.gz;name=libvirt_python" SRC_URI += "file://libvirt_api_xml_path.patch;patchdir=../libvirt-python-${PV}" -SRC_URI[libvirt_python.md5sum] = "cba7dc90d564aa8c267c38d452b83f80" -SRC_URI[libvirt_python.sha256sum] = "01c4becf50b521a9e3d1b48a3a79d83cb389d86d760b895d911d78f5b6ae7b60" +SRC_URI[libvirt_python.md5sum] = "b7e086e080e5681bece9e87db5a88afa" +SRC_URI[libvirt_python.sha256sum] = "5213f995cb55a2f770aa36704b60313958c7ff1fde8cca39028ea889cc9f30ff" export LIBVIRT_API_PATH = "${S}/docs/libvirt-api.xml" export LIBVIRT_CFLAGS = "-I${S}/include" diff --git a/recipes-extended/libvirt/libvirt/install-missing-file.patch b/recipes-extended/libvirt/libvirt/install-missing-file.patch index cb5a20e3..94c72998 100644 --- a/recipes-extended/libvirt/libvirt/install-missing-file.patch +++ b/recipes-extended/libvirt/libvirt/install-missing-file.patch @@ -1,6 +1,6 @@ -From 0780181a3285511f166487a54ebc231fc657edfe Mon Sep 17 00:00:00 2001 -From: Catalin Enache -Date: Mon, 25 Jul 2016 16:38:51 +0300 +From 4aea9dbeb7f7990ac5a2227d80251570b4a5bca1 Mon Sep 17 00:00:00 2001 +From: Dengke Du +Date: Wed, 8 May 2019 17:24:17 +0800 Subject: [PATCH] Install missing conf file openvzutilstest.conf file is needed by openvzutilstest test. @@ -12,15 +12,17 @@ Signed-off-by: Catalin Enache Signed-off-by: Kai Kang [MA: Update context for v4.3.0] Signed-off-by: Mark Asselstine +[DDU: Update context for v5.3.0] +Signed-off-by: Dengke Du --- tests/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Makefile.am b/tests/Makefile.am -index 65f776e..8a6fd44 100644 +index 7d0387e..68c3561 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am -@@ -173,6 +173,7 @@ EXTRA_DIST = \ +@@ -168,6 +168,7 @@ EXTRA_DIST = \ $(NULL) test_helpers = commandhelper ssh @@ -28,7 +30,7 @@ index 65f776e..8a6fd44 100644 test_programs = virshtest sockettest \ virhostcputest virbuftest \ commandtest seclabeltest \ -@@ -305,6 +306,7 @@ endif WITH_LXC +@@ -303,6 +304,7 @@ endif WITH_LXC if WITH_OPENVZ test_programs += openvzutilstest @@ -36,7 +38,7 @@ index 65f776e..8a6fd44 100644 endif WITH_OPENVZ if WITH_ESX -@@ -1488,7 +1490,7 @@ endif ! WITH_CIL +@@ -1539,7 +1541,7 @@ endif ! WITH_CIL buildtest-TESTS: $(TESTS) $(test_libraries) $(test_helpers) @@ -45,7 +47,6 @@ index 65f776e..8a6fd44 100644 install-ptest: list='$(TESTS) $(test_helpers) test-lib.sh virschematest' - -- 2.7.4 diff --git a/recipes-extended/libvirt/libvirt/runptest.patch b/recipes-extended/libvirt/libvirt/runptest.patch index 457e8218..bc97ba61 100644 --- a/recipes-extended/libvirt/libvirt/runptest.patch +++ b/recipes-extended/libvirt/libvirt/runptest.patch @@ -1,7 +1,7 @@ -From 94478517c4f9950b28be3a348387db6ede3db812 Mon Sep 17 00:00:00 2001 -From: Mark Asselstine -Date: Mon, 4 Jun 2018 11:55:37 -0400 -Subject: [PATCH] Add 'install-ptest' rule. +From 52fc46b4f8cfd36476f59c0796f4f39686b53953 Mon Sep 17 00:00:00 2001 +From: Dengke Du +Date: Wed, 8 May 2019 10:20:47 +0800 +Subject: [PATCH] Add 'install-ptest' rule Change TESTS_ENVIRONMENT to allow running outside build dir. @@ -15,15 +15,17 @@ Signed-off-by: Mark Asselstine Signed-off-by: He Zhe [MA: Update context for v4.3.0] Signed-off-by: Mark Asselstine +[DDU: Update context for v5.3.0] +Signed-off-by: Dengke Du --- - tests/Makefile.am | 74 +++++++++++++++++++++++++++++++++++++++++++++---------- - 1 file changed, 61 insertions(+), 13 deletions(-) + tests/Makefile.am | 68 ++++++++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 60 insertions(+), 8 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am -index 7b93fbd..edc1eb9 100644 +index 46d94d2..7d0387e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am -@@ -35,11 +35,13 @@ INCLUDES = \ +@@ -29,11 +29,13 @@ AM_CPPFLAGS = \ WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS) @@ -31,50 +33,32 @@ index 7b93fbd..edc1eb9 100644 + AM_CFLAGS = \ - -Dabs_builddir="\"$(abs_builddir)\"" \ -- -Dabs_topbuilddir="\"$(abs_topbuilddir)\"" \ +- -Dabs_top_builddir="\"$(abs_top_builddir)\"" \ - -Dabs_srcdir="\"$(abs_srcdir)\"" \ -- -Dabs_topsrcdir="\"$(abs_topsrcdir)\"" \ +- -Dabs_top_srcdir="\"$(abs_top_srcdir)\"" \ + -Dabs_builddir="\"$(PTEST_DIR)/tests\"" \ -+ -Dabs_topbuilddir="\"$(PTEST_DIR)\"" \ ++ -Dabs_top_builddir="\"$(PTEST_DIR)\"" \ + -Dabs_srcdir="\"$(PTEST_DIR)/tests\"" \ -+ -Dabs_topsrcdir="\"$(PTEST_DIR)\"" \ ++ -Dabs_top_srcdir="\"$(PTEST_DIR)\"" \ $(LIBXML_CFLAGS) \ $(LIBNL_CFLAGS) \ $(GNUTLS_CFLAGS) \ -@@ -64,7 +66,7 @@ QEMULIB_LDFLAGS = \ - $(MINGW_EXTRA_LDFLAGS) +@@ -465,10 +467,10 @@ TESTS = $(test_programs) \ - INCLUDES += \ -- -DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\" -+ -DTEST_DRIVER_DIR=\"$(PTEST_DIR)/src/.libs\" - - PROBES_O = - if WITH_DTRACE_PROBES -@@ -466,17 +468,15 @@ TESTS = $(test_programs) \ - # Also, BSD sh doesn't like 'a=b b=$$a', so we can't use an - # intermediate shell variable, but must do all the expansion in make - --lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd) -- VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT) TESTS_ENVIRONMENT = \ -- abs_top_builddir=$(lv_abs_top_builddir) \ -- abs_top_srcdir=`cd '$(top_srcdir)'; pwd` \ -- abs_builddir=$(abs_builddir) \ -- abs_srcdir=$(abs_srcdir) \ -- CONFIG_HEADER="$(lv_abs_top_builddir)/config.h" \ +- 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" \ -+ CONFIG_HEADER="$(PTEST_DIR)/config.h" \ SHELL="$(SHELL)" \ -- LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \ -+ LIBVIRT_DRIVER_DIR="$(PTEST_DIR)/src/.libs" \ LIBVIRT_AUTOSTART=0 \ LC_ALL=C \ - VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \ -@@ -1486,5 +1486,55 @@ else ! WITH_CIL +@@ -1535,5 +1537,55 @@ else ! WITH_CIL EXTRA_DIST += objectlocking.ml endif ! WITH_CIL 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 index 5f6f9502..d49776c1 100644 --- 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 @@ -1,6 +1,6 @@ -From f73c5c61c921bf773dcba5e4234e23afce5dbe7f Mon Sep 17 00:00:00 2001 -From: Bruce Ashfield -Date: Fri, 2 Aug 2013 11:38:43 -0400 +From ae4b40a1b3cb63a322716b6ad1762d53ada249e1 Mon Sep 17 00:00:00 2001 +From: Dengke Du +Date: Tue, 7 May 2019 15:26:32 +0800 Subject: [PATCH] tools: add libvirt-net-rpc to virt-host-validate when TLS is enabled @@ -13,17 +13,19 @@ Signed-off-by: Bruce Ashfield Signed-off-by: Yunguo Wei [MA: rebase to v4.3.0] Signed-off-by: Mark Asselstine +[ddu: rebase to v5.3.0] +Signed-off-by: Dengke Du --- examples/Makefile.am | 19 +++++++++++++++++++ - tools/Makefile.am | 13 +++++++++++++ - 2 files changed, 32 insertions(+) + tools/Makefile.am | 12 ++++++++++++ + 2 files changed, 31 insertions(+) diff --git a/examples/Makefile.am b/examples/Makefile.am -index 7069d74..c8893e3 100644 +index ee7d3e6..7a5fd73 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am -@@ -39,6 +39,10 @@ LDADD = $(STATIC_BINARIES) $(WARN_CFLAGS) $(COVERAGE_LDFLAGS) \ - $(top_builddir)/src/libvirt.la $(top_builddir)/gnulib/lib/libgnu.la \ +@@ -34,6 +34,10 @@ LDADD = $(STATIC_BINARIES) $(WARN_CFLAGS) \ + $(top_builddir)/src/libvirt.la \ $(top_builddir)/src/libvirt-admin.la +if WITH_GNUTLS @@ -33,7 +35,7 @@ index 7069d74..c8893e3 100644 noinst_PROGRAMS=dominfo/info1 dommigrate/dommigrate domsuspend/suspend \ domtop/domtop hellolibvirt/hellolibvirt object-events/event-test \ openauth/openauth rename/rename admin/list_servers admin/list_clients \ -@@ -70,6 +74,21 @@ admin_logging_SOURCES = admin/logging.c +@@ -65,6 +69,21 @@ admin_logging_SOURCES = admin/logging.c INSTALL_DATA_LOCAL = UNINSTALL_LOCAL = @@ -52,14 +54,14 @@ index 7069d74..c8893e3 100644 + $(NULL) +endif + - if WITH_APPARMOR_PROFILES - apparmordir = $(sysconfdir)/apparmor.d/ - apparmor_DATA = \ + if WITH_NWFILTER + NWFILTER_DIR = "$(DESTDIR)$(sysconfdir)/libvirt/nwfilter" + diff --git a/tools/Makefile.am b/tools/Makefile.am -index 1452d98..204e772 100644 +index c6064de..1ac8445 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am -@@ -188,6 +188,13 @@ virt_host_validate_LDADD = \ +@@ -188,6 +188,12 @@ virt_host_validate_LDADD = \ ../gnulib/lib/libgnu.la \ $(NULL) @@ -68,12 +70,11 @@ index 1452d98..204e772 100644 + ../gnulib/lib/libgnu.la \ + $(NULL) +endif -+ + virt_host_validate_CFLAGS = \ $(AM_CFLAGS) \ $(NULL) -@@ -268,6 +275,12 @@ virt_admin_CFLAGS = \ +@@ -265,6 +271,12 @@ virt_admin_CFLAGS = \ $(READLINE_CFLAGS) BUILT_SOURCES = diff --git a/recipes-extended/libvirt/libvirt_4.9.0.bb b/recipes-extended/libvirt/libvirt_4.9.0.bb deleted file mode 100644 index 813d95ec..00000000 --- a/recipes-extended/libvirt/libvirt_4.9.0.bb +++ /dev/null @@ -1,347 +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 \ - ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'shadow-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://hook_support.py \ - " - -SRC_URI[libvirt.md5sum] = "aaf7b265ac2013d6eb184a86b5f7eeb9" -SRC_URI[libvirt.sha256sum] = "4fd4bfe7312b7996a817c7919cf0062de0d5b3c400c93bd30855a46c40dd455a" - -inherit autotools gettext update-rc.d pkgconfig ptest systemd useradd -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)} \ - " - -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 \ - " - -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 uml 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', 'x11', 'polkit', '', d)} \ - ${@bb.utils.contains('KARCH', 'arm', '', 'numactl', d)} \ - " - -# qemu is NOT compatible with mips64 -PACKAGECONFIG_remove_mipsarchn32 = "qemu" -PACKAGECONFIG_remove_mipsarchn64 = "qemu" - -# enable,disable,depends,rdepends -# -PACKAGECONFIG[qemu] = "--with-qemu --with-qemu-user=qemu --with-qemu-group=qemu,--without-qemu,qemu," -PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl" -PACKAGECONFIG[xenapi] = "--with-xenapi,--without-xenapi,," -PACKAGECONFIG[libxl] = "--with-libxl=${STAGING_DIR_TARGET}/lib,--without-libxl,xen," -PACKAGECONFIG[uml] = "--with-uml, --without-uml,," -PACKAGECONFIG[openvz] = "--with-openvz,--without-openvz,," -PACKAGECONFIG[vmware] = "--with-vmware,--without-vmware,," -PACKAGECONFIG[phyp] = "--with-phyp,--without-phyp,," -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] = ",,python," -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_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 - 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 -} - -EXTRA_OECONF += " \ - --with-init-script=systemd \ - --with-test-suite \ - " - -EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH} SYSTEMD_UNIT_DIR=${systemd_system_unitdir}" - -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") -} diff --git a/recipes-extended/libvirt/libvirt_5.3.0.bb b/recipes-extended/libvirt/libvirt_5.3.0.bb new file mode 100644 index 00000000..c54a99e2 --- /dev/null +++ b/recipes-extended/libvirt/libvirt_5.3.0.bb @@ -0,0 +1,347 @@ +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 \ + ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'shadow-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://hook_support.py \ + " + +SRC_URI[libvirt.md5sum] = "1cfaaf3717783ba19850b5ac04f7e76a" +SRC_URI[libvirt.sha256sum] = "8564bdd506817b3957fa67e4f06b217922d30f19e416c4dc620995fd155dc101" + +inherit autotools gettext update-rc.d pkgconfig ptest systemd useradd +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)} \ + " + +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', 'x11', 'polkit', '', d)} \ + ${@bb.utils.contains('KARCH', 'arm', '', 'numactl', d)} \ + " + +# qemu is NOT compatible with mips64 +PACKAGECONFIG_remove_mipsarchn32 = "qemu" +PACKAGECONFIG_remove_mipsarchn64 = "qemu" + +# enable,disable,depends,rdepends +# +PACKAGECONFIG[qemu] = "--with-qemu --with-qemu-user=qemu --with-qemu-group=qemu,--without-qemu,qemu," +PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl" +PACKAGECONFIG[xenapi] = "--with-xenapi,--without-xenapi,," +PACKAGECONFIG[libxl] = "--with-libxl=${STAGING_DIR_TARGET}/lib,--without-libxl,xen," +PACKAGECONFIG[openvz] = "--with-openvz,--without-openvz,," +PACKAGECONFIG[vmware] = "--with-vmware,--without-vmware,," +PACKAGECONFIG[phyp] = "--with-phyp,--without-phyp,," +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] = ",,python," +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_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 + 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 +} + +EXTRA_OECONF += " \ + --with-init-script=systemd \ + --with-test-suite \ + " + +EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH} SYSTEMD_UNIT_DIR=${systemd_system_unitdir}" + +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") +} -- cgit v1.2.3-54-g00ecf