diff options
Diffstat (limited to 'recipes-extended/libvirt/libvirt_4.5.0.bb')
-rw-r--r-- | recipes-extended/libvirt/libvirt_4.5.0.bb | 322 |
1 files changed, 322 insertions, 0 deletions
diff --git a/recipes-extended/libvirt/libvirt_4.5.0.bb b/recipes-extended/libvirt/libvirt_4.5.0.bb new file mode 100644 index 00000000..9cfa74a3 --- /dev/null +++ b/recipes-extended/libvirt/libvirt_4.5.0.bb | |||
@@ -0,0 +1,322 @@ | |||
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] = "692b2d00907438ed08a68813d3177cd3" | ||
41 | SRC_URI[libvirt.sha256sum] = "e7e95edc0ca553046761ed55a8d01a06a3a3a4238bbeaedb3ba34680a277ab09" | ||
42 | |||
43 | inherit autotools gettext update-rc.d pkgconfig ptest systemd | ||
44 | |||
45 | # Override the default set in autotools.bbclass so that we will use relative pathnames | ||
46 | # to our local m4 files. This prevents an "Argument list too long" error during configuration | ||
47 | # if our project is in a directory with an absolute pathname of more than about 125 characters. | ||
48 | # | ||
49 | acpaths = "-I ./m4" | ||
50 | |||
51 | CACHED_CONFIGUREVARS += "\ | ||
52 | ac_cv_path_XMLCATLOG=/usr/bin/xmlcatalog \ | ||
53 | ac_cv_path_AUGPARSE=/usr/bin/augparse \ | ||
54 | ac_cv_path_DNSMASQ=/usr/bin/dnsmasq \ | ||
55 | ac_cv_path_BRCTL=/usr/sbin/brctl \ | ||
56 | ac_cv_path_TC=/sbin/tc \ | ||
57 | ac_cv_path_UDEVADM=/sbin/udevadm \ | ||
58 | ac_cv_path_MODPROBE=/sbin/modprobe \ | ||
59 | ac_cv_path_IP_PATH=/bin/ip \ | ||
60 | ac_cv_path_IPTABLES_PATH=/usr/sbin/iptables \ | ||
61 | ac_cv_path_IP6TABLES_PATH=/usr/sbin/ip6tables \ | ||
62 | ac_cv_path_MOUNT=/bin/mount \ | ||
63 | ac_cv_path_UMOUNT=/bin/umount \ | ||
64 | ac_cv_path_MKFS=/usr/sbin/mkfs \ | ||
65 | ac_cv_path_SHOWMOUNT=/usr/sbin/showmount \ | ||
66 | ac_cv_path_PVCREATE=/usr/sbin/pvcreate \ | ||
67 | ac_cv_path_VGCREATE=/usr/sbin/vgcreate \ | ||
68 | ac_cv_path_LVCREATE=/usr/sbin/lvcreate \ | ||
69 | ac_cv_path_PVREMOVE=/usr/sbin/pvremove \ | ||
70 | ac_cv_path_VGREMOVE=/usr/sbin/vgremove \ | ||
71 | ac_cv_path_LVREMOVE=/usr/sbin/lvremove \ | ||
72 | ac_cv_path_LVCHANGE=/usr/sbin/lvchange \ | ||
73 | ac_cv_path_VGCHANGE=/usr/sbin/vgchange \ | ||
74 | ac_cv_path_VGSCAN=/usr/sbin/vgscan \ | ||
75 | ac_cv_path_PVS=/usr/sbin/pvs \ | ||
76 | ac_cv_path_VGS=/usr/sbin/vgs \ | ||
77 | ac_cv_path_LVS=/usr/sbin/lvs \ | ||
78 | ac_cv_path_PARTED=/usr/sbin/parted \ | ||
79 | ac_cv_path_DMSETUP=/usr/sbin/dmsetup" | ||
80 | |||
81 | # Ensure that libvirt uses polkit rather than policykit, whether the host has | ||
82 | # pkcheck installed or not, and ensure the path is correct per our config. | ||
83 | CACHED_CONFIGUREVARS += "ac_cv_path_PKCHECK_PATH=${bindir}/pkcheck" | ||
84 | |||
85 | # Some other possible paths we are not yet setting | ||
86 | #ac_cv_path_RPCGEN= | ||
87 | #ac_cv_path_XSLTPROC= | ||
88 | #ac_cv_path_RADVD= | ||
89 | #ac_cv_path_UDEVSETTLE= | ||
90 | #ac_cv_path_EBTABLES_PATH= | ||
91 | #ac_cv_path_PKG_CONFIG= | ||
92 | #ac_cv_path_ac_pt_PKG_CONFIG | ||
93 | #ac_cv_path_POLKIT_AUTH= | ||
94 | #ac_cv_path_DTRACE= | ||
95 | #ac_cv_path_ISCSIADM= | ||
96 | #ac_cv_path_MSGFMT= | ||
97 | #ac_cv_path_GMSGFMT= | ||
98 | #ac_cv_path_XGETTEXT= | ||
99 | #ac_cv_path_MSGMERGE= | ||
100 | #ac_cv_path_SCRUB= | ||
101 | #ac_cv_path_PYTHON= | ||
102 | |||
103 | ALLOW_EMPTY_${PN} = "1" | ||
104 | |||
105 | PACKAGES =+ "${PN}-libvirtd ${PN}-virsh" | ||
106 | |||
107 | ALLOW_EMPTY_${PN}-libvirtd = "1" | ||
108 | |||
109 | FILES_${PN}-libvirtd = " \ | ||
110 | ${sysconfdir}/init.d \ | ||
111 | ${sysconfdir}/sysctl.d \ | ||
112 | ${sysconfdir}/logrotate.d \ | ||
113 | ${sysconfdir}/libvirt/libvirtd.conf \ | ||
114 | /usr/lib/sysctl.d/60-libvirtd.conf \ | ||
115 | ${sbindir}/libvirtd \ | ||
116 | ${systemd_unitdir}/system/* \ | ||
117 | ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', '${libexecdir}/libvirt-guests.sh', d)} \ | ||
118 | " | ||
119 | |||
120 | FILES_${PN}-virsh = " \ | ||
121 | ${bindir}/virsh \ | ||
122 | ${datadir}/bash-completion/completions/virsh \ | ||
123 | " | ||
124 | |||
125 | FILES_${PN} += "${libdir}/libvirt/connection-driver \ | ||
126 | ${datadir}/augeas \ | ||
127 | ${@bb.utils.contains('PACKAGECONFIG', 'polkit', '${datadir}/polkit-1', '', d)} \ | ||
128 | ${datadir}/bash-completion/completions/vsh \ | ||
129 | ${datadir}/bash-completion/completions/virt-admin \ | ||
130 | " | ||
131 | |||
132 | FILES_${PN}-dbg += "${libdir}/libvirt/connection-driver/.debug ${libdir}/libvirt/lock-driver/.debug" | ||
133 | FILES_${PN}-staticdev += "${libdir}/*.a ${libdir}/libvirt/connection-driver/*.a ${libdir}/libvirt/lock-driver/*.a" | ||
134 | |||
135 | CONFFILES_${PN} += "${sysconfdir}/libvirt/libvirt.conf \ | ||
136 | ${sysconfdir}/libvirt/lxc.conf \ | ||
137 | ${sysconfdir}/libvirt/qemu-lockd.conf \ | ||
138 | ${sysconfdir}/libvirt/qemu.conf \ | ||
139 | ${sysconfdir}/libvirt/virt-login-shell.conf \ | ||
140 | ${sysconfdir}/libvirt/virtlockd.conf" | ||
141 | |||
142 | CONFFILES_${PN}-libvirtd = "${sysconfdir}/logrotate.d/libvirt ${sysconfdir}/logrotate.d/libvirt.lxc \ | ||
143 | ${sysconfdir}/logrotate.d/libvirt.qemu ${sysconfdir}/logrotate.d/libvirt.uml \ | ||
144 | ${sysconfdir}/libvirt/libvirtd.conf \ | ||
145 | /usr/lib/sysctl.d/libvirtd.conf" | ||
146 | |||
147 | INITSCRIPT_PACKAGES = "${PN}-libvirtd" | ||
148 | INITSCRIPT_NAME_${PN}-libvirtd = "libvirtd" | ||
149 | INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72" | ||
150 | |||
151 | SYSTEMD_PACKAGES = "${PN}-libvirtd" | ||
152 | SYSTEMD_SERVICE_${PN}-libvirtd = " \ | ||
153 | libvirtd.service \ | ||
154 | virtlockd.service \ | ||
155 | libvirt-guests.service \ | ||
156 | virtlockd.socket \ | ||
157 | " | ||
158 | |||
159 | |||
160 | PRIVATE_LIBS_${PN}-ptest = " \ | ||
161 | libvirt-lxc.so.0 \ | ||
162 | libvirt.so.0 \ | ||
163 | libvirt-qemu.so.0 \ | ||
164 | lockd.so \ | ||
165 | libvirt_driver_secret.so \ | ||
166 | libvirt_driver_nodedev.so \ | ||
167 | libvirt_driver_vbox.so \ | ||
168 | libvirt_driver_interface.so \ | ||
169 | libvirt_driver_uml.so \ | ||
170 | libvirt_driver_network.so \ | ||
171 | libvirt_driver_nwfilter.so \ | ||
172 | libvirt_driver_qemu.so \ | ||
173 | libvirt_driver_storage.so \ | ||
174 | libvirt_driver_lxc.so \ | ||
175 | " | ||
176 | |||
177 | # xen-minimal config | ||
178 | #PACKAGECONFIG ??= "xen libxl xen-inotify test remote libvirtd" | ||
179 | |||
180 | # full config | ||
181 | PACKAGECONFIG ??= "qemu yajl uml openvz vmware vbox esx iproute2 lxc test \ | ||
182 | remote macvtap libvirtd netcf udev python ebtables \ | ||
183 | ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux audit libcap-ng', '', d)} \ | ||
184 | ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'libxl', '', d)} \ | ||
185 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'polkit', '', d)} \ | ||
186 | " | ||
187 | |||
188 | # enable,disable,depends,rdepends | ||
189 | # | ||
190 | PACKAGECONFIG[qemu] = "--with-qemu,--without-qemu,qemu," | ||
191 | PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl" | ||
192 | PACKAGECONFIG[xenapi] = "--with-xenapi,--without-xenapi,," | ||
193 | PACKAGECONFIG[libxl] = "--with-libxl=${STAGING_DIR_TARGET}/lib,--without-libxl,libxl," | ||
194 | PACKAGECONFIG[uml] = "--with-uml, --without-uml,," | ||
195 | PACKAGECONFIG[openvz] = "--with-openvz,--without-openvz,," | ||
196 | PACKAGECONFIG[vmware] = "--with-vmware,--without-vmware,," | ||
197 | PACKAGECONFIG[phyp] = "--with-phyp,--without-phyp,," | ||
198 | PACKAGECONFIG[vbox] = "--with-vbox,--without-vbox,," | ||
199 | PACKAGECONFIG[esx] = "--with-esx,--without-esx,," | ||
200 | PACKAGECONFIG[hyperv] = "--with-hyperv,--without-hyperv,," | ||
201 | PACKAGECONFIG[polkit] = "--with-polkit,--without-polkit,polkit,polkit" | ||
202 | PACKAGECONFIG[lxc] = "--with-lxc,--without-lxc, lxc," | ||
203 | PACKAGECONFIG[test] = "--with-test=yes,--with-test=no,," | ||
204 | PACKAGECONFIG[remote] = "--with-remote,--without-remote,," | ||
205 | PACKAGECONFIG[macvtap] = "--with-macvtap=yes,--with-macvtap=no,libnl,libnl" | ||
206 | PACKAGECONFIG[libvirtd] = "--with-libvirtd,--without-libvirtd,," | ||
207 | PACKAGECONFIG[netcf] = "--with-netcf,--without-netcf,netcf,netcf" | ||
208 | PACKAGECONFIG[dtrace] = "--with-dtrace,--without-dtrace,," | ||
209 | PACKAGECONFIG[udev] = "--with-udev --with-pciaccess,--without-udev,udev libpciaccess," | ||
210 | PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux," | ||
211 | PACKAGECONFIG[ebtables] = "ac_cv_path_EBTABLES_PATH=/sbin/ebtables,ac_cv_path_EBTABLES_PATH=,ebtables,ebtables" | ||
212 | PACKAGECONFIG[python] = ",,python," | ||
213 | PACKAGECONFIG[sasl] = "--with-sasl,--without-sasl,cyrus-sasl,cyrus-sasl" | ||
214 | PACKAGECONFIG[iproute2] = "ac_cv_path_IP_PATH=/sbin/ip,ac_cv_path_IP_PATH=,iproute2,iproute2" | ||
215 | PACKAGECONFIG[numactl] = "--with-numactl,--without-numactl,numactl," | ||
216 | PACKAGECONFIG[fuse] = "--with-fuse,--without-fuse,fuse," | ||
217 | PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit," | ||
218 | PACKAGECONFIG[libcap-ng] = "--with-capng,--without-capng,libcap-ng," | ||
219 | PACKAGECONFIG[wireshark] = "--with-wireshark-dissector,--without-wireshark-dissector,wireshark libwsutil," | ||
220 | |||
221 | # Enable the Python tool support | ||
222 | require libvirt-python.inc | ||
223 | |||
224 | do_install_append() { | ||
225 | install -d ${D}/etc/init.d | ||
226 | install -d ${D}/etc/libvirt | ||
227 | install -d ${D}/etc/dnsmasq.d | ||
228 | |||
229 | install -m 0755 ${WORKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd | ||
230 | install -m 0644 ${WORKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf | ||
231 | |||
232 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then | ||
233 | # This will wind up in the libvirtd package, but will NOT be invoked by default. | ||
234 | # | ||
235 | mv ${D}/${libexecdir}/libvirt-guests.sh ${D}/${sysconfdir}/init.d | ||
236 | fi | ||
237 | |||
238 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
239 | # This variable is used by libvirtd.service to start libvirtd in the right mode | ||
240 | sed -i '/#LIBVIRTD_ARGS="--listen"/a LIBVIRTD_ARGS="--listen --daemon"' ${D}/${sysconfdir}/sysconfig/libvirtd | ||
241 | |||
242 | # We can't use 'notify' when we don't support 'sd_notify' dbus capabilities. | ||
243 | sed -i -e 's/Type=notify/Type=forking/' \ | ||
244 | -e '/Type=forking/a PIDFile=${localstatedir}/run/libvirtd.pid' \ | ||
245 | ${D}/${systemd_unitdir}/system/libvirtd.service | ||
246 | fi | ||
247 | |||
248 | # The /var/run/libvirt directories created by the Makefile | ||
249 | # are wiped out in volatile, we need to create these at boot. | ||
250 | rm -rf ${D}${localstatedir}/run | ||
251 | install -d ${D}${sysconfdir}/default/volatiles | ||
252 | echo "d root root 0755 ${localstatedir}/run/libvirt none" \ | ||
253 | > ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
254 | echo "d root root 0755 ${localstatedir}/run/libvirt/lockd none" \ | ||
255 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
256 | echo "d root root 0755 ${localstatedir}/run/libvirt/lxc none" \ | ||
257 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
258 | echo "d root root 0755 ${localstatedir}/run/libvirt/network none" \ | ||
259 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
260 | echo "d root root 0755 ${localstatedir}/run/libvirt/qemu none" \ | ||
261 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
262 | |||
263 | # Manually set permissions and ownership to match polkit recipe | ||
264 | if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then | ||
265 | install -d -m 0700 ${D}/${datadir}/polkit-1/rules.d | ||
266 | chown polkitd ${D}/${datadir}/polkit-1/rules.d | ||
267 | chgrp root ${D}/${datadir}/polkit-1/rules.d | ||
268 | else | ||
269 | rm -rf ${D}/${datadir}/polkit-1 | ||
270 | fi | ||
271 | |||
272 | # disable seccomp_sandbox | ||
273 | if [ -e ${D}${sysconfdir}/libvirt/qemu.conf ] ; then | ||
274 | sed -i '/^#seccomp_sandbox = 1/aseccomp_sandbox = 0' \ | ||
275 | ${D}${sysconfdir}/libvirt/qemu.conf | ||
276 | fi | ||
277 | |||
278 | # Add hook support for libvirt | ||
279 | mkdir -p ${D}/etc/libvirt/hooks | ||
280 | |||
281 | # Force the main dnsmasq instance to bind only to specified interfaces and | ||
282 | # to not bind to virbr0. Libvirt will run its own instance on this interface. | ||
283 | install -m 644 ${WORKDIR}/dnsmasq.conf ${D}/${sysconfdir}/dnsmasq.d/libvirt-daemon | ||
284 | |||
285 | # remove .la references to our working diretory | ||
286 | for i in `find ${D}${libdir} -type f -name *.la`; do | ||
287 | sed -i -e 's#-L${B}/src/.libs##g' $i | ||
288 | done | ||
289 | } | ||
290 | |||
291 | EXTRA_OECONF += " \ | ||
292 | --with-init-script=systemd \ | ||
293 | --with-test-suite \ | ||
294 | " | ||
295 | |||
296 | EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH} SYSTEMD_UNIT_DIR=${systemd_system_unitdir}" | ||
297 | |||
298 | do_compile_ptest() { | ||
299 | oe_runmake -C tests buildtest-TESTS | ||
300 | } | ||
301 | |||
302 | do_install_ptest() { | ||
303 | oe_runmake -C tests install-ptest | ||
304 | |||
305 | find ${S}/tests -maxdepth 1 -type d -exec cp -r {} ${D}${PTEST_PATH}/tests/ \; | ||
306 | |||
307 | # remove .la files for ptest, they aren't required and can trigger QA errors | ||
308 | for i in `find ${D}${PTEST_PATH} -type f \( -name *.la -o -name *.o \)`; do | ||
309 | rm -f $i | ||
310 | done | ||
311 | } | ||
312 | |||
313 | pkg_postinst_ontarget_${PN}() { | ||
314 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then | ||
315 | /etc/init.d/populate-volatile.sh update | ||
316 | fi | ||
317 | } | ||
318 | |||
319 | python () { | ||
320 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): | ||
321 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") | ||
322 | } | ||