diff options
Diffstat (limited to 'recipes-extended/libvirt/libvirt_1.3.5.bb')
-rw-r--r-- | recipes-extended/libvirt/libvirt_1.3.5.bb | 288 |
1 files changed, 288 insertions, 0 deletions
diff --git a/recipes-extended/libvirt/libvirt_1.3.5.bb b/recipes-extended/libvirt/libvirt_1.3.5.bb new file mode 100644 index 00000000..f4a8f387 --- /dev/null +++ b/recipes-extended/libvirt/libvirt_1.3.5.bb | |||
@@ -0,0 +1,288 @@ | |||
1 | DESCRIPTION = "A toolkit to interact with the virtualization capabilities of recent versions of Linux." | ||
2 | HOMEPAGE = "http://libvirt.org" | ||
3 | LICENSE = "LGPLv2.1+" | ||
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" | ||
11 | |||
12 | # libvirt-guests.sh needs gettext.sh | ||
13 | # | ||
14 | RDEPENDS_${PN} = "gettext-runtime" | ||
15 | |||
16 | RDEPENDS_${PN}-ptest += "make gawk" | ||
17 | |||
18 | RDEPENDS_libvirt-libvirtd += "bridge-utils iptables pm-utils dnsmasq netcat-openbsd" | ||
19 | RDEPENDS_libvirt-libvirtd_append_x86-64 = " dmidecode" | ||
20 | RDEPENDS_libvirt-libvirtd_append_x86 = " dmidecode" | ||
21 | |||
22 | #connman blocks the 53 port and libvirtd can't start its DNS service | ||
23 | RCONFLICTS_${PN}_libvirtd = "connman" | ||
24 | |||
25 | SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz;name=libvirt \ | ||
26 | file://tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch \ | ||
27 | file://libvirtd.sh \ | ||
28 | file://libvirtd.conf \ | ||
29 | file://runptest.patch \ | ||
30 | file://run-ptest \ | ||
31 | file://tests-allow-separated-src-and-build-dirs.patch \ | ||
32 | file://libvirt-use-pkg-config-to-locate-libcap.patch \ | ||
33 | file://0001-to-fix-build-error.patch \ | ||
34 | file://Revert-build-add-prefix-to-SYSTEMD_UNIT_DIR.patch \ | ||
35 | file://install-missing-file.patch \ | ||
36 | " | ||
37 | |||
38 | SRC_URI[libvirt.md5sum] = "f9dc1e63d559eca50ae0ee798a4c6c6d" | ||
39 | SRC_URI[libvirt.sha256sum] = "93a23c44eb431da46c9458f95a66e29c9b98e37515d44b6be09e75b35ec94ac8" | ||
40 | |||
41 | inherit autotools gettext update-rc.d pkgconfig ptest systemd | ||
42 | |||
43 | CACHED_CONFIGUREVARS += "\ | ||
44 | ac_cv_path_XMLLINT=/usr/bin/xmllint \ | ||
45 | ac_cv_path_XMLCATLOG=/usr/bin/xmlcatalog \ | ||
46 | ac_cv_path_AUGPARSE=/usr/bin/augparse \ | ||
47 | ac_cv_path_DNSMASQ=/usr/bin/dnsmasq \ | ||
48 | ac_cv_path_BRCTL=/usr/sbin/brctl \ | ||
49 | ac_cv_path_TC=/sbin/tc \ | ||
50 | ac_cv_path_UDEVADM=/sbin/udevadm \ | ||
51 | ac_cv_path_MODPROBE=/sbin/modprobe \ | ||
52 | ac_cv_path_IP_PATH=/bin/ip \ | ||
53 | ac_cv_path_IPTABLES_PATH=/usr/sbin/iptables \ | ||
54 | ac_cv_path_IP6TABLES_PATH=/usr/sbin/ip6tables \ | ||
55 | ac_cv_path_MOUNT=/bin/mount \ | ||
56 | ac_cv_path_UMOUNT=/bin/umount \ | ||
57 | ac_cv_path_MKFS=/usr/sbin/mkfs \ | ||
58 | ac_cv_path_SHOWMOUNT=/usr/sbin/showmount \ | ||
59 | ac_cv_path_PVCREATE=/usr/sbin/pvcreate \ | ||
60 | ac_cv_path_VGCREATE=/usr/sbin/vgcreate \ | ||
61 | ac_cv_path_LVCREATE=/usr/sbin/lvcreate \ | ||
62 | ac_cv_path_PVREMOVE=/usr/sbin/pvremove \ | ||
63 | ac_cv_path_VGREMOVE=/usr/sbin/vgremove \ | ||
64 | ac_cv_path_LVREMOVE=/usr/sbin/lvremove \ | ||
65 | ac_cv_path_LVCHANGE=/usr/sbin/lvchange \ | ||
66 | ac_cv_path_VGCHANGE=/usr/sbin/vgchange \ | ||
67 | ac_cv_path_VGSCAN=/usr/sbin/vgscan \ | ||
68 | ac_cv_path_PVS=/usr/sbin/pvs \ | ||
69 | ac_cv_path_VGS=/usr/sbin/vgs \ | ||
70 | ac_cv_path_LVS=/usr/sbin/lvs \ | ||
71 | ac_cv_path_PARTED=/usr/sbin/parted \ | ||
72 | ac_cv_path_DMSETUP=/usr/sbin/dmsetup" | ||
73 | |||
74 | # Ensure that libvirt uses polkit rather than policykit, whether the host has | ||
75 | # pkcheck installed or not, and ensure the path is correct per our config. | ||
76 | CACHED_CONFIGUREVARS += "ac_cv_path_PKCHECK_PATH=${bindir}/pkcheck" | ||
77 | |||
78 | # Some other possible paths we are not yet setting | ||
79 | #ac_cv_path_RPCGEN= | ||
80 | #ac_cv_path_XSLTPROC= | ||
81 | #ac_cv_path_RADVD= | ||
82 | #ac_cv_path_UDEVSETTLE= | ||
83 | #ac_cv_path_EBTABLES_PATH= | ||
84 | #ac_cv_path_PKG_CONFIG= | ||
85 | #ac_cv_path_ac_pt_PKG_CONFIG | ||
86 | #ac_cv_path_POLKIT_AUTH= | ||
87 | #ac_cv_path_DTRACE= | ||
88 | #ac_cv_path_ISCSIADM= | ||
89 | #ac_cv_path_MSGFMT= | ||
90 | #ac_cv_path_GMSGFMT= | ||
91 | #ac_cv_path_XGETTEXT= | ||
92 | #ac_cv_path_MSGMERGE= | ||
93 | #ac_cv_path_SCRUB= | ||
94 | #ac_cv_path_PYTHON= | ||
95 | |||
96 | ALLOW_EMPTY_${PN} = "1" | ||
97 | |||
98 | PACKAGES =+ "${PN}-libvirtd ${PN}-virsh" | ||
99 | |||
100 | ALLOW_EMPTY_${PN}-libvirtd = "1" | ||
101 | |||
102 | FILES_${PN}-libvirtd = " \ | ||
103 | ${sysconfdir}/init.d \ | ||
104 | ${sysconfdir}/sysctl.d \ | ||
105 | ${sysconfdir}/logrotate.d \ | ||
106 | ${sysconfdir}/libvirt/libvirtd.conf \ | ||
107 | /usr/lib/sysctl.d/60-libvirtd.conf \ | ||
108 | ${sbindir}/libvirtd \ | ||
109 | ${systemd_unitdir}/system/* \ | ||
110 | ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', '${libexecdir}/libvirt-guests.sh', d)} \ | ||
111 | " | ||
112 | |||
113 | FILES_${PN}-virsh = "${bindir}/virsh" | ||
114 | FILES_${PN} += "${libdir}/libvirt/connection-driver \ | ||
115 | ${datadir}/augeas \ | ||
116 | ${datadir}/polkit-1" | ||
117 | |||
118 | FILES_${PN}-dbg += "${libdir}/libvirt/connection-driver/.debug ${libdir}/libvirt/lock-driver/.debug" | ||
119 | FILES_${PN}-staticdev += "${libdir}/*.a ${libdir}/libvirt/connection-driver/*.a ${libdir}/libvirt/lock-driver/*.a" | ||
120 | |||
121 | CONFFILES_${PN} += "${sysconfdir}/libvirt/libvirt.conf \ | ||
122 | ${sysconfdir}/libvirt/lxc.conf \ | ||
123 | ${sysconfdir}/libvirt/qemu-lockd.conf \ | ||
124 | ${sysconfdir}/libvirt/qemu.conf \ | ||
125 | ${sysconfdir}/libvirt/virt-login-shell.conf \ | ||
126 | ${sysconfdir}/libvirt/virtlockd.conf" | ||
127 | |||
128 | CONFFILES_${PN}-libvirtd = "${sysconfdir}/logrotate.d/libvirt ${sysconfdir}/logrotate.d/libvirt.lxc \ | ||
129 | ${sysconfdir}/logrotate.d/libvirt.qemu ${sysconfdir}/logrotate.d/libvirt.uml \ | ||
130 | ${sysconfdir}/libvirt/libvirtd.conf \ | ||
131 | /usr/lib/sysctl.d/libvirtd.conf" | ||
132 | |||
133 | INITSCRIPT_PACKAGES = "${PN}-libvirtd" | ||
134 | INITSCRIPT_NAME_${PN}-libvirtd = "libvirtd" | ||
135 | INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72" | ||
136 | |||
137 | SYSTEMD_PACKAGES = "${PN}-libvirtd" | ||
138 | SYSTEMD_SERVICE_${PN}-libvirtd = " \ | ||
139 | libvirtd.service \ | ||
140 | virtlockd.service \ | ||
141 | libvirt-guests.service \ | ||
142 | virtlockd.socket \ | ||
143 | " | ||
144 | |||
145 | |||
146 | PRIVATE_LIBS_${PN}-ptest = " \ | ||
147 | libvirt-lxc.so.0 \ | ||
148 | libvirt.so.0 \ | ||
149 | libvirt-qemu.so.0 \ | ||
150 | lockd.so \ | ||
151 | libvirt_driver_secret.so \ | ||
152 | libvirt_driver_nodedev.so \ | ||
153 | libvirt_driver_vbox.so \ | ||
154 | libvirt_driver_interface.so \ | ||
155 | libvirt_driver_uml.so \ | ||
156 | libvirt_driver_network.so \ | ||
157 | libvirt_driver_nwfilter.so \ | ||
158 | libvirt_driver_qemu.so \ | ||
159 | libvirt_driver_storage.so \ | ||
160 | libvirt_driver_lxc.so \ | ||
161 | " | ||
162 | |||
163 | # xen-minimal config | ||
164 | #PACKAGECONFIG ??= "xen libxl xen-inotify test remote libvirtd" | ||
165 | |||
166 | # full config | ||
167 | PACKAGECONFIG ??= "qemu yajl uml openvz vmware vbox esx iproute2 lxc test \ | ||
168 | remote macvtap libvirtd netcf udev python ebtables \ | ||
169 | ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux audit libcap-ng', '', d)} \ | ||
170 | ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen libxl xen-inotify', '', d)} \ | ||
171 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'polkit', '', d)} \ | ||
172 | " | ||
173 | |||
174 | # enable,disable,depends,rdepends | ||
175 | # | ||
176 | PACKAGECONFIG[qemu] = "--with-qemu,--without-qemu,qemu," | ||
177 | PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl" | ||
178 | PACKAGECONFIG[xen] = "--with-xen,--without-xen,xen," | ||
179 | PACKAGECONFIG[xenapi] = "--with-xenapi,--without-xenapi,," | ||
180 | PACKAGECONFIG[libxl] = "--with-libxl=${STAGING_DIR_TARGET}/lib,--without-libxl,libxl," | ||
181 | PACKAGECONFIG[xen-inotify] = "--with-xen-inotify,--without-xen-inotify,xen," | ||
182 | PACKAGECONFIG[uml] = "--with-uml, --without-uml,," | ||
183 | PACKAGECONFIG[openvz] = "--with-openvz,--without-openvz,," | ||
184 | PACKAGECONFIG[vmware] = "--with-vmware,--without-vmware,," | ||
185 | PACKAGECONFIG[phyp] = "--with-phyp,--without-phyp,," | ||
186 | PACKAGECONFIG[vbox] = "--with-vbox,--without-vbox,," | ||
187 | PACKAGECONFIG[esx] = "--with-esx,--without-esx,," | ||
188 | PACKAGECONFIG[hyperv] = "--with-hyperv,--without-hyperv,," | ||
189 | PACKAGECONFIG[polkit] = "--with-polkit,--without-polkit,polkit,polkit" | ||
190 | PACKAGECONFIG[lxc] = "--with-lxc,--without-lxc, lxc," | ||
191 | PACKAGECONFIG[test] = "--with-test=yes,--with-test=no,," | ||
192 | PACKAGECONFIG[remote] = "--with-remote,--without-remote,," | ||
193 | PACKAGECONFIG[macvtap] = "--with-macvtap=yes,--with-macvtap=no,libnl,libnl" | ||
194 | PACKAGECONFIG[libvirtd] = "--with-libvirtd,--without-libvirtd,," | ||
195 | PACKAGECONFIG[netcf] = "--with-netcf,--without-netcf,netcf,netcf" | ||
196 | PACKAGECONFIG[dtrace] = "--with-dtrace,--without-dtrace,," | ||
197 | PACKAGECONFIG[udev] = "--with-udev --with-pciaccess,--without-udev,udev libpciaccess," | ||
198 | PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux," | ||
199 | PACKAGECONFIG[ebtables] = "ac_cv_path_EBTABLES_PATH=/sbin/ebtables,ac_cv_path_EBTABLES_PATH=,ebtables,ebtables" | ||
200 | PACKAGECONFIG[python] = ",,python," | ||
201 | PACKAGECONFIG[sasl] = "--with-sasl,--without-sasl,cyrus-sasl,cyrus-sasl" | ||
202 | PACKAGECONFIG[iproute2] = "ac_cv_path_IP_PATH=/sbin/ip,ac_cv_path_IP_PATH=,iproute2,iproute2" | ||
203 | PACKAGECONFIG[numactl] = "--with-numactl,--without-numactl,numactl," | ||
204 | PACKAGECONFIG[fuse] = "--with-fuse,--without-fuse,fuse," | ||
205 | PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit," | ||
206 | PACKAGECONFIG[libcap-ng] = "--with-capng,--without-capng,libcap-ng," | ||
207 | |||
208 | # Enable the Python tool support | ||
209 | require libvirt-python.inc | ||
210 | |||
211 | do_install_append() { | ||
212 | install -d ${D}/etc/init.d | ||
213 | install -d ${D}/etc/libvirt | ||
214 | |||
215 | install -m 0755 ${WORKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd | ||
216 | install -m 0644 ${WORKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf | ||
217 | |||
218 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then | ||
219 | # This will wind up in the libvirtd package, but will NOT be invoked by default. | ||
220 | # | ||
221 | mv ${D}/${libexecdir}/libvirt-guests.sh ${D}/${sysconfdir}/init.d | ||
222 | fi | ||
223 | |||
224 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
225 | # This variable is used by libvirtd.service to start libvirtd in the right mode | ||
226 | sed -i '/#LIBVIRTD_ARGS="--listen"/a LIBVIRTD_ARGS="--listen --daemon"' ${D}/${sysconfdir}/sysconfig/libvirtd | ||
227 | |||
228 | # We can't use 'notify' when we don't support 'sd_notify' dbus capabilities. | ||
229 | sed -i -e 's/Type=notify/Type=forking/' \ | ||
230 | -e '/Type=forking/a PIDFile=${localstatedir}/run/libvirtd.pid' \ | ||
231 | ${D}/${systemd_unitdir}/system/libvirtd.service | ||
232 | fi | ||
233 | |||
234 | # The /var/run/libvirt directories created by the Makefile | ||
235 | # are wiped out in volatile, we need to create these at boot. | ||
236 | rm -rf ${D}${localstatedir}/run | ||
237 | install -d ${D}${sysconfdir}/default/volatiles | ||
238 | echo "d root root 0755 ${localstatedir}/run/libvirt none" \ | ||
239 | > ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
240 | echo "d root root 0755 ${localstatedir}/run/libvirt/lockd none" \ | ||
241 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
242 | echo "d root root 0755 ${localstatedir}/run/libvirt/lxc none" \ | ||
243 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
244 | echo "d root root 0755 ${localstatedir}/run/libvirt/network none" \ | ||
245 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
246 | echo "d root root 0755 ${localstatedir}/run/libvirt/qemu none" \ | ||
247 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
248 | |||
249 | # Add hook support for libvirt | ||
250 | mkdir -p ${D}/etc/libvirt/hooks | ||
251 | |||
252 | # remove .la references to our working diretory | ||
253 | for i in `find ${D}${libdir} -type f -name *.la`; do | ||
254 | sed -i -e 's#-L${B}/src/.libs##g' $i | ||
255 | done | ||
256 | } | ||
257 | |||
258 | EXTRA_OECONF += " \ | ||
259 | --with-init-script=systemd \ | ||
260 | " | ||
261 | |||
262 | EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH}" | ||
263 | |||
264 | do_compile_ptest() { | ||
265 | oe_runmake -C tests buildtest-TESTS | ||
266 | } | ||
267 | |||
268 | do_install_ptest() { | ||
269 | oe_runmake -C tests install-ptest | ||
270 | |||
271 | find ${S}/tests -maxdepth 1 -type d -exec cp -r {} ${D}${PTEST_PATH}/tests/ \; | ||
272 | |||
273 | # remove .la files for ptest, they aren't required and can trigger QA errors | ||
274 | for i in `find ${D}${PTEST_PATH} -type f -name *.la`; do | ||
275 | rm -f $i | ||
276 | done | ||
277 | } | ||
278 | |||
279 | pkg_postinst_libvirt() { | ||
280 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then | ||
281 | /etc/init.d/populate-volatile.sh update | ||
282 | fi | ||
283 | } | ||
284 | |||
285 | python () { | ||
286 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): | ||
287 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") | ||
288 | } | ||