1. 安装基本软件包
yum -y install openssh-clients gcc g++ make automake autoconf wget glibc-devel glibc-devel.i686 libaio rpm-build yum-utils transfig libidn-devel zlib-devel texi2html SDL-devel curl-devel libX11-devel Python-devel ghostscript tetex-latex ncurses-devel gtk2-devel libaio-devel texinfo dev86 gettext gnutls-devel openssl-devel pciutils-devel libuuid-devel iasl bzip2-devel xz-devel e2fsprogs-devel PyXML kpartx bridge-utils libsysfs-devel libsysfs libnl-devel libtool nfs-utils libxml2-devel xhtml1-dtds readline-devel libudev-devel libpciaccess-devel yajl-devel libpcap-devel avahi-devel dnsmasq cyrus-sasl-devel polkit lvm2 iscsi-initiator-utils parted-devel device-mapper-devel numactl-devel libcap-ng-devel netcf-devel ebtables lzop nc cyrus-sasl-md5 python-virtinst
2. 安装qemuwget Fedora/linux/updates/13/x86_64/qemu-common-0.13.0-1.fc13.x86_64.rpm wget rpm -Uvh qemu-*.rpm
3. 通过srpm编译安装Xen
wget rpm -i xen-4.1.1-3.fc15.src.rpm cd ~/rpmbuild/SPECS/ rpmbuild -bb xen.spec cd ~/rpmbuild/RPMS/x86_64/ rpm -Uvh xen-*4.1.1-*.rpm
4. 修改bridge-utils, CentOS 6.0的默认内核被加了IGMP的patch, 其自带的bridge-utils也打了这个patch, 在非rhel6的内核上运行会出现很多没用的提示。yumdownloader --source bridge-utils rpm -i bridge-utils-1.2-9.el6.src.rpm # 版本可能不同 cd ~/rpmbuild/SPECS/ vi bridge-utils.spec # 去除两行有patch4的地方, 也即有IGMP的patch的行 rpmbuild -bb bridge-utils.spec cd ~/rpmbuild/RPMS/x86_64/ rpm -Uvh --force bridge-utils-1.2-9.el6.x86_64.rpm
提供一个patch
--- bridge-utils.spec.orig 2010-04-30 00:29:16.000000000 +0800 +++ bridge-utils.spec 2011-09-30 23:27:19.090747706 +0800 @@ -10,7 +10,6 @@ Patch1: bridge-utils-1.2-show-ports.patch Patch2: bridge-utils-1.2-foreach.patch Patch3: bridge-utils-1.2-params.patch -Patch4: bridge-utils-1.2-Add_IGMP_snooping_support.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: libsysfs-devel autoconf @@ -32,7 +31,6 @@ %patch1 -p1 %patch2 -p1 %patch3 -p1 -%patch4 -p1 -b .Add_IGMP_snooping_support %build autoconf
5. 安装libvirt, CentOS6自带的不支持xen, 需要打开xen的选项重新编译yumdownloader --source libvirt rpm -i libvirt-0.8.1-27.el6_0.6.src.rpm # 版本可能不同 cd ~/rpmbuild/SPECS/ vi libvirt.spec # 按下面的patch修改 rpmbuild -bb libvirt.spec cd ~/rpmbuild/RPMS/x86_64/ rpm -Uvh libvirt-*0.8.1*.rpm
Patch:--- libvirt.spec.orig 2010-08-18 15:02:53.000000000 +0300 +++ libvirt.spec 2010-11-15 14:17:36.388996162 +0200 @@ -104,7 +104,7 @@ %ifnarch x86_64 %define with_qemu 0 %endif -%define with_xen 0 +%define with_xen 1 %endif # If Xen isn't turned on, we shouldn't build the xen proxy either
6. 安装python-virtinst,旧的版本不支持的参数太多了