diff options
author | Mark Asselstine <mark.asselstine@windriver.com> | 2018-06-05 10:01:48 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2018-06-05 12:01:01 -0400 |
commit | 343b40ba0d44caeb22013a1586ae2159e415bd4c (patch) | |
tree | 3c5fdb72c38b060aeefccff3cd85091b5a5421c3 /recipes-extended/libvirt/libvirt_4.3.0.bb | |
parent | 1fd1ff3720140baa3680d795f6d97597e5113e90 (diff) | |
download | meta-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.bb | 316 |
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 @@ | |||
1 | DESCRIPTION = "A toolkit to interact with the virtualization capabilities of recent versions of Linux." | ||
2 | HOMEPAGE = "http://libvirt.org" | ||
3 | LICENSE = "LGPLv2.1+ & GPLv2+" | ||
4 | LICENSE_${PN}-ptest = "GPLv2+ & LGPLv2.1+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | ||
6 | file://COPYING.LESSER;md5=4b54a1fd55a448865a0b32d41598759d" | ||
7 | SECTION = "console/tools" | ||
8 | |||
9 | DEPENDS = "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 | # | ||
15 | RDEPENDS_${PN} = "gettext-runtime" | ||
16 | |||
17 | RDEPENDS_${PN}-ptest += "make gawk perl bash" | ||
18 | |||
19 | RDEPENDS_libvirt-libvirtd += "bridge-utils iptables pm-utils dnsmasq netcat-openbsd" | ||
20 | RDEPENDS_libvirt-libvirtd_append_x86-64 = " dmidecode" | ||
21 | RDEPENDS_libvirt-libvirtd_append_x86 = " dmidecode" | ||
22 | |||
23 | #connman blocks the 53 port and libvirtd can't start its DNS service | ||
24 | RCONFLICTS_${PN}_libvirtd = "connman" | ||
25 | |||
26 | SRC_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 | |||
40 | SRC_URI[libvirt.md5sum] = "946cfa2558401612c4fcbc934ef9077b" | ||
41 | SRC_URI[libvirt.sha256sum] = "a531e22c8b985ecb2d1223b913fd6ec0f1800e3ebe02351924274885db20c2b7" | ||
42 | |||
43 | inherit autotools gettext update-rc.d pkgconfig ptest systemd | ||
44 | |||
45 | CACHED_CONFIGUREVARS += "\ | ||
46 | ac_cv_path_XMLLINT=/usr/bin/xmllint \ | ||
47 | ac_cv_path_XMLCATLOG=/usr/bin/xmlcatalog \ | ||
48 | ac_cv_path_AUGPARSE=/usr/bin/augparse \ | ||
49 | ac_cv_path_DNSMASQ=/usr/bin/dnsmasq \ | ||
50 | ac_cv_path_BRCTL=/usr/sbin/brctl \ | ||
51 | ac_cv_path_TC=/sbin/tc \ | ||
52 | ac_cv_path_UDEVADM=/sbin/udevadm \ | ||
53 | ac_cv_path_MODPROBE=/sbin/modprobe \ | ||
54 | ac_cv_path_IP_PATH=/bin/ip \ | ||
55 | ac_cv_path_IPTABLES_PATH=/usr/sbin/iptables \ | ||
56 | ac_cv_path_IP6TABLES_PATH=/usr/sbin/ip6tables \ | ||
57 | ac_cv_path_MOUNT=/bin/mount \ | ||
58 | ac_cv_path_UMOUNT=/bin/umount \ | ||
59 | ac_cv_path_MKFS=/usr/sbin/mkfs \ | ||
60 | ac_cv_path_SHOWMOUNT=/usr/sbin/showmount \ | ||
61 | ac_cv_path_PVCREATE=/usr/sbin/pvcreate \ | ||
62 | ac_cv_path_VGCREATE=/usr/sbin/vgcreate \ | ||
63 | ac_cv_path_LVCREATE=/usr/sbin/lvcreate \ | ||
64 | ac_cv_path_PVREMOVE=/usr/sbin/pvremove \ | ||
65 | ac_cv_path_VGREMOVE=/usr/sbin/vgremove \ | ||
66 | ac_cv_path_LVREMOVE=/usr/sbin/lvremove \ | ||
67 | ac_cv_path_LVCHANGE=/usr/sbin/lvchange \ | ||
68 | ac_cv_path_VGCHANGE=/usr/sbin/vgchange \ | ||
69 | ac_cv_path_VGSCAN=/usr/sbin/vgscan \ | ||
70 | ac_cv_path_PVS=/usr/sbin/pvs \ | ||
71 | ac_cv_path_VGS=/usr/sbin/vgs \ | ||
72 | ac_cv_path_LVS=/usr/sbin/lvs \ | ||
73 | ac_cv_path_PARTED=/usr/sbin/parted \ | ||
74 | ac_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. | ||
78 | CACHED_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 | |||
98 | ALLOW_EMPTY_${PN} = "1" | ||
99 | |||
100 | PACKAGES =+ "${PN}-libvirtd ${PN}-virsh" | ||
101 | |||
102 | ALLOW_EMPTY_${PN}-libvirtd = "1" | ||
103 | |||
104 | FILES_${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 | |||
115 | FILES_${PN}-virsh = " \ | ||
116 | ${bindir}/virsh \ | ||
117 | ${datadir}/bash-completion/completions/virsh \ | ||
118 | " | ||
119 | |||
120 | FILES_${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 | |||
127 | FILES_${PN}-dbg += "${libdir}/libvirt/connection-driver/.debug ${libdir}/libvirt/lock-driver/.debug" | ||
128 | FILES_${PN}-staticdev += "${libdir}/*.a ${libdir}/libvirt/connection-driver/*.a ${libdir}/libvirt/lock-driver/*.a" | ||
129 | |||
130 | CONFFILES_${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 | |||
137 | CONFFILES_${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 | |||
142 | INITSCRIPT_PACKAGES = "${PN}-libvirtd" | ||
143 | INITSCRIPT_NAME_${PN}-libvirtd = "libvirtd" | ||
144 | INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72" | ||
145 | |||
146 | SYSTEMD_PACKAGES = "${PN}-libvirtd" | ||
147 | SYSTEMD_SERVICE_${PN}-libvirtd = " \ | ||
148 | libvirtd.service \ | ||
149 | virtlockd.service \ | ||
150 | libvirt-guests.service \ | ||
151 | virtlockd.socket \ | ||
152 | " | ||
153 | |||
154 | |||
155 | PRIVATE_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 | ||
176 | PACKAGECONFIG ??= "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 | # | ||
185 | PACKAGECONFIG[qemu] = "--with-qemu,--without-qemu,qemu," | ||
186 | PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl" | ||
187 | PACKAGECONFIG[xen] = "--with-xen,--without-xen,xen," | ||
188 | PACKAGECONFIG[xenapi] = "--with-xenapi,--without-xenapi,," | ||
189 | PACKAGECONFIG[libxl] = "--with-libxl=${STAGING_DIR_TARGET}/lib,--without-libxl,libxl," | ||
190 | PACKAGECONFIG[xen-inotify] = "--with-xen-inotify,--without-xen-inotify,xen," | ||
191 | PACKAGECONFIG[uml] = "--with-uml, --without-uml,," | ||
192 | PACKAGECONFIG[openvz] = "--with-openvz,--without-openvz,," | ||
193 | PACKAGECONFIG[vmware] = "--with-vmware,--without-vmware,," | ||
194 | PACKAGECONFIG[phyp] = "--with-phyp,--without-phyp,," | ||
195 | PACKAGECONFIG[vbox] = "--with-vbox,--without-vbox,," | ||
196 | PACKAGECONFIG[esx] = "--with-esx,--without-esx,," | ||
197 | PACKAGECONFIG[hyperv] = "--with-hyperv,--without-hyperv,," | ||
198 | PACKAGECONFIG[polkit] = "--with-polkit,--without-polkit,polkit,polkit" | ||
199 | PACKAGECONFIG[lxc] = "--with-lxc,--without-lxc, lxc," | ||
200 | PACKAGECONFIG[test] = "--with-test=yes,--with-test=no,," | ||
201 | PACKAGECONFIG[remote] = "--with-remote,--without-remote,," | ||
202 | PACKAGECONFIG[macvtap] = "--with-macvtap=yes,--with-macvtap=no,libnl,libnl" | ||
203 | PACKAGECONFIG[libvirtd] = "--with-libvirtd,--without-libvirtd,," | ||
204 | PACKAGECONFIG[netcf] = "--with-netcf,--without-netcf,netcf,netcf" | ||
205 | PACKAGECONFIG[dtrace] = "--with-dtrace,--without-dtrace,," | ||
206 | PACKAGECONFIG[udev] = "--with-udev --with-pciaccess,--without-udev,udev libpciaccess," | ||
207 | PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux," | ||
208 | PACKAGECONFIG[ebtables] = "ac_cv_path_EBTABLES_PATH=/sbin/ebtables,ac_cv_path_EBTABLES_PATH=,ebtables,ebtables" | ||
209 | PACKAGECONFIG[python] = ",,python," | ||
210 | PACKAGECONFIG[sasl] = "--with-sasl,--without-sasl,cyrus-sasl,cyrus-sasl" | ||
211 | PACKAGECONFIG[iproute2] = "ac_cv_path_IP_PATH=/sbin/ip,ac_cv_path_IP_PATH=,iproute2,iproute2" | ||
212 | PACKAGECONFIG[numactl] = "--with-numactl,--without-numactl,numactl," | ||
213 | PACKAGECONFIG[fuse] = "--with-fuse,--without-fuse,fuse," | ||
214 | PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit," | ||
215 | PACKAGECONFIG[libcap-ng] = "--with-capng,--without-capng,libcap-ng," | ||
216 | PACKAGECONFIG[wireshark] = "--with-wireshark-dissector,--without-wireshark-dissector,wireshark libwsutil," | ||
217 | |||
218 | # Enable the Python tool support | ||
219 | require libvirt-python.inc | ||
220 | |||
221 | do_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 | |||
286 | EXTRA_OECONF += " \ | ||
287 | --with-init-script=systemd \ | ||
288 | " | ||
289 | |||
290 | EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH} SYSTEMD_UNIT_DIR=${systemd_system_unitdir}" | ||
291 | |||
292 | do_compile_ptest() { | ||
293 | oe_runmake -C tests buildtest-TESTS | ||
294 | } | ||
295 | |||
296 | do_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 | |||
307 | pkg_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 | |||
313 | python () { | ||
314 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): | ||
315 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") | ||
316 | } | ||