summaryrefslogtreecommitdiffstats
path: root/recipes-extended/libvirt/libvirt_4.3.0.bb
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2018-06-05 10:01:48 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2018-06-05 12:01:01 -0400
commit343b40ba0d44caeb22013a1586ae2159e415bd4c (patch)
tree3c5fdb72c38b060aeefccff3cd85091b5a5421c3 /recipes-extended/libvirt/libvirt_4.3.0.bb
parent1fd1ff3720140baa3680d795f6d97597e5113e90 (diff)
downloadmeta-virtualization-343b40ba0d44caeb22013a1586ae2159e415bd4c.tar.gz
libvirt: uprev to the latest release, v4.3.0
We have been using the 1.3.x release series for a long time now which has been great for stability but is slowly becoming harder and harder to track and port bug and CVE fixes. This is a big jump to the latest upstream release which gives us access to a myriad of fixes as well as puts us in a better position to contribute to the upstream project when issues are found. Several patches have been dropped as they are either no longer valid against this release or have equivalent updates already applied to the upstream project. Some patches were consolidated which should ease future uprevs of this recipe. The majority of the updates were related to ptest patches, which is not a huge surprise given this code has no upstream equivalent. The overall runtime behavior remains much the same from v1.3.5 with the only notable configuration change being for 'seccomp_sandbox' which has been disabled here but should possibly be revisited in the near future. As usual the normal runtime usecases for qemu/kvm and lxc have been run successfully along with ptest results which are by and large OK: ==================================== Testsuite summary for libvirt 4.3.0 ==================================== # TOTAL: 119 # PASS: 115 # SKIP: 0 # XFAIL: 0 # FAIL: 4 # XPASS: 0 # ERROR: 0 Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-extended/libvirt/libvirt_4.3.0.bb')
-rw-r--r--recipes-extended/libvirt/libvirt_4.3.0.bb316
1 files changed, 316 insertions, 0 deletions
diff --git a/recipes-extended/libvirt/libvirt_4.3.0.bb b/recipes-extended/libvirt/libvirt_4.3.0.bb
new file mode 100644
index 00000000..a9cc0112
--- /dev/null
+++ b/recipes-extended/libvirt/libvirt_4.3.0.bb
@@ -0,0 +1,316 @@
1DESCRIPTION = "A toolkit to interact with the virtualization capabilities of recent versions of Linux."
2HOMEPAGE = "http://libvirt.org"
3LICENSE = "LGPLv2.1+ & GPLv2+"
4LICENSE_${PN}-ptest = "GPLv2+ & LGPLv2.1+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
6 file://COPYING.LESSER;md5=4b54a1fd55a448865a0b32d41598759d"
7SECTION = "console/tools"
8
9DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \
10 iptables dnsmasq readline libtasn1 libxslt-native acl libdevmapper libtirpc \
11 ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'shadow-native', '', d)}"
12
13# libvirt-guests.sh needs gettext.sh
14#
15RDEPENDS_${PN} = "gettext-runtime"
16
17RDEPENDS_${PN}-ptest += "make gawk perl bash"
18
19RDEPENDS_libvirt-libvirtd += "bridge-utils iptables pm-utils dnsmasq netcat-openbsd"
20RDEPENDS_libvirt-libvirtd_append_x86-64 = " dmidecode"
21RDEPENDS_libvirt-libvirtd_append_x86 = " dmidecode"
22
23#connman blocks the 53 port and libvirtd can't start its DNS service
24RCONFLICTS_${PN}_libvirtd = "connman"
25
26SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.xz;name=libvirt \
27 file://tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch \
28 file://libvirtd.sh \
29 file://libvirtd.conf \
30 file://dnsmasq.conf \
31 file://runptest.patch \
32 file://run-ptest \
33 file://libvirt-use-pkg-config-to-locate-libcap.patch \
34 file://0001-to-fix-build-error.patch \
35 file://install-missing-file.patch \
36 file://0001-ptest-Remove-Windows-1252-check-from-esxutilstest.patch \
37 file://configure.ac-search-for-rpc-rpc.h-in-the-sysroot.patch \
38 "
39
40SRC_URI[libvirt.md5sum] = "946cfa2558401612c4fcbc934ef9077b"
41SRC_URI[libvirt.sha256sum] = "a531e22c8b985ecb2d1223b913fd6ec0f1800e3ebe02351924274885db20c2b7"
42
43inherit autotools gettext update-rc.d pkgconfig ptest systemd
44
45CACHED_CONFIGUREVARS += "\
46ac_cv_path_XMLLINT=/usr/bin/xmllint \
47ac_cv_path_XMLCATLOG=/usr/bin/xmlcatalog \
48ac_cv_path_AUGPARSE=/usr/bin/augparse \
49ac_cv_path_DNSMASQ=/usr/bin/dnsmasq \
50ac_cv_path_BRCTL=/usr/sbin/brctl \
51ac_cv_path_TC=/sbin/tc \
52ac_cv_path_UDEVADM=/sbin/udevadm \
53ac_cv_path_MODPROBE=/sbin/modprobe \
54ac_cv_path_IP_PATH=/bin/ip \
55ac_cv_path_IPTABLES_PATH=/usr/sbin/iptables \
56ac_cv_path_IP6TABLES_PATH=/usr/sbin/ip6tables \
57ac_cv_path_MOUNT=/bin/mount \
58ac_cv_path_UMOUNT=/bin/umount \
59ac_cv_path_MKFS=/usr/sbin/mkfs \
60ac_cv_path_SHOWMOUNT=/usr/sbin/showmount \
61ac_cv_path_PVCREATE=/usr/sbin/pvcreate \
62ac_cv_path_VGCREATE=/usr/sbin/vgcreate \
63ac_cv_path_LVCREATE=/usr/sbin/lvcreate \
64ac_cv_path_PVREMOVE=/usr/sbin/pvremove \
65ac_cv_path_VGREMOVE=/usr/sbin/vgremove \
66ac_cv_path_LVREMOVE=/usr/sbin/lvremove \
67ac_cv_path_LVCHANGE=/usr/sbin/lvchange \
68ac_cv_path_VGCHANGE=/usr/sbin/vgchange \
69ac_cv_path_VGSCAN=/usr/sbin/vgscan \
70ac_cv_path_PVS=/usr/sbin/pvs \
71ac_cv_path_VGS=/usr/sbin/vgs \
72ac_cv_path_LVS=/usr/sbin/lvs \
73ac_cv_path_PARTED=/usr/sbin/parted \
74ac_cv_path_DMSETUP=/usr/sbin/dmsetup"
75
76# Ensure that libvirt uses polkit rather than policykit, whether the host has
77# pkcheck installed or not, and ensure the path is correct per our config.
78CACHED_CONFIGUREVARS += "ac_cv_path_PKCHECK_PATH=${bindir}/pkcheck"
79
80# Some other possible paths we are not yet setting
81#ac_cv_path_RPCGEN=
82#ac_cv_path_XSLTPROC=
83#ac_cv_path_RADVD=
84#ac_cv_path_UDEVSETTLE=
85#ac_cv_path_EBTABLES_PATH=
86#ac_cv_path_PKG_CONFIG=
87#ac_cv_path_ac_pt_PKG_CONFIG
88#ac_cv_path_POLKIT_AUTH=
89#ac_cv_path_DTRACE=
90#ac_cv_path_ISCSIADM=
91#ac_cv_path_MSGFMT=
92#ac_cv_path_GMSGFMT=
93#ac_cv_path_XGETTEXT=
94#ac_cv_path_MSGMERGE=
95#ac_cv_path_SCRUB=
96#ac_cv_path_PYTHON=
97
98ALLOW_EMPTY_${PN} = "1"
99
100PACKAGES =+ "${PN}-libvirtd ${PN}-virsh"
101
102ALLOW_EMPTY_${PN}-libvirtd = "1"
103
104FILES_${PN}-libvirtd = " \
105 ${sysconfdir}/init.d \
106 ${sysconfdir}/sysctl.d \
107 ${sysconfdir}/logrotate.d \
108 ${sysconfdir}/libvirt/libvirtd.conf \
109 /usr/lib/sysctl.d/60-libvirtd.conf \
110 ${sbindir}/libvirtd \
111 ${systemd_unitdir}/system/* \
112 ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', '${libexecdir}/libvirt-guests.sh', d)} \
113 "
114
115FILES_${PN}-virsh = " \
116 ${bindir}/virsh \
117 ${datadir}/bash-completion/completions/virsh \
118"
119
120FILES_${PN} += "${libdir}/libvirt/connection-driver \
121 ${datadir}/augeas \
122 ${@bb.utils.contains('PACKAGECONFIG', 'polkit', '${datadir}/polkit-1', '', d)} \
123 ${datadir}/bash-completion/completions/vsh \
124 ${datadir}/bash-completion/completions/virt-admin \
125 "
126
127FILES_${PN}-dbg += "${libdir}/libvirt/connection-driver/.debug ${libdir}/libvirt/lock-driver/.debug"
128FILES_${PN}-staticdev += "${libdir}/*.a ${libdir}/libvirt/connection-driver/*.a ${libdir}/libvirt/lock-driver/*.a"
129
130CONFFILES_${PN} += "${sysconfdir}/libvirt/libvirt.conf \
131 ${sysconfdir}/libvirt/lxc.conf \
132 ${sysconfdir}/libvirt/qemu-lockd.conf \
133 ${sysconfdir}/libvirt/qemu.conf \
134 ${sysconfdir}/libvirt/virt-login-shell.conf \
135 ${sysconfdir}/libvirt/virtlockd.conf"
136
137CONFFILES_${PN}-libvirtd = "${sysconfdir}/logrotate.d/libvirt ${sysconfdir}/logrotate.d/libvirt.lxc \
138 ${sysconfdir}/logrotate.d/libvirt.qemu ${sysconfdir}/logrotate.d/libvirt.uml \
139 ${sysconfdir}/libvirt/libvirtd.conf \
140 /usr/lib/sysctl.d/libvirtd.conf"
141
142INITSCRIPT_PACKAGES = "${PN}-libvirtd"
143INITSCRIPT_NAME_${PN}-libvirtd = "libvirtd"
144INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72"
145
146SYSTEMD_PACKAGES = "${PN}-libvirtd"
147SYSTEMD_SERVICE_${PN}-libvirtd = " \
148 libvirtd.service \
149 virtlockd.service \
150 libvirt-guests.service \
151 virtlockd.socket \
152 "
153
154
155PRIVATE_LIBS_${PN}-ptest = " \
156 libvirt-lxc.so.0 \
157 libvirt.so.0 \
158 libvirt-qemu.so.0 \
159 lockd.so \
160 libvirt_driver_secret.so \
161 libvirt_driver_nodedev.so \
162 libvirt_driver_vbox.so \
163 libvirt_driver_interface.so \
164 libvirt_driver_uml.so \
165 libvirt_driver_network.so \
166 libvirt_driver_nwfilter.so \
167 libvirt_driver_qemu.so \
168 libvirt_driver_storage.so \
169 libvirt_driver_lxc.so \
170 "
171
172# xen-minimal config
173#PACKAGECONFIG ??= "xen libxl xen-inotify test remote libvirtd"
174
175# full config
176PACKAGECONFIG ??= "qemu yajl uml openvz vmware vbox esx iproute2 lxc test \
177 remote macvtap libvirtd netcf udev python ebtables \
178 ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux audit libcap-ng', '', d)} \
179 ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen libxl xen-inotify', '', d)} \
180 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'polkit', '', d)} \
181 "
182
183# enable,disable,depends,rdepends
184#
185PACKAGECONFIG[qemu] = "--with-qemu,--without-qemu,qemu,"
186PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl"
187PACKAGECONFIG[xen] = "--with-xen,--without-xen,xen,"
188PACKAGECONFIG[xenapi] = "--with-xenapi,--without-xenapi,,"
189PACKAGECONFIG[libxl] = "--with-libxl=${STAGING_DIR_TARGET}/lib,--without-libxl,libxl,"
190PACKAGECONFIG[xen-inotify] = "--with-xen-inotify,--without-xen-inotify,xen,"
191PACKAGECONFIG[uml] = "--with-uml, --without-uml,,"
192PACKAGECONFIG[openvz] = "--with-openvz,--without-openvz,,"
193PACKAGECONFIG[vmware] = "--with-vmware,--without-vmware,,"
194PACKAGECONFIG[phyp] = "--with-phyp,--without-phyp,,"
195PACKAGECONFIG[vbox] = "--with-vbox,--without-vbox,,"
196PACKAGECONFIG[esx] = "--with-esx,--without-esx,,"
197PACKAGECONFIG[hyperv] = "--with-hyperv,--without-hyperv,,"
198PACKAGECONFIG[polkit] = "--with-polkit,--without-polkit,polkit,polkit"
199PACKAGECONFIG[lxc] = "--with-lxc,--without-lxc, lxc,"
200PACKAGECONFIG[test] = "--with-test=yes,--with-test=no,,"
201PACKAGECONFIG[remote] = "--with-remote,--without-remote,,"
202PACKAGECONFIG[macvtap] = "--with-macvtap=yes,--with-macvtap=no,libnl,libnl"
203PACKAGECONFIG[libvirtd] = "--with-libvirtd,--without-libvirtd,,"
204PACKAGECONFIG[netcf] = "--with-netcf,--without-netcf,netcf,netcf"
205PACKAGECONFIG[dtrace] = "--with-dtrace,--without-dtrace,,"
206PACKAGECONFIG[udev] = "--with-udev --with-pciaccess,--without-udev,udev libpciaccess,"
207PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux,"
208PACKAGECONFIG[ebtables] = "ac_cv_path_EBTABLES_PATH=/sbin/ebtables,ac_cv_path_EBTABLES_PATH=,ebtables,ebtables"
209PACKAGECONFIG[python] = ",,python,"
210PACKAGECONFIG[sasl] = "--with-sasl,--without-sasl,cyrus-sasl,cyrus-sasl"
211PACKAGECONFIG[iproute2] = "ac_cv_path_IP_PATH=/sbin/ip,ac_cv_path_IP_PATH=,iproute2,iproute2"
212PACKAGECONFIG[numactl] = "--with-numactl,--without-numactl,numactl,"
213PACKAGECONFIG[fuse] = "--with-fuse,--without-fuse,fuse,"
214PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit,"
215PACKAGECONFIG[libcap-ng] = "--with-capng,--without-capng,libcap-ng,"
216PACKAGECONFIG[wireshark] = "--with-wireshark-dissector,--without-wireshark-dissector,wireshark libwsutil,"
217
218# Enable the Python tool support
219require libvirt-python.inc
220
221do_install_append() {
222 install -d ${D}/etc/init.d
223 install -d ${D}/etc/libvirt
224 install -d ${D}/etc/dnsmasq.d
225
226 install -m 0755 ${WORKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd
227 install -m 0644 ${WORKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf
228
229 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
230 # This will wind up in the libvirtd package, but will NOT be invoked by default.
231 #
232 mv ${D}/${libexecdir}/libvirt-guests.sh ${D}/${sysconfdir}/init.d
233 fi
234
235 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
236 # This variable is used by libvirtd.service to start libvirtd in the right mode
237 sed -i '/#LIBVIRTD_ARGS="--listen"/a LIBVIRTD_ARGS="--listen --daemon"' ${D}/${sysconfdir}/sysconfig/libvirtd
238
239 # We can't use 'notify' when we don't support 'sd_notify' dbus capabilities.
240 sed -i -e 's/Type=notify/Type=forking/' \
241 -e '/Type=forking/a PIDFile=${localstatedir}/run/libvirtd.pid' \
242 ${D}/${systemd_unitdir}/system/libvirtd.service
243 fi
244
245 # The /var/run/libvirt directories created by the Makefile
246 # are wiped out in volatile, we need to create these at boot.
247 rm -rf ${D}${localstatedir}/run
248 install -d ${D}${sysconfdir}/default/volatiles
249 echo "d root root 0755 ${localstatedir}/run/libvirt none" \
250 > ${D}${sysconfdir}/default/volatiles/99_libvirt
251 echo "d root root 0755 ${localstatedir}/run/libvirt/lockd none" \
252 >> ${D}${sysconfdir}/default/volatiles/99_libvirt
253 echo "d root root 0755 ${localstatedir}/run/libvirt/lxc none" \
254 >> ${D}${sysconfdir}/default/volatiles/99_libvirt
255 echo "d root root 0755 ${localstatedir}/run/libvirt/network none" \
256 >> ${D}${sysconfdir}/default/volatiles/99_libvirt
257 echo "d root root 0755 ${localstatedir}/run/libvirt/qemu none" \
258 >> ${D}${sysconfdir}/default/volatiles/99_libvirt
259
260 # Manually set permissions and ownership to match polkit recipe
261 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
262 install -d -m 0700 ${D}/${datadir}/polkit-1/rules.d
263 chown polkitd ${D}/${datadir}/polkit-1/rules.d
264 chgrp root ${D}/${datadir}/polkit-1/rules.d
265 else
266 rm -rf ${D}/${datadir}/polkit-1
267 fi
268
269 # disable seccomp_sandbox
270 sed -i '/^#seccomp_sandbox = 1/aseccomp_sandbox = 0' \
271 ${D}${sysconfdir}/libvirt/qemu.conf
272
273 # Add hook support for libvirt
274 mkdir -p ${D}/etc/libvirt/hooks
275
276 # Force the main dnsmasq instance to bind only to specified interfaces and
277 # to not bind to virbr0. Libvirt will run its own instance on this interface.
278 install -m 644 ${WORKDIR}/dnsmasq.conf ${D}/${sysconfdir}/dnsmasq.d/libvirt-daemon
279
280 # remove .la references to our working diretory
281 for i in `find ${D}${libdir} -type f -name *.la`; do
282 sed -i -e 's#-L${B}/src/.libs##g' $i
283 done
284}
285
286EXTRA_OECONF += " \
287 --with-init-script=systemd \
288 "
289
290EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH} SYSTEMD_UNIT_DIR=${systemd_system_unitdir}"
291
292do_compile_ptest() {
293 oe_runmake -C tests buildtest-TESTS
294}
295
296do_install_ptest() {
297 oe_runmake -C tests install-ptest
298
299 find ${S}/tests -maxdepth 1 -type d -exec cp -r {} ${D}${PTEST_PATH}/tests/ \;
300
301 # remove .la files for ptest, they aren't required and can trigger QA errors
302 for i in `find ${D}${PTEST_PATH} -type f \( -name *.la -o -name *.o \)`; do
303 rm -f $i
304 done
305}
306
307pkg_postinst_libvirt() {
308 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
309 /etc/init.d/populate-volatile.sh update
310 fi
311}
312
313python () {
314 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
315 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
316}