Browse code

Add XenServer to GetDistro's logic

This is primarily to satisfy the expectations of various scripts that os_*
variables are defined, and will result in a distro similar to "xs6.1.0-59235p"

Fixes bug 1211001

Change-Id: I951e1eb3a5e25f4d8773a11b15cf38157b6492fe

Bob Ball authored on 2013/08/13 01:28:50
Showing 2 changed files
... ...
@@ -387,8 +387,9 @@ GetOSVersion() {
387 387
         # CentOS release 5.5 (Final)
388 388
         # CentOS Linux release 6.0 (Final)
389 389
         # Fedora release 16 (Verne)
390
+        # XenServer release 6.2.0-70446c (xenenterprise)
390 391
         os_CODENAME=""
391
-        for r in "Red Hat" CentOS Fedora; do
392
+        for r in "Red Hat" CentOS Fedora XenServer; do
392 393
             os_VENDOR=$r
393 394
             if [[ -n "`grep \"$r\" /etc/redhat-release`" ]]; then
394 395
                 ver=`sed -e 's/^.* \(.*\) (\(.*\)).*$/\1\|\2/' /etc/redhat-release`
... ...
@@ -451,6 +452,8 @@ function GetDistro() {
451 451
     elif [[ "$os_VENDOR" =~ (Red Hat) || "$os_VENDOR" =~ (CentOS) ]]; then
452 452
         # Drop the . release as we assume it's compatible
453 453
         DISTRO="rhel${os_RELEASE::1}"
454
+    elif [[ "$os_VENDOR" =~ (XenServer) ]]; then
455
+        DISTRO="xs$os_RELEASE"
454 456
     else
455 457
         # Catch-all for now is Vendor + Release + Update
456 458
         DISTRO="$os_VENDOR-$os_RELEASE.$os_UPDATE"
... ...
@@ -29,6 +29,10 @@ THIS_DIR=$(cd $(dirname "$0") && pwd)
29 29
 # xapi functions
30 30
 . $THIS_DIR/functions
31 31
 
32
+# Determine what system we are running on.
33
+# Might not be XenServer if we're using xenserver-core
34
+GetDistro
35
+
32 36
 #
33 37
 # Get Settings
34 38
 #