From: Oliver Kurth Date: Tue, 26 May 2020 22:32:56 +0000 (-0700) Subject: Pre-enablment: Recognition of FreeBSD 13 X-Git-Tag: stable-11.2.0~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a760361f0b603f0dabe2e82cec1a728e5b3f796b;p=thirdparty%2Fopen-vm-tools.git Pre-enablment: Recognition of FreeBSD 13 --- diff --git a/open-vm-tools/lib/include/guest_os.h b/open-vm-tools/lib/include/guest_os.h index 31566d1fa..03e5f04b1 100644 --- a/open-vm-tools/lib/include/guest_os.h +++ b/open-vm-tools/lib/include/guest_os.h @@ -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" diff --git a/open-vm-tools/lib/include/guest_os_tables.h b/open-vm-tools/lib/include/guest_os_tables.h index 4dbf27af0..25b88d5f9 100644 --- a/open-vm-tools/lib/include/guest_os_tables.h +++ b/open-vm-tools/lib/include/guest_os_tables.h @@ -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) \ diff --git a/open-vm-tools/lib/misc/hostinfoPosix.c b/open-vm-tools/lib/misc/hostinfoPosix.c index 26c3efd89..26f3ca7d5 100644 --- a/open-vm-tools/lib/misc/hostinfoPosix.c +++ b/open-vm-tools/lib/misc/hostinfoPosix.c @@ -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,