Add support for CentOS 7

Added support for CentOS 7.

Change-Id: I3e82aa79cc632e833e8d8d044953e68fd0dd6c9f
This commit is contained in:
stack 2017-06-01 10:46:57 +01:00 committed by Rodolfo Alonso Hernandez
parent fa342a7900
commit 6aa96dd912
3 changed files with 34 additions and 9 deletions

View File

@ -80,6 +80,8 @@ function clone_libvirt_qemu {
} }
function install_libvirt_src { function install_libvirt_src {
uninstall_package libvirt*
if [ -e "${LIBVIRT_DIR}/BUILD_COMPLETE" ]; then if [ -e "${LIBVIRT_DIR}/BUILD_COMPLETE" ]; then
echo "Libvirt already built." echo "Libvirt already built."
pushd ${LIBVIRT_DIR} pushd ${LIBVIRT_DIR}
@ -115,13 +117,21 @@ function install_qemu_src {
function add_repositories { function add_repositories {
if is_ubuntu; then if is_ubuntu; then
if ! [[ $(dpkg --get-selections | ag software-properties-common) ]]; then if ! [[ $(dpkg --get-selections | grep software-properties-common) ]]; then
sudo_with_proxies apt-get install -y software-properties-common sudo_with_proxies apt-get install -y software-properties-common
fi fi
sudo_with_proxies add-apt-repository -s 'deb http://archive.ubuntu.com/ubuntu/ xenial main' sudo_with_proxies add-apt-repository -s 'deb http://archive.ubuntu.com/ubuntu/ xenial main'
sudo_with_proxies apt-get update sudo_with_proxies apt-get update || /bin/true
#else else
#TODO(ralonsoh): add Red Hat needed repositories. if ! [[ $(yum repolist | grep ftp.pbone.net_mirror_ftp.centos.org_7_os_x86_64_) ]]; then
sudo_with_proxies yum-config-manager --add-repo ftp://ftp.pbone.net/mirror/ftp.centos.org/7/os/x86_64/
sudo_with_proxies yum-config-manager --enable ftp.pbone.net_mirror_ftp.centos.org_7_os_x86_64_
fi
if ! [[ $(yum repolist | grep ftp.pbone.net_mirror_ftp5.gwdg.de_pub_opensuse_repositories_utilities_CentOS_6_) ]]; then
sudo_with_proxies yum-config-manager --add-repo ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/utilities/CentOS_6/
sudo_with_proxies yum-config-manager --enable ftp.pbone.net_mirror_ftp5.gwdg.de_pub_opensuse_repositories_utilities_CentOS_6_
fi
sudo_with_proxies yum update -y || /bin/true
fi fi
} }
@ -164,7 +174,7 @@ function install_libvirt_qemu_src {
add_repositories add_repositories
install_build_deps libvirt-bin install_build_deps libvirt-bin
install_build_deps qemu-kvm install_build_deps qemu-kvm
install_package libnuma-dev gcc make build-essential autopoint install_package libnuma-dev gcc make build-essential autopoint
else else
if [ rpm -qa | grep libvirtd > /dev/null ]; then if [ rpm -qa | grep libvirtd > /dev/null ]; then
stop_service libvirtd stop_service libvirtd
@ -172,9 +182,9 @@ function install_libvirt_qemu_src {
if [ rpm -qa | grep libvirt0 > /dev/null ]; then if [ rpm -qa | grep libvirt0 > /dev/null ]; then
yum remove libvirt0 yum remove libvirt0
fi fi
install_build_deps libvirtd install_build_deps libvirt
install_build_deps qemu install_build_deps qemu
install_package libnuma-devel gcc make autopoint pkg-config install_package libnuma-devel gcc make gettext-devel pkgconfig
fi fi
set -o errexit set -o errexit
@ -193,7 +203,6 @@ function install_libvirt_qemu_src {
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd || /bin/true sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd || /bin/true
start_service libvirt-bin start_service libvirt-bin
else else
#TODO(ralonsoh): check if Red Hat needs selinux permissive mode
start_service libvirtd start_service libvirtd
fi fi
start_service virtlogd start_service virtlogd
@ -205,7 +214,18 @@ function cleanup_libvirt_qemu_source {
sudo rm -rf ${QEMU_DIR} sudo rm -rf ${QEMU_DIR}
} }
function _remove_old_libraries {
if test -d /usr/lib64; then
libdir=/usr/lib64
else
libdir=/usr/lib
fi
sudo rm -rf ${libdir}/libvirt*
}
function uninstall_libvirt_qemu { function uninstall_libvirt_qemu {
_remove_old_libraries
pushd ${LIBVIRT_DIR} pushd ${LIBVIRT_DIR}
sudo make uninstall sudo make uninstall
popd popd

View File

@ -21,6 +21,7 @@ available to be installed. Check `The libvirt virtualization API python binding
<https://pypi.python.org/pypi/libvirt-python>`_ to find the list of available <https://pypi.python.org/pypi/libvirt-python>`_ to find the list of available
versions to be installed. versions to be installed.
This plugin has been tested manually only in: This plugin has been tested manually in:
* Ubuntu 16.04 * Ubuntu 16.04
* CentOS 7

View File

@ -0,0 +1,4 @@
---
features:
- |
Added support for CentOS 7.