diff options
3 files changed, 123 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Make-HgfsConvertFromNtTimeNsec-aware-of-64-bit-time_.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Make-HgfsConvertFromNtTimeNsec-aware-of-64-bit-time_.patch new file mode 100644 index 0000000000..61a681f17f --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Make-HgfsConvertFromNtTimeNsec-aware-of-64-bit-time_.patch | |||
@@ -0,0 +1,78 @@ | |||
1 | From caf80e220b055dbce259078be96e899dc78ec1d2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bartosz Brachaczek <b.brachaczek@gmail.com> | ||
3 | Date: Tue, 12 Nov 2019 14:31:08 +0100 | ||
4 | Subject: [PATCH] Make HgfsConvertFromNtTimeNsec aware of 64-bit time_t on i386 | ||
5 | |||
6 | I verified that this function behaves as expected on x86_64, i386 with | ||
7 | 32-bit time_t, and i386 with 64-bit time_t for the following values of | ||
8 | ntTtime: | ||
9 | |||
10 | UNIX_EPOCH-1, UNIX_EPOCH, UNIX_EPOCH+1, UNIX_S32_MAX-1, UNIX_S32_MAX, | ||
11 | UNIX_S32_MAX+1, UNIX_S32_MAX*2+1 | ||
12 | |||
13 | I did not verify whether the use of Div643264 is optimal, performance | ||
14 | wise. | ||
15 | |||
16 | Upstream-Status: Submitted [https://github.com/vmware/open-vm-tools/pull/387] | ||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | --- | ||
19 | open-vm-tools/lib/hgfs/hgfsUtil.c | 34 +++++++++++++++++-------------- | ||
20 | 1 file changed, 19 insertions(+), 15 deletions(-) | ||
21 | |||
22 | diff --git a/open-vm-tools/lib/hgfs/hgfsUtil.c b/open-vm-tools/lib/hgfs/hgfsUtil.c | ||
23 | index cc580ab8..49b10040 100644 | ||
24 | --- a/open-vm-tools/lib/hgfs/hgfsUtil.c | ||
25 | +++ b/open-vm-tools/lib/hgfs/hgfsUtil.c | ||
26 | @@ -110,23 +110,21 @@ HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT: Time in UNIX format | ||
27 | uint64 ntTime) // IN: Time in Windows NT format | ||
28 | { | ||
29 | #ifdef __i386__ | ||
30 | - uint32 sec; | ||
31 | - uint32 nsec; | ||
32 | + uint64 sec64; | ||
33 | + uint32 sec32, nsec; | ||
34 | +#endif | ||
35 | |||
36 | ASSERT(unixTime); | ||
37 | - /* We assume that time_t is 32bit */ | ||
38 | - ASSERT_ON_COMPILE(sizeof (unixTime->tv_sec) == 4); | ||
39 | |||
40 | - /* Cap NT time values that are outside of Unix time's range */ | ||
41 | + if (sizeof (unixTime->tv_sec) == 4) { | ||
42 | + /* Cap NT time values that are outside of Unix time's range */ | ||
43 | |||
44 | - if (ntTime >= UNIX_S32_MAX) { | ||
45 | - unixTime->tv_sec = 0x7FFFFFFF; | ||
46 | - unixTime->tv_nsec = 0; | ||
47 | - return 1; | ||
48 | + if (ntTime >= UNIX_S32_MAX) { | ||
49 | + unixTime->tv_sec = 0x7FFFFFFF; | ||
50 | + unixTime->tv_nsec = 0; | ||
51 | + return 1; | ||
52 | + } | ||
53 | } | ||
54 | -#else | ||
55 | - ASSERT(unixTime); | ||
56 | -#endif | ||
57 | |||
58 | if (ntTime < UNIX_EPOCH) { | ||
59 | unixTime->tv_sec = 0; | ||
60 | @@ -135,9 +133,15 @@ HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT: Time in UNIX format | ||
61 | } | ||
62 | |||
63 | #ifdef __i386__ | ||
64 | - Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec); | ||
65 | - unixTime->tv_sec = sec; | ||
66 | - unixTime->tv_nsec = nsec * 100; | ||
67 | + if (sizeof (unixTime->tv_sec) == 4) { | ||
68 | + Div643232(ntTime - UNIX_EPOCH, 10000000, &sec32, &nsec); | ||
69 | + unixTime->tv_sec = sec32; | ||
70 | + unixTime->tv_nsec = nsec * 100; | ||
71 | + } else { | ||
72 | + Div643264(ntTime - UNIX_EPOCH, 10000000, &sec64, &nsec); | ||
73 | + unixTime->tv_sec = sec64; | ||
74 | + unixTime->tv_nsec = nsec * 100; | ||
75 | + } | ||
76 | #else | ||
77 | unixTime->tv_sec = (ntTime - UNIX_EPOCH) / 10000000; | ||
78 | unixTime->tv_nsec = ((ntTime - UNIX_EPOCH) % 10000000) * 100; | ||
diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0002-hgfsServerLinux-Consider-64bit-time_t-possibility.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0002-hgfsServerLinux-Consider-64bit-time_t-possibility.patch new file mode 100644 index 0000000000..0f64eabc94 --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0002-hgfsServerLinux-Consider-64bit-time_t-possibility.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From fe56b67a2915a8632ea30604c14241f335dd3c15 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 12 Nov 2019 10:49:46 -0800 | ||
4 | Subject: [PATCH] hgfsServerLinux: Consider 64bit time_t possibility | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | --- | ||
9 | .../lib/hgfsServer/hgfsServerLinux.c | 19 +++++-------------- | ||
10 | 1 file changed, 5 insertions(+), 14 deletions(-) | ||
11 | |||
12 | diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | ||
13 | index 03175623..554da67f 100644 | ||
14 | --- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | ||
15 | +++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | ||
16 | @@ -2561,20 +2561,11 @@ HgfsStatToFileAttr(struct stat *stats, // IN: stat information | ||
17 | LOG(4, ("%s: done, permissions %o%o%o%o, size %"FMT64"u\n", __FUNCTION__, | ||
18 | attr->specialPerms, attr->ownerPerms, attr->groupPerms, | ||
19 | attr->otherPerms, attr->size)); | ||
20 | -#ifdef __FreeBSD__ | ||
21 | -# if !defined(VM_X86_64) && __FreeBSD_version >= 500043 | ||
22 | -# define FMTTIMET "" | ||
23 | -# else | ||
24 | -# define FMTTIMET "l" | ||
25 | -# endif | ||
26 | -#else | ||
27 | -# define FMTTIMET "l" | ||
28 | -#endif | ||
29 | - LOG(4, ("access: %"FMTTIMET"d/%"FMT64"u \nwrite: %"FMTTIMET"d/%"FMT64"u \n" | ||
30 | - "attr: %"FMTTIMET"d/%"FMT64"u\n", | ||
31 | - stats->st_atime, attr->accessTime, stats->st_mtime, attr->writeTime, | ||
32 | - stats->st_ctime, attr->attrChangeTime)); | ||
33 | -#undef FMTTIMET | ||
34 | + LOG(4, ("access: %jd/%"FMT64"u \nwrite: %jd/%"FMT64"u \n" | ||
35 | + "attr: %jd/%"FMT64"u\n", | ||
36 | + (intmax_t)stats->st_atime, attr->accessTime, | ||
37 | + (intmax_t)stats->st_mtime, attr->writeTime, | ||
38 | + (intmax_t)stats->st_ctime, attr->attrChangeTime)); | ||
39 | |||
40 | attr->userId = stats->st_uid; | ||
41 | attr->groupId = stats->st_gid; | ||
diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb b/meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb index e43a39b613..9e4aa4881a 100644 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb | |||
@@ -39,7 +39,10 @@ SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https \ | |||
39 | file://0012-Use-off64_t-instead-of-__off64_t.patch;patchdir=.. \ | 39 | file://0012-Use-off64_t-instead-of-__off64_t.patch;patchdir=.. \ |
40 | file://0013-misc-Do-not-print-NULL-string-into-logs.patch;patchdir=.. \ | 40 | file://0013-misc-Do-not-print-NULL-string-into-logs.patch;patchdir=.. \ |
41 | file://0001-GitHub-Issue-367.-Remove-references-to-deprecated-G_.patch;patchdir=.. \ | 41 | file://0001-GitHub-Issue-367.-Remove-references-to-deprecated-G_.patch;patchdir=.. \ |
42 | file://0001-Make-HgfsConvertFromNtTimeNsec-aware-of-64-bit-time_.patch;patchdir=.. \ | ||
43 | file://0002-hgfsServerLinux-Consider-64bit-time_t-possibility.patch;patchdir=.. \ | ||
42 | " | 44 | " |
45 | |||
43 | SRCREV = "d3edfd142a81096f9f58aff17d84219b457f4987" | 46 | SRCREV = "d3edfd142a81096f9f58aff17d84219b457f4987" |
44 | 47 | ||
45 | S = "${WORKDIR}/git/open-vm-tools" | 48 | S = "${WORKDIR}/git/open-vm-tools" |
@@ -56,7 +59,7 @@ SYSTEMD_SERVICE_${PN} = "vmtoolsd.service" | |||
56 | EXTRA_OECONF = "--without-icu --disable-multimon --disable-docs \ | 59 | EXTRA_OECONF = "--without-icu --disable-multimon --disable-docs \ |
57 | --disable-tests --without-gtkmm --without-xerces --without-pam \ | 60 | --disable-tests --without-gtkmm --without-xerces --without-pam \ |
58 | --disable-vgauth --disable-deploypkg \ | 61 | --disable-vgauth --disable-deploypkg \ |
59 | --without-root-privileges --without-kernel-modules" | 62 | --without-root-privileges --without-kernel-modules --with-tirpc" |
60 | 63 | ||
61 | NO_X11_FLAGS = "--without-x --without-gtk2 --without-gtk3" | 64 | NO_X11_FLAGS = "--without-x --without-gtk2 --without-gtk3" |
62 | X11_DEPENDS = "libxext libxi libxrender libxrandr libxtst gtk+ gdk-pixbuf" | 65 | X11_DEPENDS = "libxext libxi libxrender libxrandr libxtst gtk+ gdk-pixbuf" |