Browse Source

Add support for CentOS 7

Added support for CentOS 7.

Change-Id: I3e82aa79cc632e833e8d8d044953e68fd0dd6c9f
stack 1 year ago
parent
commit
6aa96dd912

+ 28
- 8
devstack/libs/libvirt View File

@@ -80,6 +80,8 @@ function clone_libvirt_qemu {
80 80
 }
81 81
 
82 82
 function install_libvirt_src {
83
+    uninstall_package libvirt*
84
+
83 85
     if [ -e "${LIBVIRT_DIR}/BUILD_COMPLETE" ]; then
84 86
         echo "Libvirt already built."
85 87
         pushd ${LIBVIRT_DIR}
@@ -115,13 +117,21 @@ function install_qemu_src {
115 117
 
116 118
 function add_repositories {
117 119
     if is_ubuntu; then
118
-        if ! [[ $(dpkg --get-selections | ag software-properties-common) ]]; then
120
+        if ! [[ $(dpkg --get-selections | grep software-properties-common) ]]; then
119 121
             sudo_with_proxies apt-get install -y software-properties-common
120 122
         fi
121 123
         sudo_with_proxies add-apt-repository -s 'deb http://archive.ubuntu.com/ubuntu/ xenial main'
122
-        sudo_with_proxies apt-get update
123
-    #else
124
-        #TODO(ralonsoh): add Red Hat needed repositories.
124
+        sudo_with_proxies apt-get update || /bin/true
125
+    else
126
+        if ! [[ $(yum repolist | grep ftp.pbone.net_mirror_ftp.centos.org_7_os_x86_64_) ]]; then
127
+            sudo_with_proxies yum-config-manager --add-repo ftp://ftp.pbone.net/mirror/ftp.centos.org/7/os/x86_64/
128
+            sudo_with_proxies yum-config-manager --enable ftp.pbone.net_mirror_ftp.centos.org_7_os_x86_64_
129
+        fi
130
+        if ! [[ $(yum repolist | grep ftp.pbone.net_mirror_ftp5.gwdg.de_pub_opensuse_repositories_utilities_CentOS_6_) ]]; then
131
+            sudo_with_proxies yum-config-manager --add-repo ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/utilities/CentOS_6/
132
+            sudo_with_proxies yum-config-manager --enable ftp.pbone.net_mirror_ftp5.gwdg.de_pub_opensuse_repositories_utilities_CentOS_6_
133
+        fi
134
+        sudo_with_proxies yum update -y || /bin/true
125 135
     fi
126 136
 }
127 137
 
@@ -164,7 +174,7 @@ function install_libvirt_qemu_src {
164 174
         add_repositories
165 175
         install_build_deps libvirt-bin
166 176
         install_build_deps qemu-kvm
167
-		install_package libnuma-dev gcc make build-essential autopoint
177
+        install_package libnuma-dev gcc make build-essential autopoint
168 178
     else
169 179
         if [ rpm -qa | grep libvirtd > /dev/null ]; then
170 180
             stop_service libvirtd
@@ -172,9 +182,9 @@ function install_libvirt_qemu_src {
172 182
         if [ rpm -qa | grep libvirt0 > /dev/null ]; then
173 183
             yum remove libvirt0
174 184
         fi
175
-        install_build_deps libvirtd
185
+        install_build_deps libvirt
176 186
         install_build_deps qemu
177
-        install_package libnuma-devel gcc make autopoint pkg-config
187
+        install_package libnuma-devel gcc make gettext-devel pkgconfig
178 188
     fi
179 189
     set -o errexit
180 190
 
@@ -193,7 +203,6 @@ function install_libvirt_qemu_src {
193 203
         sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd || /bin/true
194 204
         start_service libvirt-bin
195 205
     else
196
-        #TODO(ralonsoh): check if Red Hat needs selinux permissive mode
197 206
         start_service libvirtd
198 207
     fi
199 208
     start_service virtlogd
@@ -205,7 +214,18 @@ function cleanup_libvirt_qemu_source {
205 214
     sudo rm -rf ${QEMU_DIR}
206 215
 }
207 216
 
217
+function _remove_old_libraries {
218
+    if test -d /usr/lib64; then
219
+        libdir=/usr/lib64
220
+    else
221
+        libdir=/usr/lib
222
+    fi
223
+    sudo rm -rf ${libdir}/libvirt*
224
+}
225
+
208 226
 function uninstall_libvirt_qemu {
227
+    _remove_old_libraries
228
+
209 229
     pushd ${LIBVIRT_DIR}
210 230
         sudo make uninstall
211 231
     popd

+ 2
- 1
doc/source/installation.rst View File

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

+ 4
- 0
releasenotes/notes/add-support-for-centos7-8ae185ed97890707.yaml View File

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

Loading…
Cancel
Save