summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Marc Lenoir2019-09-22 19:46:16 +0200
committerJean-Marc Lenoir2019-09-22 20:16:46 +0200
commit175f90388d71bb2e09d3a331b9500a78a2fc45e6 (patch)
treee3400487628b48103ea498b4b452f805afaf00af
parent6875857c014ede536d55a78cc353495e989e1c0d (diff)
downloadaur-175f90388d71bb2e09d3a331b9500a78a2fc45e6.tar.gz
Sync with vmware-workstation 15.5.0
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD67
-rw-r--r--config34
-rw-r--r--unlocker.py21
-rw-r--r--vmmon.patch216
-rw-r--r--vmnet.patch50
-rw-r--r--vmware-bootstrap (renamed from bootstrap)0
7 files changed, 170 insertions, 236 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8dc59e918d6..d026340fd93 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = vmware-workstation12
pkgdesc = The industry standard for running multiple operating systems as virtual machines on a single Linux PC.
pkgver = 12.5.9
- pkgrel = 9
+ pkgrel = 10
url = https://www.vmware.com/products/workstation-for-linux.html
install = vmware-workstation.install
arch = x86_64
@@ -9,7 +9,6 @@ pkgbase = vmware-workstation12
makedepends = sqlite
makedepends = python2
makedepends = unzip
- depends = vmware-keymaps
depends = dkms
depends = ncurses5-compat-libs
depends = fuse2
@@ -19,6 +18,7 @@ pkgbase = vmware-workstation12
depends = fontconfig
depends = freetype2
depends = zlib
+ depends = vmware-keymaps
optdepends = linux-headers: build modules against Arch kernel
provides = vmware-workstation=12.5.9
provides = vmware-ovftool
@@ -41,7 +41,7 @@ pkgbase = vmware-workstation12
backup = etc/pam.d/vmware-authd
backup = etc/conf.d/vmware
source = https://download3.vmware.com/software/wkst/file/VMware-Workstation-Full-12.5.9-7535481.x86_64.bundle
- source = bootstrap
+ source = vmware-bootstrap
source = vmware-vix-bootstrap
source = config
source = pam.d-vmware-authd
@@ -62,13 +62,13 @@ pkgbase = vmware-workstation12
source = Makefile
source = vmmon.patch
source = vmnet.patch
- source = https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/8.5.10/7527438/packages/com.vmware.fusion.tools.darwinPre15.zip.tar
- source = https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/8.5.10/7527438/packages/com.vmware.fusion.tools.darwin.zip.tar
+ source = darwinPre15-tools-8.5.10_7527438.zip.tar::https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/8.5.10/7527438/packages/com.vmware.fusion.tools.darwinPre15.zip.tar
+ source = darwin-tools-8.5.10_7527438.zip.tar::https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/8.5.10/7527438/packages/com.vmware.fusion.tools.darwin.zip.tar
source = unlocker.py
sha256sums = d099c048a33e58e05a5b247a2fc216e5178eb35097ed3e3836de52c6388121c3
sha256sums = 12e7b16abf8d7e858532edabb8868919c678063c566a6535855b194aac72d55e
sha256sums = da1698bf4e73ae466c1c7fc93891eba4b9c4581856649635e6532275dbfea141
- sha256sums = 04cf8f4f19f8aa2b298b0c4f4929488dfd05aad108d2f87b8587666da236cc64
+ sha256sums = 8e3a6302ed8798a6b14780be41dbc05dd4cfbda88c87b97df1c2bea960e15db7
sha256sums = d50aa0a3fe94025178965d988e18d41eb60aa1ce2b28ee6e3ca15edeabfa2ca7
sha256sums = 8e4d08668a66be79a900521792b39c16a026cc90659241edee80b64e701bfbcd
sha256sums = b94959a11b28e51b541321be0588190eb10825e9ff55cbd16eb01483a839a69f
@@ -85,11 +85,11 @@ pkgbase = vmware-workstation12
sha256sums = d7a9fbf39a0345ae2f14f7f389f30b1110f605d187e0c241e99bbb18993c250d
sha256sums = 05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487
sha256sums = 6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d
- sha256sums = 030c9147ee1c6ab18a5c526e954fd25faade4beb084e692f55251a916cfbb2ac
- sha256sums = fc2c3623b76da9c7a368509e66d9baef077eab8980537c0d40fd0a019c7ef833
+ sha256sums = 9329c1bcbad1782ba6701bebaa5ab7b9056d76c42a477c31475d68ddf95a77c2
+ sha256sums = bcf6c161bea6b51867118922b60606d9a2a9721c6ed7f85493574ba549361cfe
sha256sums = 78aaa6ba65d178d6242ad73b7e2e552ec707798ce5f4925a0adebf30f844dc17
sha256sums = 6327a76c2503f56d8bc67279f289ed4bb53e236d965ad78c0fcf7ee9e2bbb6c6
- sha256sums = 29e0b0db9c0296ab81eee543803c4bd430e2c69c76e33492910e17280da1c05c
+ sha256sums = ecf6d9186f109ec420287bd327e1f1f407de8e4b9e3faa23828bcf903f6246c6
pkgname = vmware-workstation12
diff --git a/PKGBUILD b/PKGBUILD
index 05072800d27..926fc739b8c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,17 +6,24 @@
#_enable_macOS_guests=y
-# CAUTION: Run macOS on a non Apple computer may be forbidden in your country.
+# CAUTION: Running macOS on VMware Workstation on non Apple computer is forbidden by
+# Apple and VMware EULAs.
# Source of the patch: https://github.com/DrDonk/unlocker
-# Forum: http://www.insanelymac.com/forum/topic/303311-workstation-1112-player-712-fusion-78-and-esxi-6-mac-os-x-unlocker-2
+# Forum: https://www.insanelymac.com/forum/topic/335757-macos-unlocker-v30-for-vmware-workstation/
############################################################################
+# vmware-keymaps dependency is needed to avoid some conflicts when you install
+# this package with vmware-horizon-client. If you don't plan to install
+# vmware-horizon-client and don't want to add this dependency, you can
+# uncomment the line below:
+#_remove_vmware_keymaps_dependency=y
+
#PKGEXT=.pkg.tar
pkgname=vmware-workstation12
pkgver=12.5.9
_buildver=7535481
_pkgver=${pkgver}_${_buildver}
-pkgrel=9
+pkgrel=10
pkgdesc='The industry standard for running multiple operating systems as virtual machines on a single Linux PC.'
arch=(x86_64)
url='https://www.vmware.com/products/workstation-for-linux.html'
@@ -34,7 +41,6 @@ provides=(
vmware-ovftool
)
depends=(
- vmware-keymaps
dkms
ncurses5-compat-libs
fuse2
@@ -68,7 +74,7 @@ backup=(
source=(
"https://download3.vmware.com/software/wkst/file/VMware-Workstation-Full-${_pkgver/_/-}.${CARCH}.bundle"
- 'bootstrap'
+ 'vmware-bootstrap'
'vmware-vix-bootstrap'
'config'
'pam.d-vmware-authd'
@@ -98,7 +104,7 @@ sha256sums=(
'12e7b16abf8d7e858532edabb8868919c678063c566a6535855b194aac72d55e'
'da1698bf4e73ae466c1c7fc93891eba4b9c4581856649635e6532275dbfea141'
- '04cf8f4f19f8aa2b298b0c4f4929488dfd05aad108d2f87b8587666da236cc64'
+ '8e3a6302ed8798a6b14780be41dbc05dd4cfbda88c87b97df1c2bea960e15db7'
'd50aa0a3fe94025178965d988e18d41eb60aa1ce2b28ee6e3ca15edeabfa2ca7'
'8e4d08668a66be79a900521792b39c16a026cc90659241edee80b64e701bfbcd'
'b94959a11b28e51b541321be0588190eb10825e9ff55cbd16eb01483a839a69f'
@@ -118,11 +124,16 @@ sha256sums=(
'05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487'
'6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d'
- '030c9147ee1c6ab18a5c526e954fd25faade4beb084e692f55251a916cfbb2ac'
- 'fc2c3623b76da9c7a368509e66d9baef077eab8980537c0d40fd0a019c7ef833'
+ '9329c1bcbad1782ba6701bebaa5ab7b9056d76c42a477c31475d68ddf95a77c2'
+ 'bcf6c161bea6b51867118922b60606d9a2a9721c6ed7f85493574ba549361cfe'
)
options=(!strip emptydirs)
+if [ -z "$_remove_vmware_keymaps_dependency" ]; then
+depends+=(
+ vmware-keymaps
+)
+fi
_isoimages=(freebsd linux linuxPreGlibc25 netware solaris windows winPre2k winPreVista)
@@ -137,14 +148,14 @@ makedepends+=(
)
source+=(
- "https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/${_vmware_fusion_ver/_//}/packages/com.vmware.fusion.tools.darwinPre15.zip.tar"
- "https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/${_vmware_fusion_ver/_//}/packages/com.vmware.fusion.tools.darwin.zip.tar"
+ "darwinPre15-tools-${_vmware_fusion_ver}.zip.tar::https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/${_vmware_fusion_ver/_//}/packages/com.vmware.fusion.tools.darwinPre15.zip.tar"
+ "darwin-tools-${_vmware_fusion_ver}.zip.tar::https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/${_vmware_fusion_ver/_//}/packages/com.vmware.fusion.tools.darwin.zip.tar"
'unlocker.py'
)
sha256sums+=(
'78aaa6ba65d178d6242ad73b7e2e552ec707798ce5f4925a0adebf30f844dc17'
'6327a76c2503f56d8bc67279f289ed4bb53e236d965ad78c0fcf7ee9e2bbb6c6'
- '29e0b0db9c0296ab81eee543803c4bd430e2c69c76e33492910e17280da1c05c'
+ 'ecf6d9186f109ec420287bd327e1f1f407de8e4b9e3faa23828bcf903f6246c6'
)
_fusion_isoimages=(darwin darwinPre15)
@@ -186,7 +197,9 @@ if [ -n "$_enable_macOS_guests" ]; then
for isoimage in ${_fusion_isoimages[@]}
do
unzip -q com.vmware.fusion.tools.$isoimage.zip
- rm manifest.plist
+ install -Dm 644 "$srcdir/payload/$isoimage.iso" "$srcdir/fusion-isoimages/$isoimage.iso"
+ install -Dm 644 "$srcdir/payload/$isoimage.iso.sig" "$srcdir/fusion-isoimages/$isoimage.iso.sig"
+ rm -rf payload manifest.plist
done
sed -i -e "s|/usr/lib/vmware/|${pkgdir}/usr/lib/vmware/|" "$srcdir/unlocker.py"
@@ -282,9 +295,11 @@ package() {
install -Dm 644 "vmware-player-app/doc/LearnMore.txt" "$pkgdir/usr/share/licenses/$pkgname/Privacy.txt"
install -Dm 644 "vmware-workstation/doc/EULA" "$pkgdir/usr/share/licenses/$pkgname/VMware Workstation - EULA.txt"
- install -Dm 644 "vmware-workstation/doc"/*open_source_licenses.txt "$pkgdir/usr/share/licenses/$pkgname"
- mv "$pkgdir/usr/lib/vmware-ovftool/vmware.eula" "$pkgdir/usr/share/licenses/$pkgname/VMware OVF Tool component for Linux - EULA.txt"
- rm "$pkgdir/usr/lib/vmware-ovftool"/{vmware-eula.rtf,open_source_licenses.txt,manifest.xml}
+ install -Dm 644 "$pkgdir/usr/lib/vmware-ovftool/vmware.eula" "$pkgdir/usr/share/licenses/$pkgname/VMware OVF Tool - EULA.txt"
+ install -Dm 644 "vmware-workstation/doc"/open_source_licenses.txt "$pkgdir/usr/share/licenses/$pkgname/VMware Workstation open source license.txt"
+ install -Dm 644 "vmware-workstation/doc"/ovftool_open_source_licenses.txt "$pkgdir/usr/share/licenses/$pkgname/VMware OVF Tool open source license.txt"
+ install -Dm 644 "vmware-vix-core"/open_source_licenses.txt "$pkgdir/usr/share/licenses/$pkgname/VMware VIX open source license.txt"
+ rm "$pkgdir/usr/lib/vmware-ovftool"/{vmware.eula,vmware-eula.rtf,open_source_licenses.txt,manifest.xml}
install -Dm 755 "$srcdir/configure-initscript.sh" "$pkgdir/usr/lib/vmware-installer/$vmware_installer_version/bin/configure-initscript.sh"
@@ -292,12 +307,15 @@ package() {
install -Dm 644 vmware-player-app/lib/isoimages/tools-key.pub "$pkgdir/usr/lib/vmware/isoimages/tools-key.pub"
- install -Dm 644 vmware-vmx/extra/modules.xml "$pkgdir/usr/lib/vmware/modules/modules.xml"
- install -Dm 644 vmware-installer/bootstrap "$pkgdir/etc/vmware-installer/bootstrap"
- install -Dm 644 "$srcdir/vmware-vix-bootstrap" "$pkgdir/etc/vmware-vix/bootstrap"
- install -Dm 644 "$srcdir"/{bootstrap,config} "$pkgdir/etc/vmware"
+ install -Dm 644 vmware-vmx/extra/modules.xml "$pkgdir"/usr/lib/vmware/modules/modules.xml
+ install -Dm 644 vmware-installer/bootstrap "$pkgdir"/etc/vmware-installer/bootstrap
+ install -Dm 644 "$srcdir"/vmware-vix-bootstrap "$pkgdir"/etc/vmware-vix/bootstrap
+ install -Dm 644 "$srcdir"/vmware-bootstrap "$pkgdir"/etc/vmware/bootstrap
+ install -Dm 644 "$srcdir"/config "$pkgdir"/etc/vmware/config
- rm -r "$pkgdir/usr/lib/vmware/xkeymap" # these files are now provided by vmware-keymaps package
+if [ -z "$_remove_vmware_keymaps_dependency" ]; then
+ rm -r "$pkgdir/usr/lib/vmware/xkeymap" # these files are provided by vmware-keymaps package
+fi
for hostd_file in config datastores environments proxy vmAutoStart; do
install -Dm 644 "$srcdir/$hostd_file.xml" "$pkgdir/etc/vmware/hostd/$hostd_file.xml"
@@ -429,8 +447,8 @@ if [ -n "$_enable_macOS_guests" ]; then
for isoimage in ${_fusion_isoimages[@]}
do
- install -Dm 644 "$srcdir/payload/$isoimage.iso" "$pkgdir/usr/lib/vmware/isoimages/$isoimage.iso"
- install -Dm 644 "$srcdir/payload/$isoimage.iso.sig" "$pkgdir/usr/lib/vmware/isoimages/$isoimage.iso.sig"
+ install -Dm 644 "$srcdir/fusion-isoimages/$isoimage.iso" "$pkgdir/usr/lib/vmware/isoimages/$isoimage.iso"
+ install -Dm 644 "$srcdir/fusion-isoimages/$isoimage.iso.sig" "$pkgdir/usr/lib/vmware/isoimages/$isoimage.iso.sig"
done
fi
@@ -444,6 +462,11 @@ fi
-i "$pkgdir/usr/bin/$program"
done
+ # Add StartupWMClass attribute to desktop files
+ sed -i '/^StartupNotify=.*/a StartupWMClass=vmware' "$pkgdir/usr/share/applications/vmware-workstation.desktop"
+ sed -i '/^StartupNotify=.*/a StartupWMClass=vmplayer' "$pkgdir/usr/share/applications/vmware-player.desktop"
+ sed -i '/^StartupNotify=.*/a StartupWMClass=vmware-netcfg' "$pkgdir/usr/share/applications/vmware-netcfg.desktop"
+
# use system font rendering
ln -sf /usr/lib/libfreetype.so.6 "$pkgdir/usr/lib/vmware/lib/libfreetype.so.6/"
ln -sf /usr/lib/libfontconfig.so.1 "$pkgdir/usr/lib/vmware/lib/libfontconfig.so.1/" # avoid a conflict with fontconfig when VMWARE_USE_SHIPPED_LIBS is defined
diff --git a/config b/config
index 4e94e4d1d83..e2758e5c212 100644
--- a/config
+++ b/config
@@ -1,26 +1,24 @@
.encoding = "UTF-8"
-VMCI_CONFED = "yes"
-NETWORKING = "yes"
+product.name = "VMware Workstation"
+product.version = "12.5.9"
+product.buildNumber = "7535481"
+workstation.product.version = "12.5.9"
+player.product.version = "12.5.9"
+vix.config.version = "1"
+bindir = "/usr/bin"
+libdir = "/usr/lib/vmware"
+vix.libdir = "/usr/lib/vmware-vix"
initscriptdir = "/usr/lib/systemd/scripts"
-VMBLOCK_CONFED = "yes"
+vmware.fullpath = "/usr/bin/vmware"
authd.fullpath = "/usr/bin/vmware-authd"
gksu.rootMethod = "su"
-VSOCK_CONFED = "yes"
-libdir = "/usr/lib/vmware"
-bindir = "/usr/bin"
-vmware.fullpath = "/usr/bin/vmware"
-vix.libdir = "/usr/lib/vmware-vix"
-installerDefaults.componentDownloadEnabled = "no"
-installerDefaults.autoSoftwareUpdateEnabled.epoch = "5224721827"
-vix.config.version = "1"
-player.product.version = "12.5.9"
-installerDefaults.dataCollectionEnabled.epoch = "8840488276"
+NETWORKING = "yes"
+VMBLOCK_CONFED = "no"
+VMCI_CONFED = "no"
+VSOCK_CONFED = "no"
+installerDefaults.autoSoftwareUpdateEnabled = "no"
installerDefaults.dataCollectionEnabled = "no"
+installerDefaults.componentDownloadEnabled = "no"
installerDefaults.transferVersion = "1"
-installerDefaults.autoSoftwareUpdateEnabled = "no"
-product.buildNumber = "7535481"
authd.client.port = "902"
authd.proxy.nfc = "vmware-hostd:ha-nfc"
-product.version = "12.5.9"
-workstation.product.version = "12.5.9"
-product.name = "VMware Workstation"
diff --git a/unlocker.py b/unlocker.py
index decbc51b76a..0f9d3f66eeb 100644
--- a/unlocker.py
+++ b/unlocker.py
@@ -44,6 +44,7 @@ Offset Length Struct Type Description
from __future__ import print_function
import codecs
import os
+import re
import struct
import sys
@@ -55,7 +56,10 @@ if sys.version_info < (2, 7):
if sys.platform == 'win32' \
or sys.platform == 'cli':
# noinspection PyUnresolvedReferences
- from _winreg import *
+ if sys.version_info > (3, 0):
+ from winreg import *
+ else:
+ from _winreg import *
def bytetohex(data):
@@ -301,9 +305,10 @@ def patchbase(name):
f = open(name, 'r+b')
# Entry to search for in GOS table
- # Should work for 12 & 14 of Workstation...
- darwin = b'\x10\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00' \
- '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+ # Should work for Workstation 12-15...
+ darwin = re.compile(
+ b'\x10\x00\x00\x00[\x10|\x20]\x00\x00\x00[\x01|\x02]\x00\x00\x00\x00\x00\x00\x00'
+ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
# Read file into string variable
base = f.read()
@@ -311,11 +316,8 @@ def patchbase(name):
# Loop through each entry and set top bit
# 0xBE --> 0xBF (WKS 12)
# 0x3E --> 0x3F (WKS 14)
- offset = 0
- while offset < len(base):
- offset = base.find(darwin, offset)
- if offset == -1:
- break
+ for m in darwin.finditer(base):
+ offset = m.start()
f.seek(offset + 32)
flag = ord(f.read(1))
flag = set_bit(flag, 0)
@@ -323,7 +325,6 @@ def patchbase(name):
f.seek(offset + 32)
f.write(flag)
print('GOS Patched flag @: ' + hex(offset))
- offset += 40
# Tidy up
f.flush()
diff --git a/vmmon.patch b/vmmon.patch
index 40fd37b85c3..16dc1755c71 100644
--- a/vmmon.patch
+++ b/vmmon.patch
@@ -12,6 +12,29 @@
# Header directory for the running kernel
ifdef LINUXINCLUDE
+@@ -100,6 +104,13 @@ auto-build: $(DRIVER_KO)
+ $(DRIVER): $(DRIVER_KO)
+ if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi
+
++# Use SUBDIRS on 2.x, 3.x, 4.x. Use M on newer kernels.
++ifeq ($(filter-out 2 3 4,$(firstword $(subst ., ,$(VM_UNAME)))),)
++DIRVAR := SUBDIRS
++else
++DIRVAR := M
++endif
++
+ # Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler
+ VM_CCVER := $(VMCCVER)
+ export VM_CCVER
+@@ -117,7 +128,7 @@ prebuild:: ;
+ postbuild:: ;
+
+ $(DRIVER_KO): prebuild
+- $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
++ $(MAKE) -C $(BUILD_DIR) $(DIRVAR)=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
+ MODULEBUILDDIR=$(MODULEBUILDDIR) modules
+ $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
+ MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
--- a/vmmon/linux/driver.c
+++ b/vmmon/linux/driver.c
@@ -80,6 +80,16 @@
@@ -31,6 +54,17 @@
/*
*----------------------------------------------------------------------
+@@ -104,7 +114,9 @@ long LinuxDriver_Ioctl(struct file *filp, u_int iocmd,
+
+ static int LinuxDriver_Close(struct inode *inode, struct file *filp);
+ static unsigned int LinuxDriverPoll(struct file *file, poll_table *wait);
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
++static vm_fault_t LinuxDriverFault(struct vm_fault *fault);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+ static int LinuxDriverFault(struct vm_fault *fault);
+ #elif defined(VMW_NOPAGE_2624)
+ static int LinuxDriverFault(struct vm_area_struct *vma, struct vm_fault *fault);
@@ -115,7 +115,7 @@
#endif
static int LinuxDriverMmap(struct file *filp, struct vm_area_struct *vma);
@@ -97,6 +131,20 @@
{
LinuxDriverWakeUp(FALSE);
}
+@@ -884,7 +904,12 @@ LinuxDriver_Close(struct inode *inode, // IN
+ */
+
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+-static int
++static
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
++vm_fault_t
++#else
++int
++#endif
+ LinuxDriverFault(struct vm_fault *fault) //IN/OUT
+ #elif defined(VMW_NOPAGE_2624)
+ static int LinuxDriverFault(struct vm_area_struct *vma, //IN
--- a/vmmon/linux/hostif.c
+++ b/vmmon/linux/hostif.c
@@ -1164,16 +1172,7 @@
@@ -291,65 +339,7 @@
mod_timer(&uptimeState.timer, jiffies + HZ);
}
-@@ -3572,7 +3625,12 @@
-
- ASSERT(handle);
-
-- if (!access_ok(VERIFY_WRITE, p, size)) {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
-+ if (!access_ok(VERIFY_WRITE, p, size))
-+#else
-+ if (!access_ok(p, size))
-+#endif
-+ {
- printk(KERN_ERR "%s: Couldn't verify write to uva 0x%p with size %"
- FMTSZ"u\n", __func__, p, size);
-
-From 8ba37a5023f939ba8d2e0d91b916ff442b1c18dd Mon Sep 17 00:00:00 2001
-From: Michal Kubecek <mkubecek@suse.cz>
-Date: Mon, 31 Dec 2018 00:05:42 +0100
-Subject: [PATCH] modules: replace SUBDIRS with M
-
-Since commit 0126be38d988 ("kbuild: announce removal of SUBDIRS if used")
-in v5.0-rc1, using SUBDIRS when building out of tree modules produces
-a deprecation warning. As M used to work since pretty much ever, use it
-unconditionally.
----
- vmmon-only/Makefile | 2 +-
- vmnet-only/Makefile | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/vmmon-only/Makefile b/vmmon-only/Makefile
-index ccdd295..b4b71fb 100644
---- a/vmmon-only/Makefile
-+++ b/vmmon-only/Makefile
-@@ -121,7 +121,7 @@ prebuild:: ;
- postbuild:: ;
-
- $(DRIVER_KO): prebuild
-- $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
-+ $(MAKE) -C $(BUILD_DIR) M=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
- MODULEBUILDDIR=$(MODULEBUILDDIR) modules
- $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
- MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
-From 41413a9b6e660a93600a438944d85b6f51eb680c Mon Sep 17 00:00:00 2001
-From: Michal Kubecek <mkubecek@suse.cz>
-Date: Tue, 5 Mar 2019 13:21:35 +0100
-Subject: [PATCH] vmmon: use KERNEL_DS rather than get_ds()
-
-Commit 736706bee329 ("get rid of legacy 'get_ds()' function") in v5.1-rc1
-removed get_ds() helper. As this helper always returned KERNEL_DS on x86_64
-since the architecture was introduced (and even on i386, it did so since
-v2.1.0), simply use KERNEL_DS regardless of kernel version.
----
- vmmon-only/linux/hostif.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c
-index ef88a22..8ca17de 100644
---- a/vmmon-only/linux/hostif.c
-+++ b/vmmon-only/linux/hostif.c
-@@ -2304,7 +2304,7 @@ isVAReadable(VA r) // IN:
+@@ -2251,7 +2304,7 @@ isVAReadable(VA r) // IN:
int ret;
old_fs = get_fs();
@@ -358,7 +348,7 @@ index ef88a22..8ca17de 100644
r = APICR_TO_ADDR(r, APICR_VERSION);
ret = HostIF_CopyFromUser(&dummy, (void*)r, sizeof(dummy));
set_fs(old_fs);
-@@ -2505,7 +2505,7 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN:
+@@ -2452,7 +2505,7 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN:
}
old_fs = get_fs();
@@ -367,7 +357,7 @@ index ef88a22..8ca17de 100644
{
struct poll_wqueues table;
-@@ -2634,7 +2634,7 @@ HostIF_SemaphoreSignal(uint64 *args) // IN:
+@@ -2581,7 +2634,7 @@ HostIF_SemaphoreSignal(uint64 *args) // IN:
}
old_fs = get_fs();
@@ -376,99 +366,25 @@ index ef88a22..8ca17de 100644
/*
* Always write sizeof(uint64) bytes. This works fine for eventfd and
-From 48812705d760a0dc760420ce495e34ce4d019b92 Mon Sep 17 00:00:00 2001
-From: Michal Kubecek <mkubecek@suse.cz>
-Date: Sat, 9 Mar 2019 11:11:29 +0100
-Subject: [PATCH] vmmon: fix return type of vm_operations_struct::fault handler
-
-Commit 3d3539018d2c ("mm: create the new vm_fault_t type") in mainline
-5.1-rc1 changed the definition of vm_fault_t type to unsigned to catch
-vm_operations_struct::fault handlers which still have int as return value.
-LinuxDriverFault() in vmmon module is one of those.
-
-As handler return type was changed by commit 1c8f422059ae ("mm: change
-return type to vm_fault_t") in 4.17-rc1, make LinuxDriverFault() always
-return vm_fault_t and define vm_fault_t as int when building against
-a pre-4.17 kernel. (Except for the branch for really old kernels where
-the handler was vm_operations_struct::nopage and returned a pointer to
-struct page.)
----
- vmmon-only/linux/driver.c | 13 ++++++++-----
- 1 file changed, 8 insertions(+), 5 deletions(-)
-
-diff --git a/vmmon-only/linux/driver.c b/vmmon-only/linux/driver.c
-index cdc7fc1..fd9fdac 100644
---- a/vmmon-only/linux/driver.c
-+++ b/vmmon-only/linux/driver.c
-@@ -90,6 +90,9 @@ static Bool LinuxDriverCheckPadding(void);
- tv->tv_usec = now.tv_nsec / 1000;
- }
- #endif
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)
-+typedef int vm_fault_t;
-+#endif
-
- /*
- *----------------------------------------------------------------------
-@@ -115,9 +118,9 @@ long LinuxDriver_Ioctl(struct file *filp, u_int iocmd,
- static int LinuxDriver_Close(struct inode *inode, struct file *filp);
- static unsigned int LinuxDriverPoll(struct file *file, poll_table *wait);
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
--static int LinuxDriverFault(struct vm_fault *fault);
-+static vm_fault_t LinuxDriverFault(struct vm_fault *fault);
- #elif defined(VMW_NOPAGE_2624)
--static int LinuxDriverFault(struct vm_area_struct *vma, struct vm_fault *fault);
-+static vm_fault_t LinuxDriverFault(struct vm_area_struct *vma, struct vm_fault *fault);
- #else
- static struct page *LinuxDriverNoPage(struct vm_area_struct *vma,
- unsigned long address,
-@@ -902,11 +905,11 @@ LinuxDriverPollTimeout(compat_timer_arg_t unused) // IN:
- */
-
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
--static int
-+static vm_fault_t
- LinuxDriverFault(struct vm_fault *fault) //IN/OUT
- #elif defined(VMW_NOPAGE_2624)
--static int LinuxDriverFault(struct vm_area_struct *vma, //IN
-- struct vm_fault *fault) //IN/OUT
-+static vm_fault_t LinuxDriverFault(struct vm_area_struct *vma, //IN
-+ struct vm_fault *fault) //IN/OUT
- #else
- static struct page *LinuxDriverNoPage(struct vm_area_struct *vma, //IN
- unsigned long address, //IN
-From d20641f619bd3766cf5b50b2c750700eab189bd9 Mon Sep 17 00:00:00 2001
-From: Michal Kubecek <mkubecek@suse.cz>
-Date: Tue, 9 Jul 2019 21:07:04 +0200
-Subject: [PATCH] vmmon: fix HostIF_SetFastClockRate() not to use force_sig()
-
-Commit 3cf5d076fb4d ("signal: Remove task parameter from force_sig") in
-v5.3-rc1 drops second argument of force_sig(); before that, all callers
-which passed something else than current task as second argument were
-fixed, mostly to use send_sig() instead.
-
-The situation in HostIF_SetFastClockRate() is the same as e.g. in bpfilter
-call fixed by commit 1dfd1711de29 ("signal/bpfilter: Fix bpfilter_kernl to
-use send_sig not force_sig"): locking in force_sig_info() cannot handle
-task exiting and using force_sig() for SIGKILL is pointless anyway as this
-signal cannot be blocked.
-
-As send_sig() is present with unchanged signature since the pre-git era, we
-can use send_sig() unconditionally, regardless of kernel version.
----
- vmmon-only/linux/hostif.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c
-index 210f281..4da863b 100644
---- a/vmmon-only/linux/hostif.c
-+++ b/vmmon-only/linux/hostif.c
-@@ -3577,7 +3577,7 @@ HostIF_SetFastClockRate(unsigned int rate) // IN: Frequency in Hz.
+@@ -3524,7 +3577,6 @@ HostIF_SetFastClockRate(unsigned int rate) // IN: Frequency in Hz.
}
} else {
if (linuxState.fastClockThread) {
- force_sig(SIGKILL, linuxState.fastClockThread);
-+ send_sig(SIGKILL, linuxState.fastClockThread, 1);
kthread_stop(linuxState.fastClockThread);
close_rtc(linuxState.fastClockFile, current->files);
+@@ -3572,7 +3625,12 @@
+
+ ASSERT(handle);
+
+- if (!access_ok(VERIFY_WRITE, p, size)) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
++ if (!access_ok(VERIFY_WRITE, p, size))
++#else
++ if (!access_ok(p, size))
++#endif
++ {
+ printk(KERN_ERR "%s: Couldn't verify write to uva 0x%p with size %"
+ FMTSZ"u\n", __func__, p, size);
+
diff --git a/vmnet.patch b/vmnet.patch
index 75b9d57c041..d0687d45bba 100644
--- a/vmnet.patch
+++ b/vmnet.patch
@@ -12,6 +12,29 @@
# Header directory for the running kernel
ifdef LINUXINCLUDE
+@@ -100,6 +104,13 @@ auto-build: $(DRIVER_KO)
+ $(DRIVER): $(DRIVER_KO)
+ if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi
+
++# Use SUBDIRS on 2.x, 3.x, 4.x. Use M on newer kernels.
++ifeq ($(filter-out 2 3 4,$(firstword $(subst ., ,$(VM_UNAME)))),)
++DIRVAR := SUBDIRS
++else
++DIRVAR := M
++endif
++
+ # Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler
+ VM_CCVER := $(VMCCVER)
+ export VM_CCVER
+@@ -117,7 +128,7 @@ prebuild:: ;
+ postbuild:: ;
+
+ $(DRIVER_KO): prebuild
+- $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
++ $(MAKE) -C $(BUILD_DIR) $(DIRVAR)=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
+ MODULEBUILDDIR=$(MODULEBUILDDIR) modules
+ $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
+ MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
--- a/vmnet/bridge.c
+++ b/vmnet/bridge.c
@@ -636,7 +636,7 @@
@@ -96,30 +119,3 @@
&recvClusterPage,
&recvClusterCount)) < 0) {
goto error_free;
-From 8ba37a5023f939ba8d2e0d91b916ff442b1c18dd Mon Sep 17 00:00:00 2001
-From: Michal Kubecek <mkubecek@suse.cz>
-Date: Mon, 31 Dec 2018 00:05:42 +0100
-Subject: [PATCH] modules: replace SUBDIRS with M
-
-Since commit 0126be38d988 ("kbuild: announce removal of SUBDIRS if used")
-in v5.0-rc1, using SUBDIRS when building out of tree modules produces
-a deprecation warning. As M used to work since pretty much ever, use it
-unconditionally.
----
- vmmon-only/Makefile | 2 +-
- vmnet-only/Makefile | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/vmnet-only/Makefile b/vmnet-only/Makefile
-index caab6b9..c2fc51f 100644
---- a/vmnet-only/Makefile
-+++ b/vmnet-only/Makefile
-@@ -121,7 +121,7 @@ prebuild:: ;
- postbuild:: ;
-
- $(DRIVER_KO): prebuild
-- $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
-+ $(MAKE) -C $(BUILD_DIR) M=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
- MODULEBUILDDIR=$(MODULEBUILDDIR) modules
- $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
- MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
diff --git a/bootstrap b/vmware-bootstrap
index 981b82191cc..981b82191cc 100644
--- a/bootstrap
+++ b/vmware-bootstrap