]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Pre-enablment: Recognition of FreeBSD 13
authorOliver Kurth <okurth@vmware.com>
Tue, 26 May 2020 22:32:56 +0000 (15:32 -0700)
committerOliver Kurth <okurth@vmware.com>
Tue, 26 May 2020 22:32:56 +0000 (15:32 -0700)
open-vm-tools/lib/include/guest_os.h
open-vm-tools/lib/include/guest_os_tables.h
open-vm-tools/lib/misc/hostinfoPosix.c

index 31566d1fa5776feb38ca366c52ab8a09ac6d157d..03e5f04b187c28046d3e81fabbbff6e7519d0279 100644 (file)
@@ -86,7 +86,8 @@ Bool Gos_InSetArray(uint32 gos, const uint32 *set);
 
 #define ALLFREEBSD            BS(FREEBSD),   BS(FREEBSD_64),   \
                               BS(FREEBSD11), BS(FREEBSD11_64), \
-                              BS(FREEBSD12), BS(FREEBSD12_64)
+                              BS(FREEBSD12), BS(FREEBSD12_64), \
+                              BS(FREEBSD13), BS(FREEBSD13_64)
 
 #define ALLWINNET32           BS(WINNET)
 #define ALLWINNET64           BS(WINNET_64)
@@ -555,6 +556,7 @@ Bool Gos_InSetArray(uint32 gos, const uint32 *set);
 #define STR_OS_FREEBSD   "freeBSD"
 #define STR_OS_FREEBSD11 "freeBSD11"
 #define STR_OS_FREEBSD12 "freeBSD12"
+#define STR_OS_FREEBSD13 "freeBSD13"
 
 /* Solaris */
 #define STR_OS_SOLARIS "solaris"
index 4dbf27af047b7d3682795b11e2fbc3742206d12f..25b88d5f9abda68676a0f9495b234ae59279d484 100644 (file)
@@ -84,6 +84,8 @@ extern "C" {
    GOT(GUEST_OS_FREEBSD11_64)                                              \
    GOT(GUEST_OS_FREEBSD12)                                                 \
    GOT(GUEST_OS_FREEBSD12_64)                                              \
+   GOT(GUEST_OS_FREEBSD13)                                                 \
+   GOT(GUEST_OS_FREEBSD13_64)                                              \
    GOT(GUEST_OS_SOLARIS_6_AND_7)                                           \
    GOT(GUEST_OS_SOLARIS8)                                                  \
    GOT(GUEST_OS_SOLARIS9)                                                  \
index 26c3efd8918f1d994a1ac8e298f495c66ed2e13b..26f3ca7d594f984c9071c061c3bf8fbbb760cef5 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 1998-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2020 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -1720,16 +1720,37 @@ HostinfoBSD(struct utsname *buf)  // IN:
    majorVersion = Hostinfo_OSVersion(0);
 
    /*
-    * FreeBSD 11 and later are identified using a different guest ID.
+    * FreeBSD 11 and later are identified using a different guest ID than
+    * older FreeBSD.
     */
-   if (majorVersion >= 11) {
-      if (majorVersion >= 12) {
-         Str_Strcpy(distroShort, STR_OS_FREEBSD12, sizeof distroShort);
-      } else {
-         Str_Strcpy(distroShort, STR_OS_FREEBSD11, sizeof distroShort);
-      }
-   } else {
+   switch (majorVersion) {
+   case 1:
+   case 2:
+   case 3:
+   case 4:
+   case 5:
+   case 6:
+   case 7:
+   case 8:
+   case 9:
+   case 10:
       Str_Strcpy(distroShort, STR_OS_FREEBSD, sizeof distroShort);
+      break;
+
+   case 11:
+      Str_Strcpy(distroShort, STR_OS_FREEBSD11, sizeof distroShort);
+      break;
+
+   case 12:
+      Str_Strcpy(distroShort, STR_OS_FREEBSD12, sizeof distroShort);
+      break;
+
+   default: // Unknown defaults to the highest known.
+      /* FALL THROUGH */
+
+   case 13:
+      Str_Strcpy(distroShort, STR_OS_FREEBSD13, sizeof distroShort);
+      break;
    }
 
    len = Str_Snprintf(osNameFull, sizeof osNameFull, "%s %s", buf->sysname,