tuto:virtualisation:compiler_la_derniere_version_de_libvirt

Ceci est une ancienne révision du document !


Compiler la dernière version de libvirt

Il peut être nécessaire de compiler la dernière version de libvirt car le dépôt lfarkas n'est hyper à jour pour ce paquet (dernière version, la 0.6.4)

Pour cela, il faut disposer d'une CentOS 5 de développement (de préférence en x86_64)

Récupérer un RPM depuis depuis http://sme-mirror.voxteneo.com/releases/testing/8/smedev/i386/RPMS/ (mezzanine est en noarch, donc pas grave si c'est dans un dépôt pour i386). Puis l'installer via yum localinstall

mkdir localdev

Vérifier la dernière version de libvirt sur la page http://libvirt.org/sources/ et récupérer le srpm (pour fedora) Puis l'importer par mezzanine:

mzimport -L libvirt*.src.rpm
cd libvirt

Normalement, aucune modification n'est nécessaire, le spec fournit prend en charge la plateforme el5 On passe juste certains arguments, qui désactive les fonctions non utilisées

À partir de la v 0.8.1, il faut faire une toute petite modification du fichier spec, un test doit être désactivé, car notre version de libxml2 a un bug:

Chercher la section

for i in nodeinfotest daemon-conf seclabeltest
do
  rm -f $i
  printf "#!/bin/sh\nexit 0\n" > $i
  chmod +x $i
done

et la remplacer par

for i in nodeinfotest daemon-conf seclabeltest interfaceschematest
do
  rm -f $i
  printf "#!/bin/sh\nexit 0\n" > $i
  chmod +x $i
done
mzbuild -A "--without xen --without xen-proxy \
            --without lxc --without vbox --without esx \
            --without phyp --without one --without avahi \
            --without openvz --without uml --with nwfilter \
            --with libpcap"

Certaines dépendances seront demandés

Pour compiler avec un serveur de build (type plague), il faut applliquer ce patch au fichier spec:

Patch pour le fichier spec

Patch pour le fichier spec

--- F/libvirt.spec.orig 2011-01-04 09:08:53.000000000 +0100
+++ F/libvirt.spec      2011-01-06 13:01:06.000000000 +0100
@@ -107,6 +107,14 @@
 %define with_lxc 0
 %endif
 
+# Custom Firewall-Services
+%if 0%{?rhel} == 5
+%define with_avahi 0
+%define with_xen 0
+%define with_esx 0
+%endif
+# End customization
+
 # RHEL-6 has restricted QEMU to x86_64 only, stopped including Xen
 # on all archs. Other archs all have LXC available though
 %if 0%{?rhel} >= 6
@@ -177,7 +185,7 @@
 %endif
 
 # Force QEMU to run as non-root
-%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+%if 0%{?fedora} >= 12 || 0%{?rhel} >= 5
 %define qemu_user  qemu
 %define qemu_group  qemu
 %else
@@ -705,7 +713,7 @@
 %check
 cd tests
 # These 3 tests don't current work in a mock build root
-for i in nodeinfotest daemon-conf seclabeltest
+for i in virshtest nodeinfotest daemon-conf seclabeltest interfaceschematest
 do
   rm -f $i
   printf "#!/bin/sh\nexit 0\n" > $i
  • tuto/virtualisation/compiler_la_derniere_version_de_libvirt.1297939591.txt.gz
  • Dernière modification: 17/02/2011 11:46
  • de dani