summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD68
-rw-r--r--config34
-rw-r--r--unlocker.py21
-rw-r--r--vmmon.patch210
-rw-r--r--vmnet.patch50
-rw-r--r--vmware-bootstrap (renamed from bootstrap)0
7 files changed, 174 insertions, 228 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0cbe9a53e178..24feba019070 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = vmware-workstation14
pkgdesc = The industry standard for running multiple operating systems as virtual machines on a single Linux PC.
pkgver = 14.1.7
- pkgrel = 2
+ pkgrel = 3
url = https://www.vmware.com/products/workstation-for-linux.html
install = vmware-workstation.install
arch = x86_64
@@ -9,15 +9,16 @@ pkgbase = vmware-workstation14
makedepends = sqlite
makedepends = python2
makedepends = unzip
- depends = vmware-keymaps
depends = dkms
depends = ncurses5-compat-libs
depends = fuse2
depends = gtk3
depends = gtkmm3
depends = libcanberra
+ depends = libaio
depends = pcsclite
depends = hicolor-icon-theme
+ depends = vmware-keymaps
optdepends = linux-headers: build modules against Arch kernel
provides = vmware-workstation=14.1.7
provides = vmware-ovftool
@@ -40,7 +41,7 @@ pkgbase = vmware-workstation14
backup = etc/pam.d/vmware-authd
backup = etc/conf.d/vmware
source = https://download3.vmware.com/software/wkst/file/VMware-Workstation-Full-14.1.7-12989993.x86_64.bundle
- source = bootstrap
+ source = vmware-bootstrap
source = vmware-vix-bootstrap
source = config
source = pam.d-vmware-authd
@@ -61,13 +62,13 @@ pkgbase = vmware-workstation14
source = Makefile
source = vmmon.patch
source = vmnet.patch
- source = https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/10.1.6/12989998/packages/com.vmware.fusion.tools.darwinPre15.zip.tar
- source = https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/10.1.6/12989998/packages/com.vmware.fusion.tools.darwin.zip.tar
+ source = darwinPre15-tools-10.1.6_12989998.zip.tar::https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/10.1.6/12989998/packages/com.vmware.fusion.tools.darwinPre15.zip.tar
+ source = darwin-tools-10.1.6_12989998.zip.tar::https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/10.1.6/12989998/packages/com.vmware.fusion.tools.darwin.zip.tar
source = unlocker.py
sha256sums = a9b5ff8adb885a064f582f700c2ad42aa6c2a3b1b8964f3f8cab35cc084c89c4
sha256sums = 12e7b16abf8d7e858532edabb8868919c678063c566a6535855b194aac72d55e
sha256sums = da1698bf4e73ae466c1c7fc93891eba4b9c4581856649635e6532275dbfea141
- sha256sums = d9a5f8b919d52aa2f279d8eaf0bb495780eb9fd8bbc2c58bba223cdca78cc991
+ sha256sums = dc52138eb01171207b761131f1ef8cbc33d838ff61644d70f5d1fa61f2469a8a
sha256sums = d50aa0a3fe94025178965d988e18d41eb60aa1ce2b28ee6e3ca15edeabfa2ca7
sha256sums = 8e4d08668a66be79a900521792b39c16a026cc90659241edee80b64e701bfbcd
sha256sums = de71ada1f5d5132fa75646a4f35cac2e50c54f250c315461633719c4b9cb3614
@@ -84,11 +85,11 @@ pkgbase = vmware-workstation14
sha256sums = d7a9fbf39a0345ae2f14f7f389f30b1110f605d187e0c241e99bbb18993c250d
sha256sums = 05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487
sha256sums = 6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d
- sha256sums = 42d2576a758d961662856c31db0eb9144f3465672e98325a8b6e23ea0f5a4a30
- sha256sums = fb63d2a1f8fb25ba76ddac740447849dce55f9a82041d8ad82448bfdc3adf3f4
+ sha256sums = 410cb17dead645dacb1d35c6fedf6ca8de5294117f929a69740a8df462c8a95c
+ sha256sums = 9503ab7064fe7b63f18dfbc061e6246e0af26f01812e39f6d778a169dd93dd13
sha256sums = 195313791f2c2cf880b0ba6c9d130e40ab6729335c0980fcc40df4209c1ed52b
sha256sums = e36fb99a56a65d2c4d82168c8adb1ed19a9a7aaf75807c667c79a79f4968740a
- sha256sums = 29e0b0db9c0296ab81eee543803c4bd430e2c69c76e33492910e17280da1c05c
+ sha256sums = ecf6d9186f109ec420287bd327e1f1f407de8e4b9e3faa23828bcf903f6246c6
pkgname = vmware-workstation14
diff --git a/PKGBUILD b/PKGBUILD
index 5bb515db260b..a9f25e60e558 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-workstation14
pkgver=14.1.7
_buildver=12989993
_pkgver=${pkgver}_${_buildver}
-pkgrel=2
+pkgrel=3
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,13 +41,13 @@ provides=(
vmware-ovftool
)
depends=(
- vmware-keymaps
dkms
ncurses5-compat-libs
fuse2
gtk3 # for gtk-query-settings binary
gtkmm3
libcanberra
+ libaio
pcsclite
hicolor-icon-theme
# needed to replace internal libs:
@@ -68,7 +75,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 +105,7 @@ sha256sums=(
'12e7b16abf8d7e858532edabb8868919c678063c566a6535855b194aac72d55e'
'da1698bf4e73ae466c1c7fc93891eba4b9c4581856649635e6532275dbfea141'
- 'd9a5f8b919d52aa2f279d8eaf0bb495780eb9fd8bbc2c58bba223cdca78cc991'
+ 'dc52138eb01171207b761131f1ef8cbc33d838ff61644d70f5d1fa61f2469a8a'
'd50aa0a3fe94025178965d988e18d41eb60aa1ce2b28ee6e3ca15edeabfa2ca7'
'8e4d08668a66be79a900521792b39c16a026cc90659241edee80b64e701bfbcd'
'de71ada1f5d5132fa75646a4f35cac2e50c54f250c315461633719c4b9cb3614'
@@ -118,11 +125,16 @@ sha256sums=(
'05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487'
'6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d'
- '42d2576a758d961662856c31db0eb9144f3465672e98325a8b6e23ea0f5a4a30'
- 'fb63d2a1f8fb25ba76ddac740447849dce55f9a82041d8ad82448bfdc3adf3f4'
+ '410cb17dead645dacb1d35c6fedf6ca8de5294117f929a69740a8df462c8a95c'
+ '9503ab7064fe7b63f18dfbc061e6246e0af26f01812e39f6d778a169dd93dd13'
)
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 +149,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+=(
'195313791f2c2cf880b0ba6c9d130e40ab6729335c0980fcc40df4209c1ed52b'
'e36fb99a56a65d2c4d82168c8adb1ed19a9a7aaf75807c667c79a79f4968740a'
- '29e0b0db9c0296ab81eee543803c4bd430e2c69c76e33492910e17280da1c05c'
+ 'ecf6d9186f109ec420287bd327e1f1f407de8e4b9e3faa23828bcf903f6246c6'
)
_fusion_isoimages=(darwin darwinPre15)
@@ -186,7 +198,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"
@@ -283,9 +297,11 @@ package() {
done
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"
@@ -293,12 +309,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"
@@ -427,8 +446,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
@@ -442,6 +461,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"
+
# to solve bugs with incompatibles library versions:
#ln -sf /usr/lib/libz.so.1 "$pkgdir/usr/lib/vmware/lib/libz.so.1/"
}
diff --git a/config b/config
index fce6aadfbde5..d592a069d033 100644
--- a/config
+++ b/config
@@ -1,26 +1,24 @@
.encoding = "UTF-8"
-VMCI_CONFED = "yes"
-NETWORKING = "yes"
+product.name = "VMware Workstation"
+product.version = "14.1.7"
+product.buildNumber = "12989993"
+workstation.product.version = "14.1.7"
+player.product.version = "14.1.7"
+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 = "4641104763"
-vix.config.version = "1"
-player.product.version = "14.0.0"
-installerDefaults.dataCollectionEnabled.epoch = "7910652514"
+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 = "6661328"
authd.client.port = "902"
authd.proxy.nfc = "vmware-hostd:ha-nfc"
-product.version = "14.0.0"
-workstation.product.version = "14.0.0"
-product.name = "VMware Workstation"
diff --git a/unlocker.py b/unlocker.py
index decbc51b76ac..0f9d3f66eeba 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 2f488d613f1f..e4cbb6f4b56e 100644
--- a/vmmon.patch
+++ b/vmmon.patch
@@ -12,6 +12,56 @@
# Header directory for the running kernel
ifdef LINUXINCLUDE
+@@ -98,6 +98,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
++
+ #
+ # Define a setup target that gets built before the actual driver.
+ # This target may not be used at all, but if it is then it will be defined
+@@ -107,7 +114,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
+@@ -96,7 +95,9 @@ long LinuxDriver_Ioctl(struct file *filp, u_int iocmd,
+ unsigned long ioarg);
+
+ static int LinuxDriver_Close(struct inode *inode, struct file *filp);
+-#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);
+ #else
+ static int LinuxDriverFault(struct vm_area_struct *vma, struct vm_fault *fault);
+@@ -594,7 +596,12 @@ LinuxDriver_Close(struct inode *inode, // IN
+ *-----------------------------------------------------------------------------
+ */
+
+-static int
++static
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
++vm_fault_t
++#else
++int
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+ LinuxDriverFault(struct vm_fault *fault) //IN/OUT
+ #else
--- a/vmmon/linux/hostif.c
+++ a/vmmon/linux/hostif.c
@@ -1499,9 +1499,13 @@
@@ -118,65 +168,7 @@
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) && !defined(timer_setup)
init_timer(&uptimeState.timer);
-@@ -3200,7 +3243,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
-@@ -111,7 +111,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
-@@ -2207,7 +2207,7 @@ isVAReadable(VA r) // IN:
+@@ -2164,7 +2207,7 @@ isVAReadable(VA r) // IN:
int ret;
old_fs = get_fs();
@@ -185,7 +177,7 @@ index ef88a22..8ca17de 100644
r = APICR_TO_ADDR(r, APICR_VERSION);
ret = HostIF_CopyFromUser(&dummy, r, sizeof dummy);
set_fs(old_fs);
-@@ -2408,7 +2408,7 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN:
+@@ -2365,7 +2408,7 @@ HostIF_SemaphoreWait(VMDriver *vm, // IN:
}
old_fs = get_fs();
@@ -194,7 +186,7 @@ index ef88a22..8ca17de 100644
{
struct poll_wqueues table;
-@@ -2537,7 +2537,7 @@ HostIF_SemaphoreSignal(uint64 *args) // IN:
+@@ -2494,7 +2537,7 @@ HostIF_SemaphoreSignal(uint64 *args) // IN:
}
old_fs = get_fs();
@@ -203,91 +195,25 @@ index ef88a22..8ca17de 100644
/*
* Always write sizeof(uint64) bytes. This works fine for eventfd and
-From 2af9d566d0ccc78a93b46a79d23902e5ba2bc933 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.
----
- vmmon-only/linux/driver.c | 9 ++++++---
- 1 file changed, 6 insertions(+), 3 deletions(-)
-
-diff --git a/vmmon-only/linux/driver.c b/vmmon-only/linux/driver.c
-index 92a3529..248a95d 100644
---- a/vmmon-only/linux/driver.c
-+++ b/vmmon-only/linux/driver.c
-@@ -73,6 +73,9 @@ static Bool LinuxDriverCheckPadding(void);
-
- struct VMXLinuxState linuxState;
-
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)
-+typedef int vm_fault_t;
-+#endif
-
- /*
- *----------------------------------------------------------------------
-@@ -97,9 +100,9 @@ long LinuxDriver_Ioctl(struct file *filp, u_int iocmd,
-
- static int LinuxDriver_Close(struct inode *inode, struct file *filp);
- #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);
- #else
--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);
- #endif
- static int LinuxDriverMmap(struct file *filp, struct vm_area_struct *vma);
-
-@@ -594,7 +597,7 @@ LinuxDriver_Close(struct inode *inode, // IN
- *-----------------------------------------------------------------------------
- */
-
--static int
-+static vm_fault_t
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
- LinuxDriverFault(struct vm_fault *fault) //IN/OUT
- #else
-From 98008ff6adec118962df8ac26f814b55c3861efb 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 850ca02..27eb60c 100644
---- a/vmmon-only/linux/hostif.c
-+++ b/vmmon-only/linux/hostif.c
-@@ -3197,7 +3197,7 @@ HostIF_SetFastClockRate(unsigned int rate) // IN: Frequency in Hz.
+@@ -3154,7 +3202,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);
linuxState.fastClockThread = NULL;
+@@ -3200,7 +3243,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 f73136ea38b6..115c79844102 100644
--- a/vmnet.patch
+++ b/vmnet.patch
@@ -12,6 +12,29 @@
# Header directory for the running kernel
ifdef LINUXINCLUDE
+@@ -98,6 +98,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
++
+ #
+ # Define a setup target that gets built before the actual driver.
+ # This target may not be used at all, but if it is then it will be defined
+@@ -107,7 +114,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/userif.c
+++ b/vmnet/userif.c
@@ -137,16 +137,21 @@
@@ -67,30 +90,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
-@@ -111,7 +111,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 981b82191cca..981b82191cca 100644
--- a/bootstrap
+++ b/vmware-bootstrap