]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
[Tools GuestInfo] Return proper osname for Oracle Linux 6 / 7
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:52 +0000 (11:22 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:52 +0000 (11:22 -0700)
 Updated the code to detect Oracle Linux 6 and Oracle Linux 7 and return
 proper osname acocrdingly.

open-vm-tools/lib/include/guest_os.h
open-vm-tools/lib/misc/hostinfoPosix.c

index 550841ebfc4541f473be032612c3ca4479ccef3b..1e8d12347af8192acdc4db9b0023e42ffefc0ea7 100644 (file)
@@ -238,6 +238,8 @@ Bool Gos_InSetArray(uint32 gos, const uint32 *set);
 #define STR_OS_MKLINUX            "MkLinux"
 #define STR_OS_NOVELL             "nld9"
 #define STR_OS_NOVELL_FULL        "Novell Linux Desktop 9"
+#define STR_OS_ORACLE6            "oraclelinux6"
+#define STR_OS_ORACLE7            "oraclelinux7"
 #define STR_OS_ORACLE             "oraclelinux"
 #define STR_OS_OTHER              "otherlinux"
 #define STR_OS_OTHER_FULL         "Other Linux"
index ac10f66e4994e7e3a4adec7911e9949006a6eef3..33c1fc64b8b64083b3ac6d705fd9b7699a6a10b8 100644 (file)
@@ -611,7 +611,13 @@ HostinfoGetOSShortName(char *distro,         // IN: full distro name
        * Not sure why they didn't brand their releases as "Oracle Enterprise
        * Linux". Oh well. It's fixed in 6.0, though.
        */
-      Str_Strcpy(distroShort, STR_OS_ORACLE, distroShortSize);
+      if (strstr(distroLower, "6.")) {
+         Str_Strcpy(distroShort, STR_OS_ORACLE6, distroShortSize);
+      } else if (strstr(distroLower, "7.")) {
+         Str_Strcpy(distroShort, STR_OS_ORACLE7, distroShortSize);
+      } else {
+         Str_Strcpy(distroShort, STR_OS_ORACLE, distroShortSize);
+      }
    } else if (strstr(distroLower, "fedora")) {
       Str_Strcpy(distroShort, STR_OS_FEDORA, distroShortSize);
    } else if (strstr(distroLower, "gentoo")) {