]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
FreeBSD now supports Arm
authorJohn Wolfe <jwolfe@vmware.com>
Fri, 26 Mar 2021 03:21:17 +0000 (20:21 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Fri, 26 Mar 2021 03:21:17 +0000 (20:21 -0700)
Upgrade the guest identification code to handle this.

open-vm-tools/lib/misc/hostinfoPosix.c

index 54bf91d338441fa1caa2fe940dce3049a67560da..65b9619c92941bd32a327dff505aab14aeb72f22 100644 (file)
@@ -2108,34 +2108,12 @@ HostinfoBSD(struct utsname *buf)  // IN:
     * FreeBSD 11 and later are identified using a different guest ID than
     * older FreeBSD.
     */
-   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_FREEBSD "11", sizeof distroShort);
-      break;
-
-   case 12:
-      Str_Strcpy(distroShort, STR_OS_FREEBSD "12", sizeof distroShort);
-      break;
 
-   default: // Unknown defaults to the highest known.
-      /* FALL THROUGH */
-
-   case 13:
-      Str_Strcpy(distroShort, STR_OS_FREEBSD "13", sizeof distroShort);
-      break;
+   if (majorVersion < 11) {
+      Str_Strcpy(distroShort, STR_OS_FREEBSD, sizeof distroShort);
+   } else {
+      Str_Sprintf(distroShort, sizeof distroShort, "%s%s%d",
+                  HostinfoArchString(), STR_OS_FREEBSD, majorVersion);
    }
 
    len = Str_Snprintf(osNameFull, sizeof osNameFull, "%s %s", buf->sysname,