Browse code

Add distro support for KVM for IBM z Systems

Add "KVM for IBM z Systems" to the list of Fedora-like distros.

As the distribution does not have a dedicated kvm package,
prevent the installation of the kvm package during the libvirt
setup.

Conflicts:
stack.sh

cherry-picked from a5ea08b7526bee0d9cab51000a477654726de8fe

Change-Id: Ibb5c60797d6867264f9dea7fea85cdf1d7c72ded

Alexander Schmidt authored on 2015/12/03 00:30:44
Showing 3 changed files
... ...
@@ -385,6 +385,8 @@ function GetDistro {
385 385
         DISTRO="rhel${os_RELEASE::1}"
386 386
     elif [[ "$os_VENDOR" =~ (XenServer) ]]; then
387 387
         DISTRO="xs$os_RELEASE"
388
+    elif [[ "$os_VENDOR" =~ (kvmibm) ]]; then
389
+        DISTRO="${os_VENDOR}${os_RELEASE::1}"
388 390
     else
389 391
         # Catch-all for now is Vendor + Release + Update
390 392
         DISTRO="$os_VENDOR-$os_RELEASE.$os_UPDATE"
... ...
@@ -419,7 +421,7 @@ function is_fedora {
419 419
 
420 420
     [ "$os_VENDOR" = "Fedora" ] || [ "$os_VENDOR" = "Red Hat" ] || \
421 421
         [ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "OracleLinux" ] || \
422
-        [ "$os_VENDOR" = "CloudLinux" ]
422
+        [ "$os_VENDOR" = "CloudLinux" ] || [ "$os_VENDOR" = "kvmibm" ]
423 423
 }
424 424
 
425 425
 
... ...
@@ -38,7 +38,10 @@ function install_libvirt {
38 38
         fi
39 39
         #pip_install_gr <there-si-no-guestfs-in-pypi>
40 40
     elif is_fedora || is_suse; then
41
-        install_package kvm
41
+        # On "KVM for IBM z Systems", kvm does not have its own package
42
+        if [[ ! ${DISTRO} =~ "kvmibm1" ]]; then
43
+            install_package kvm
44
+        fi
42 45
         # there is a dependency issue with kvm (which is really just a
43 46
         # wrapper to qemu-system-x86) that leaves some bios files out,
44 47
         # so install qemu-kvm (which shouldn't strictly be needed, as
... ...
@@ -169,7 +169,7 @@ source $TOP_DIR/stackrc
169 169
 
170 170
 # Warn users who aren't on an explicitly supported distro, but allow them to
171 171
 # override check and attempt installation with ``FORCE=yes ./stack``
172
-if [[ ! ${DISTRO} =~ (precise|trusty|utopic|vivid|7.0|wheezy|sid|testing|jessie|f21|f22|rhel7) ]]; then
172
+if [[ ! ${DISTRO} =~ (precise|trusty|utopic|vivid|7.0|wheezy|sid|testing|jessie|f21|f22|rhel7|kvmibm1) ]]; then
173 173
     echo "WARNING: this script has not been tested on $DISTRO"
174 174
     if [[ "$FORCE" != "yes" ]]; then
175 175
         die $LINENO "If you wish to run this script anyway run with FORCE=yes"