summaryrefslogtreecommitdiffstats
path: root/core/modules/vmware15
diff options
context:
space:
mode:
authorSimon Rettberg2019-05-29 15:59:15 +0200
committerroot2019-05-29 15:59:15 +0200
commitc8bd0bfc1167a49853da902f13edbab48a133b33 (patch)
treeee3dcca9ff2f0ed0cb71eb024aaf5b29e9039df9 /core/modules/vmware15
parent[lightdm-greeter-bwlp] Download login-news on startup (diff)
downloadmltk-c8bd0bfc1167a49853da902f13edbab48a133b33.tar.gz
mltk-c8bd0bfc1167a49853da902f13edbab48a133b33.tar.xz
mltk-c8bd0bfc1167a49853da902f13edbab48a133b33.zip
[vmware15] Update vom 14 to 15
Diffstat (limited to 'core/modules/vmware15')
-rwxr-xr-xcore/modules/vmware15/data/opt/openslx/bin/vmplayer16
l---------core/modules/vmware15/data/opt/openslx/bin/vmware1
l---------core/modules/vmware15/data/usr/bin/vmplayer1
l---------core/modules/vmware15/data/usr/bin/vmware1
-rw-r--r--core/modules/vmware15/module.build181
-rw-r--r--core/modules/vmware15/module.conf68
-rw-r--r--core/modules/vmware15/patches/vmblock__3.0-3.9__1.0-100.0.patch11
-rw-r--r--core/modules/vmware15/patches/vmblock__3.10__1.0-100.0.patch34
-rw-r--r--core/modules/vmware15/patches/vmblock__3.11-9.9__1.0-11.0.patch123
-rw-r--r--core/modules/vmware15/patches/vmci__4.3-4.3__12.0.0.patch26
-rw-r--r--core/modules/vmware15/patches/vmmon__4.14-4.14.99__12.0-14.0.patch61
-rw-r--r--core/modules/vmware15/patches/vmmon__4.14__14.0.patch61
-rw-r--r--core/modules/vmware15/patches/vmmon__4.3-4.3__12.0.0.patch13
-rw-r--r--core/modules/vmware15/patches/vmmon__4.9-4.9.99__12.0.0-12.5.2.patch13
-rw-r--r--core/modules/vmware15/patches/vmnet__3.13-3.13__1.0-10.0.2.patch27
-rw-r--r--core/modules/vmware15/patches/vmnet__4.9-4.9.99__12.0.0-12.5.2.patch13
16 files changed, 650 insertions, 0 deletions
diff --git a/core/modules/vmware15/data/opt/openslx/bin/vmplayer b/core/modules/vmware15/data/opt/openslx/bin/vmplayer
new file mode 100755
index 00000000..05a4ec3a
--- /dev/null
+++ b/core/modules/vmware15/data/opt/openslx/bin/vmplayer
@@ -0,0 +1,16 @@
+#!/bin/ash
+# radically simplified version of the original script vmplayer by VMware Inc.
+PREFIX=/usr/lib/vmware # depends on the vmware location
+
+# HACK: Let the OpenGL driver report s3tc capability even if not present, so 3D will be enabled
+export force_s3tc_enable=true
+
+# Turn off "helpful" DE features
+export APPMENU_DISPLAY_BOTH=1
+export UBUNTU_MENUPROXY=0
+export GNOME_DISABLE_CRASH_DIALOG=1
+
+PROG=$(basename $0)
+
+exec "$PREFIX/bin/$PROG" "$@"
+
diff --git a/core/modules/vmware15/data/opt/openslx/bin/vmware b/core/modules/vmware15/data/opt/openslx/bin/vmware
new file mode 120000
index 00000000..aa0b74b1
--- /dev/null
+++ b/core/modules/vmware15/data/opt/openslx/bin/vmware
@@ -0,0 +1 @@
+vmplayer \ No newline at end of file
diff --git a/core/modules/vmware15/data/usr/bin/vmplayer b/core/modules/vmware15/data/usr/bin/vmplayer
new file mode 120000
index 00000000..2944838d
--- /dev/null
+++ b/core/modules/vmware15/data/usr/bin/vmplayer
@@ -0,0 +1 @@
+/opt/openslx/bin/vmplayer \ No newline at end of file
diff --git a/core/modules/vmware15/data/usr/bin/vmware b/core/modules/vmware15/data/usr/bin/vmware
new file mode 120000
index 00000000..bde6f9c0
--- /dev/null
+++ b/core/modules/vmware15/data/usr/bin/vmware
@@ -0,0 +1 @@
+/opt/openslx/bin/vmware \ No newline at end of file
diff --git a/core/modules/vmware15/module.build b/core/modules/vmware15/module.build
new file mode 100644
index 00000000..cfb6fb39
--- /dev/null
+++ b/core/modules/vmware15/module.build
@@ -0,0 +1,181 @@
+#!/bin/bash
+fetch_source() {
+ [ -d "${MODULE_WORK_DIR}/src" ] && \
+ { rm -r "${MODULE_WORK_DIR}/src" || perror "Could not delete old src dir."; }
+ mkdir -p "${MODULE_WORK_DIR}/src" || perror "Could not mkdir src"
+ cd "${MODULE_WORK_DIR}/src" || perror "cd to '${MODULE_WORK_DIR}/src' failed."
+
+ local BASE_URL LIST_URL BUILD_NO
+ #BASE_URL="http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.5.2/4638234/linux/core/"
+ BASE_URL="http://softwareupdate.vmware.com/cds/vmw-desktop/"
+ if [ "$REQUIRED_TYPE" = "workstation" ]; then
+ BASE_URL+="ws/"
+ else
+ BASE_URL+="${REQUIRED_TYPE}/"
+ fi
+ BASE_URL+="${REQUIRED_VERSION}/"
+ # Get directory listing of version to get build number
+ wget -O "index.html" "$BASE_URL" || perror "Could not download vmware version index from $BASE_URL"
+ BUILD_NO=$(grep -E -o -i -m 1 'href="[0-9]+/"' "index.html" | awk -F '"' '{print $2}')
+ [ -z "$BUILD_NO" ] && perror "Could not determine build number of $REQUIRED_VERSION from $MODULE_WORK_DIR/src/index.html"
+ LIST_URL="${BASE_URL}${BUILD_NO}linux/core/" # BUILD_NO already has trailing slash...
+
+ # Get directory listing of where final archive resides
+ wget -O "index.html" "$LIST_URL" || perror "Could not download vmware build type core dir index"
+ VMWARE_BUNDLE_FILE=$(grep -E -o -i -m 1 "href=\"VMware-$REQUIRED_TYPE-[^\"]+[\._\-]$ARCHREGEX[\._\-][^\"]+\"" "index.html" | awk -F '"' '{printf $2}')
+ [ -z "$VMWARE_BUNDLE_FILE" ] && perror "Could not determine vmware $REQUIRED_TYPE bundle file for current arch from $MODULE_WORK_DIR/src/index.html"
+
+ # Download file
+ wget -O "$VMWARE_BUNDLE_FILE" "${LIST_URL}${VMWARE_BUNDLE_FILE}" || perror "Could not download ${VMWARE_BUNDLE_FILE} from ${LIST_URL}"
+ if [[ "$VMWARE_BUNDLE_FILE" == *.tar ]]; then
+ tar -x "${VMWARE_BUNDLE_FILE%.tar}" -f "$VMWARE_BUNDLE_FILE" || perror "Could not untar downloaded $VMWARE_BUNDLE_FILE"
+ unlink "$VMWARE_BUNDLE_FILE"
+ VMWARE_BUNDLE_FILE="${VMWARE_BUNDLE_FILE%.tar}"
+ fi
+
+ cd - >/dev/null
+}
+
+build() {
+ local KMOD SHORT PATCH MIN_KERN MAX_KERN
+ [ -z "$VMWARE_BUNDLE_FILE" ] && VMWARE_BUNDLE_FILE=$(basename "$(find "${MODULE_WORK_DIR}/src" -iname "vmware-*" | head -n 1)")
+ local DELETE_FILES=$(for LINE in $REQUIRED_VMWARE_DELETIONS;do echo "rm -rf -- $LINE"; done)
+
+ local OFFICIAL_VERSION=$(echo "$VMWARE_BUNDLE_FILE" | cut -f 3 -d '-')
+ local BUILD_VERSION=$(echo "$VMWARE_BUNDLE_FILE" | cut -f 4 -d '-')
+ BUILD_VERSION=${BUILD_VERSION%%.*}
+ [ -z "$OFFICIAL_VERSION" ] && perror "Could not determine vmware version from downloaded file (expected eg. 12.0.0)"
+ if [ -z "$BUILD_VERSION" ] || [ "$BUILD_VERSION" -lt 10000 ]; then
+ perror "Could not determine vmware build number from downloaded file"
+ fi
+
+ # prepare the build directory with the files needed during the chroot
+ cp "${MODULE_WORK_DIR}/src/$VMWARE_BUNDLE_FILE" "${MODULE_BUILD_DIR}/$VMWARE_BUNDLE_FILE"
+ # copy required patches
+ mkdir -p "${MODULE_BUILD_DIR}/patches"
+ for PATCH in $(find "${MODULE_DIR}/patches/" -name "*__*__*.patch"); do
+ parse_patch_name "$PATCH"
+ [ -z "${MIN_KERN}" -o -z "${MAX_KERN}" ] && perror "Could not parse patch filename"
+ if version_lt "$TARGET_KERNEL_SHORT" "$MIN_KERN" || version_gt "$TARGET_KERNEL_SHORT" "$MAX_KERN"; then
+ pinfo "*NOT* applying $PATCH (min=$MIN_KERN max=$MAX_KERN cmp=$TARGET_KERNEL_SHORT)"
+ continue # Not suitable for our kernel
+ fi
+ if version_lt "$OFFICIAL_VERSION" "$MIN_VMWARE" || version_gt "$OFFICIAL_VERSION" "$MAX_VMWARE"; then
+ pinfo "*NOT* applying $PATCH (min=$MIN_VMWARE max=$MAX_VMWARE cmp=$OFFICIAL_VERSION)"
+ continue # Not suitable for our kernel
+ fi
+ pinfo "Kernel: Applying $PATCH (min=$MIN_KERN max=$MAX_KERN cmp=$TARGET_KERNEL_SHORT)"
+ pinfo "VMware: Applying $PATCH (min=$MIN_VMWARE max=$MAX_VMWARE cmp=$OFFICIAL_VERSION)"
+ cp "$PATCH" "${MODULE_BUILD_DIR}/patches/" || perror "Could not copy patch $PATCH to $MODULE_BUILD_DIR/patches"
+ done
+
+ # sanity check to see if KERNEL_HEADERS_DIR is set and exists
+ [ -z "${KERNEL_HEADERS_DIR}" -o ! -e "${KERNEL_HEADERS_DIR}" ] && perror "KERNEL_HEADERS_DIR ('"${KERNEL_HEADERS_DIR}"') not found. Was the kernel module built?"
+
+ # build in two steps, to be able to use mltk function while patching modules
+ pinfo "Installing vmware per chroot..."
+ chroot_run "${MODULE_BUILD_DIR}" <<-EOF
+ perror() {
+ echo "[ERROR ERROR] " "\$@" >&6
+ exit 1
+ }
+ # PS1='\[\e[1;33m\](chroot) \u@\h:\w\$ \[\e[1;32m\]' /bin/bash -norc # un-comment for debugging within chroot
+ $DELETE_FILES
+ yes | sh /"${VMWARE_BUNDLE_FILE}" --eulas-agreed --console --required
+ set -x
+ # Patch kernel modules
+ # check if we need to patch modules
+ cd "/usr/lib/vmware/modules/source" \
+ || perror "Could not cd to '/usr/lib/vmware/modules/source'"
+ for file in /patches/*.patch; do
+ [ -s "\$file" ] || continue
+ echo "Applying patch $file"
+ SHORT="\$(basename "\${file%%__*}")"
+ KMOD="\${SHORT}.tar"
+ [ -s "\$KMOD" ] || perror "Kmod \$KMOD does not exist"
+ [ ! -d "\${SHORT}-only" ] && tar xf "\$KMOD"
+ [ ! -d "\${SHORT}-only" ] && perror "untar of \$KMOD failed."
+ cd "\${SHORT}-only" || perror "Where is \${SHORT}-only?"
+ if ! patch -p1 < "\$file"; then
+ cd ..
+ rm -rf -- "\${SHORT}-only"
+ perror "Applying \$file failed."
+ fi
+ cd ..
+ if [ -d "\${SHORT}-only" ]; then
+ tar cf "\$KMOD" "\${SHORT}-only/" || perror "repacking of \$KMOD failed."
+ rm -rf -- "\${SHORT}-only"
+ fi
+ done
+ vmware-modconfig --console --build-mod -k "${TARGET_KERNEL_LONG}" vmnet $(which gcc) "${KERNEL_HEADERS_DIR}/include" vmplayer vmnet || perror "vmnet build failed"
+ vmware-modconfig --console --build-mod -k "${TARGET_KERNEL_LONG}" vmmon $(which gcc) "${KERNEL_HEADERS_DIR}/include" vmplayer vmmon || perror "vmmon build failed"
+ EOF
+
+ cd "${MODULE_WORK_DIR}" || perror "Could not cd to '${MODULE_WORK_DIR}'"
+
+ # cleanup unneeded files
+ rm -rf -- "${MODULE_BUILD_DIR}/etc/vmware-installer"
+ rm -rf -- "${MODULE_BUILD_DIR}/usr/lib/vmware-installer"
+ rm -rf -- "${MODULE_BUILD_DIR}/usr/lib/vmware-ovftool"
+ unlink "${MODULE_BUILD_DIR}/$VMWARE_BUNDLE_FILE"
+
+ # write vmware.conf config file to be later sourced by vmware/run-virt.include.
+ mkdir -p "${MODULE_BUILD_DIR}/opt/openslx/vmchooser/plugins/vmware/" || perror "Could not mkdir "${MODULE_BUILD_DIR}/opt/openslx/vmchooser/plugins/vmware/"."
+
+ cat > "${MODULE_BUILD_DIR}/opt/openslx/vmchooser/plugins/vmware/vmware.conf" <<-EOF
+ # configuration file written by vmware/module.build
+ vmnet0=true
+ vmnet1=192.168.101.1/24
+ vmnet1nat=true
+ vmnet8=192.168.102.1/24
+ vmware_version=$OFFICIAL_VERSION
+ vmware_build=${BUILD_VERSION}
+ maxhardwareversion=${OFFICIAL_VERSION%%.*}
+ EOF
+
+ # Patch system-wide vmware config
+ sed -i '/^installerDefaults.autoSoftwareUpdateEnabled/d;/^installerDefaults.componentDownloadEnabled/d;/^installerDefaults.dataCollectionEnabled/d' "${MODULE_BUILD_DIR}/etc/vmware/config"
+ cat >> "${MODULE_BUILD_DIR}/etc/vmware/config" <<-HEREDOC
+ installerDefaults.autoSoftwareUpdateEnabled = "no"
+ installerDefaults.componentDownloadEnabled = "no"
+ installerDefaults.dataCollectionEnabled = "no"
+ HEREDOC
+}
+
+post_copy() {
+ # FIXME: gconftool is copied without dependencies
+ tarcopy "$(find /usr/lib/ /usr/lib64 -name gconv -type d)" "$TARGET_BUILD_DIR"
+
+ # Update Icon cache for vmplayer
+ gtk-update-icon-cache-3.0 "${TARGET_BUILD_DIR}/usr/share/icons/hicolor/" || pwarning "update-icon-cache-3.0 failed."
+
+ # fix vmware-usbarbitrator bug
+ date +'%Y.%m.%d' >"${TARGET_BUILD_DIR}/etc/arch-release"
+
+ mkdir -p "$TARGET_BUILD_DIR/lib/modules/vmware/"
+ cp "${MODULE_BUILD_DIR}/lib/modules/$TARGET_KERNEL_LONG/vmplayer/"* "$TARGET_BUILD_DIR/lib/modules/vmware/" || perror "Could not cp vmware modules to target!"
+
+}
+
+parse_patch_name() {
+ [ $# -ne 1 ] && perror "parse_patch_name: Wrong parameter count."
+ local PATCH="$1"
+ # Module
+ SHORT=$(echo "$PATCH" | sed -r 's/^([^_]+)__.*$/\1/g')
+ KMOD="${SHORT}.tar"
+ # Kernel restriction
+ MIN_KERN=$(echo "$PATCH" | sed -r 's/^[^_]+__([0-9\.]+)-[0-9\.]+__[^_]+\.patch$/\1/g')
+ [[ "$MIN_KERN" == /* ]] && MIN_KERN=$(echo "$PATCH" | sed -r 's/^[^_]+__([0-9\.]+)__[^_]+\.patch$/\1/g')
+ MAX_KERN=$(echo "$PATCH" | sed -r 's/^[^_]+__[0-9\.]+-([0-9\.]+)__[^_]+\.patch$/\1/g')
+ [[ "$MAX_KERN" == /* ]] && MAX_KERN=$(echo "$PATCH" | sed -r 's/^[^_]+__([0-9\.]+)__[^_]+\.patch$/\1/g')
+ [[ "$MIN_KERN" == /* ]] && MIN_KERN=
+ [[ "$MAX_KERN" == /* ]] && MAX_KERN=
+ # vmware restriction
+ MIN_VMWARE=$(echo "$PATCH" | sed -r 's/^[^_]+__[^_]+__([0-9\.]+)-[^_]+\.patch$/\1/g')
+ [[ "$MIN_VMWARE" == /* ]] && MIN_VMWARE=$(echo "$PATCH" | sed -r 's/^[^_]+__[^_]+__([0-9\.]+)\.patch$/\1/g')
+ MAX_VMWARE=$(echo "$PATCH" | sed -r 's/^[^_]+__[^_]+__[^_]+-([0-9\.]+)\.patch$/\1/g')
+ [[ "$MAX_VMWARE" == /* ]] && MAX_VMWARE=$(echo "$PATCH" | sed -r 's/^[^_]+__[^_]+__([0-9\.]+)\.patch$/\1/g')
+ [[ "$MIN_VMWARE" == /* ]] && MIN_VMWARE=
+ [[ "$MAX_VMWARE" == /* ]] && MAX_VMWARE=
+}
+
diff --git a/core/modules/vmware15/module.conf b/core/modules/vmware15/module.conf
new file mode 100644
index 00000000..e41850b1
--- /dev/null
+++ b/core/modules/vmware15/module.conf
@@ -0,0 +1,68 @@
+#!/bin/bash
+REQUIRED_VERSION="15.1.0"
+REQUIRED_TYPE="workstation"
+REQUIRED_MODULES="kernel vmware-common"
+REQUIRED_DIRECTORIES="
+ /etc/vmware
+ /usr/sbin
+ /usr/lib/vmware/bin
+ /usr/lib/vmware/hostd
+ /usr/lib/vmware/icu
+ /usr/lib/vmware/lib
+ /usr/lib/vmware/libconf
+ /usr/lib/vmware/licenses
+ /usr/lib/vmware/resources
+ /usr/lib/vmware/roms
+ /usr/lib/vmware/scripts
+ /usr/lib/vmware/share
+ /usr/lib/vmware/xkeymap
+"
+REQUIRED_FILES="
+ /usr/lib/vmware/config
+ /usr/bin/vmware-usbarbitrator
+ /opt/openslx/vmchooser/plugins/vmware/vmware.conf
+"
+REQUIRED_BINARIES="
+ vmnet-netifup
+"
+
+REQUIRED_VMWARE_DELETIONS="
+ /etc/cups/thnuclnt.convs
+ /etc/cups/thnuclnt.types
+ /etc/init.d/vmamqpd
+ /etc/init.d/vmware*
+ /etc/modprobe.d/vmware-fuse.conf
+ /etc/pam.d/vmware-authd
+ /etc/rc?.d/???vmamqp*
+ /etc/rc?.d/???vmware*
+ /etc/thnuclnt
+ /etc/vmware*
+ /etc/xdg/menus/applications-merged
+ /lib/modules/*-generic/misc/vmmon.ko
+ /lib/modules/*-generic/misc/vmnet.ko
+ /usr/bin/ovftool
+ /usr/bin/vm-support
+ /usr/bin/vmnet-bridge
+ /usr/bin/vmnet-dhcpd
+ /usr/bin/vmnet-natd
+ /usr/bin/vmnet-netifup
+ /usr/bin/vmnet-sniffer
+ /usr/bin/vmplayer
+ /usr/bin/vmrun
+ /usr/bin/vmss2core
+ /usr/bin/vmware*
+ /usr/include/vmware-vix
+ /usr/lib/cups/filter/thnucups
+ /usr/lib/diskLibWrapper.so
+ /usr/lib/libvixAllProducts.so
+ /usr/lib/vmware*
+ /usr/sbin/vmware*
+ /usr/share/applications/vmware*
+ /usr/share/desktop-directories/vmware-ace-vms.directory
+ /usr/share/doc/vmware*
+ /usr/share/icons/hicolor/*/apps/vmware*
+ /usr/share/icons/hicolor/*/mimetypes/*vmware*
+ /usr/share/man/man1/vmware.1.gz
+ /usr/share/mime/packages/vmware-player.xml
+ /var/lib/vmware
+"
diff --git a/core/modules/vmware15/patches/vmblock__3.0-3.9__1.0-100.0.patch b/core/modules/vmware15/patches/vmblock__3.0-3.9__1.0-100.0.patch
new file mode 100644
index 00000000..89b3a7c6
--- /dev/null
+++ b/core/modules/vmware15/patches/vmblock__3.0-3.9__1.0-100.0.patch
@@ -0,0 +1,11 @@
+--- a/linux/control.c 2013-10-18 19:56:11.000000000 +0200
++++ b/linux/control.c 2014-02-14 15:54:59.895201379 +0100
+@@ -293,7 +293,7 @@
+
+ retval = i < 0 ? -EINVAL : blockOp(name, blocker);
+
+- putname(name);
++ __putname(name);
+
+ return retval;
+ }
diff --git a/core/modules/vmware15/patches/vmblock__3.10__1.0-100.0.patch b/core/modules/vmware15/patches/vmblock__3.10__1.0-100.0.patch
new file mode 100644
index 00000000..e54317f9
--- /dev/null
+++ b/core/modules/vmware15/patches/vmblock__3.10__1.0-100.0.patch
@@ -0,0 +1,34 @@
+--- a/linux/control.c 2013-10-18 19:56:11.000000000 +0200
++++ b/linux/control.c 2014-02-14 16:20:18.667236035 +0100
+@@ -208,17 +208,18 @@
+ VMBlockSetProcEntryOwner(controlProcMountpoint);
+
+ /* Create /proc/fs/vmblock/dev */
+- controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,
++ /* controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,
+ VMBLOCK_CONTROL_MODE,
+- controlProcDirEntry);
+- if (!controlProcEntry) {
++ controlProcDirEntry);*/
++ controlProcEntry = proc_create(VMBLOCK_CONTROL_DEVNAME, VMBLOCK_CONTROL_MODE, controlProcDirEntry, &ControlFileOps);
++ if (controlProcEntry == NULL) {
+ Warning("SetupProcDevice: could not create " VMBLOCK_DEVICE "\n");
+ remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry);
+ remove_proc_entry(VMBLOCK_CONTROL_PROC_DIRNAME, NULL);
+ return -EINVAL;
+ }
+
+- controlProcEntry->proc_fops = &ControlFileOps;
++ /*controlProcEntry->proc_fops = &ControlFileOps;*/
+ return 0;
+ }
+
+@@ -293,7 +294,7 @@
+
+ retval = i < 0 ? -EINVAL : blockOp(name, blocker);
+
+- putname(name);
++ __putname(name);
+
+ return retval;
+ }
diff --git a/core/modules/vmware15/patches/vmblock__3.11-9.9__1.0-11.0.patch b/core/modules/vmware15/patches/vmblock__3.11-9.9__1.0-11.0.patch
new file mode 100644
index 00000000..dedb2646
--- /dev/null
+++ b/core/modules/vmware15/patches/vmblock__3.11-9.9__1.0-11.0.patch
@@ -0,0 +1,123 @@
+--- a/linux/control.c 2013-10-18 19:56:11.000000000 +0200
++++ b/linux/control.c 2014-02-14 16:20:18.667236035 +0100
+@@ -208,17 +208,18 @@
+ VMBlockSetProcEntryOwner(controlProcMountpoint);
+
+ /* Create /proc/fs/vmblock/dev */
+- controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,
++ /* controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,
+ VMBLOCK_CONTROL_MODE,
+- controlProcDirEntry);
+- if (!controlProcEntry) {
++ controlProcDirEntry);*/
++ controlProcEntry = proc_create(VMBLOCK_CONTROL_DEVNAME, VMBLOCK_CONTROL_MODE, controlProcDirEntry, &ControlFileOps);
++ if (controlProcEntry == NULL) {
+ Warning("SetupProcDevice: could not create " VMBLOCK_DEVICE "\n");
+ remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry);
+ remove_proc_entry(VMBLOCK_CONTROL_PROC_DIRNAME, NULL);
+ return -EINVAL;
+ }
+
+- controlProcEntry->proc_fops = &ControlFileOps;
++ /*controlProcEntry->proc_fops = &ControlFileOps;*/
+ return 0;
+ }
+
+@@ -293,7 +294,7 @@
+
+ retval = i < 0 ? -EINVAL : blockOp(name, blocker);
+
+- putname(name);
++ __putname(name);
+
+ return retval;
+ }
+--- a/linux/file.c 2013-10-18 19:56:11.000000000 +0200
++++ b/linux/file.c 2014-02-14 16:20:21.455236098 +0100
+@@ -38,46 +38,6 @@
+ typedef ino_t inode_num_t;
+ #endif
+
+-/* Specifically for our filldir_t callback */
+-typedef struct FilldirInfo {
+- filldir_t filldir;
+- void *dirent;
+-} FilldirInfo;
+-
+-
+-/*
+- *----------------------------------------------------------------------------
+- *
+- * Filldir --
+- *
+- * Callback function for readdir that we use in place of the one provided.
+- * This allows us to specify that each dentry is a symlink, but pass through
+- * everything else to the original filldir function.
+- *
+- * Results:
+- * Original filldir's return value.
+- *
+- * Side effects:
+- * Directory information gets copied to user's buffer.
+- *
+- *----------------------------------------------------------------------------
+- */
+-
+-static int
+-Filldir(void *buf, // IN: Dirent buffer passed from FileOpReaddir
+- const char *name, // IN: Dirent name
+- int namelen, // IN: len of dirent's name
+- loff_t offset, // IN: Offset
+- inode_num_t ino, // IN: Inode number of dirent
+- unsigned int d_type) // IN: Type of file
+-{
+- FilldirInfo *info = buf;
+-
+- /* Specify DT_LNK regardless */
+- return info->filldir(info->dirent, name, namelen, offset, ino, DT_LNK);
+-}
+-
+-
+ /* File operations */
+
+ /*
+@@ -166,11 +126,10 @@
+
+ static int
+ FileOpReaddir(struct file *file, // IN
+- void *dirent, // IN
+- filldir_t filldir) // IN
++ struct dir_context *ctx) // IN
+ {
+ int ret;
+- FilldirInfo info;
++
+ struct file *actualFile;
+
+ if (!file) {
+@@ -184,12 +143,10 @@
+ return -EINVAL;
+ }
+
+- info.filldir = filldir;
+- info.dirent = dirent;
+-
+- actualFile->f_pos = file->f_pos;
+- ret = vfs_readdir(actualFile, Filldir, &info);
+- file->f_pos = actualFile->f_pos;
++ /* Ricky Wong Yung Fei:
++ * Manipulation of pos is now handled internally by iterate_dir().
++ */
++ ret = iterate_dir(actualFile, ctx);
+
+ return ret;
+ }
+@@ -237,7 +194,7 @@
+
+
+ struct file_operations RootFileOps = {
+- .readdir = FileOpReaddir,
++ .iterate = FileOpReaddir,
+ .open = FileOpOpen,
+ .release = FileOpRelease,
+ };
diff --git a/core/modules/vmware15/patches/vmci__4.3-4.3__12.0.0.patch b/core/modules/vmware15/patches/vmci__4.3-4.3__12.0.0.patch
new file mode 100644
index 00000000..05dae1b7
--- /dev/null
+++ b/core/modules/vmware15/patches/vmci__4.3-4.3__12.0.0.patch
@@ -0,0 +1,26 @@
+--- a/linux/driver.c 2015-09-14 21:07:49.751696932 +0200
++++ b/linux/driver.c 2015-09-14 22:10:48.015908198 +0200
+@@ -2467,8 +2467,6 @@
+ static void __exit
+ vmci_exit(void)
+ {
+- int retval;
+-
+ if (guestDeviceInit) {
+ pci_unregister_driver(&vmci_driver);
+ vfree(data_buffer);
+@@ -2480,12 +2478,8 @@
+
+ VMCI_HostCleanup();
+
+- retval = misc_deregister(&linuxState.misc);
+- if (retval) {
+- Warning(LGPFX "Module %s: error unregistering\n", VMCI_MODULE_NAME);
+- } else {
+- Log(LGPFX"Module %s: unloaded\n", VMCI_MODULE_NAME);
+- }
++ misc_deregister(&linuxState.misc);
++ Log(LGPFX"Module %s: unloaded\n", VMCI_MODULE_NAME);
+
+ hostDeviceInit = FALSE;
+ }
diff --git a/core/modules/vmware15/patches/vmmon__4.14-4.14.99__12.0-14.0.patch b/core/modules/vmware15/patches/vmmon__4.14-4.14.99__12.0-14.0.patch
new file mode 100644
index 00000000..5278d645
--- /dev/null
+++ b/core/modules/vmware15/patches/vmmon__4.14-4.14.99__12.0-14.0.patch
@@ -0,0 +1,61 @@
+--- a/linux/hostif.c 2017-09-18 15:22:18.000000000 +0200
++++ b/linux/hostif.c 2017-11-17 13:35:49.600578115 +0100
+@@ -79,6 +79,37 @@
+ #error CONFIG_HIGH_RES_TIMERS required for acceptable performance
+ #endif
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
++# define global_zone_page_state global_page_state
++#endif
++
++static unsigned long get_nr_slab_unreclaimable(void)
++{
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
++ return global_node_page_state(NR_SLAB_UNRECLAIMABLE);
++#else
++ return global_page_state(NR_SLAB_UNRECLAIMABLE);
++#endif
++}
++
++static unsigned long get_nr_unevictable(void)
++{
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ return global_node_page_state(NR_UNEVICTABLE);
++#else
++ return global_page_state(NR_UNEVICTABLE);
++#endif
++}
++
++static unsigned long get_nr_anon_mapped(void)
++{
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ return global_node_page_state(NR_ANON_MAPPED);
++ #else
++ return global_page_state(NR_ANON_PAGES);
++ #endif
++}
++
+ /*
+ * Although this is not really related to kernel-compatibility, I put this
+ * helper macro here for now for a lack of better place --hpreg
+@@ -1516,16 +1547,11 @@
+ unsigned int reservedPages = MEMDEFAULTS_MIN_HOST_PAGES;
+ unsigned int hugePages = (vm == NULL) ? 0 :
+ BYTES_2_PAGES(vm->memInfo.hugePageBytes);
+- unsigned int lockedPages = global_page_state(NR_PAGETABLE) +
+- global_page_state(NR_SLAB_UNRECLAIMABLE) +
+- global_page_state(NR_UNEVICTABLE) +
++ unsigned int lockedPages = global_zone_page_state(NR_PAGETABLE) +
++ get_nr_slab_unreclaimable() +
++ get_nr_unevictable() +
+ hugePages + reservedPages;
+- unsigned int anonPages =
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+- global_page_state(NR_ANON_MAPPED);
+-#else
+- global_page_state(NR_ANON_PAGES);
+-#endif
++ unsigned int anonPages = get_nr_anon_mapped();
+ unsigned int swapPages = BYTES_2_PAGES(linuxState.swapSize);
+
+ if (anonPages > swapPages) {
diff --git a/core/modules/vmware15/patches/vmmon__4.14__14.0.patch b/core/modules/vmware15/patches/vmmon__4.14__14.0.patch
new file mode 100644
index 00000000..5278d645
--- /dev/null
+++ b/core/modules/vmware15/patches/vmmon__4.14__14.0.patch
@@ -0,0 +1,61 @@
+--- a/linux/hostif.c 2017-09-18 15:22:18.000000000 +0200
++++ b/linux/hostif.c 2017-11-17 13:35:49.600578115 +0100
+@@ -79,6 +79,37 @@
+ #error CONFIG_HIGH_RES_TIMERS required for acceptable performance
+ #endif
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
++# define global_zone_page_state global_page_state
++#endif
++
++static unsigned long get_nr_slab_unreclaimable(void)
++{
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
++ return global_node_page_state(NR_SLAB_UNRECLAIMABLE);
++#else
++ return global_page_state(NR_SLAB_UNRECLAIMABLE);
++#endif
++}
++
++static unsigned long get_nr_unevictable(void)
++{
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ return global_node_page_state(NR_UNEVICTABLE);
++#else
++ return global_page_state(NR_UNEVICTABLE);
++#endif
++}
++
++static unsigned long get_nr_anon_mapped(void)
++{
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ return global_node_page_state(NR_ANON_MAPPED);
++ #else
++ return global_page_state(NR_ANON_PAGES);
++ #endif
++}
++
+ /*
+ * Although this is not really related to kernel-compatibility, I put this
+ * helper macro here for now for a lack of better place --hpreg
+@@ -1516,16 +1547,11 @@
+ unsigned int reservedPages = MEMDEFAULTS_MIN_HOST_PAGES;
+ unsigned int hugePages = (vm == NULL) ? 0 :
+ BYTES_2_PAGES(vm->memInfo.hugePageBytes);
+- unsigned int lockedPages = global_page_state(NR_PAGETABLE) +
+- global_page_state(NR_SLAB_UNRECLAIMABLE) +
+- global_page_state(NR_UNEVICTABLE) +
++ unsigned int lockedPages = global_zone_page_state(NR_PAGETABLE) +
++ get_nr_slab_unreclaimable() +
++ get_nr_unevictable() +
+ hugePages + reservedPages;
+- unsigned int anonPages =
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+- global_page_state(NR_ANON_MAPPED);
+-#else
+- global_page_state(NR_ANON_PAGES);
+-#endif
++ unsigned int anonPages = get_nr_anon_mapped();
+ unsigned int swapPages = BYTES_2_PAGES(linuxState.swapSize);
+
+ if (anonPages > swapPages) {
diff --git a/core/modules/vmware15/patches/vmmon__4.3-4.3__12.0.0.patch b/core/modules/vmware15/patches/vmmon__4.3-4.3__12.0.0.patch
new file mode 100644
index 00000000..3f5a950a
--- /dev/null
+++ b/core/modules/vmware15/patches/vmmon__4.3-4.3__12.0.0.patch
@@ -0,0 +1,13 @@
+--- a/linux/driver.c 2015-08-14 22:39:49.000000000 +0200
++++ b/linux/driver.c 2015-09-14 22:11:06.807909249 +0200
+@@ -387,9 +387,7 @@
+ #ifdef VMX86_DEVEL
+ unregister_chrdev(linuxState.major, linuxState.deviceName);
+ #else
+- if (misc_deregister(&linuxState.misc)) {
+- Warning("Module %s: error unregistering\n", linuxState.deviceName);
+- }
++ misc_deregister(&linuxState.misc);
+ #endif
+
+ Log("Module %s: unloaded\n", linuxState.deviceName);
diff --git a/core/modules/vmware15/patches/vmmon__4.9-4.9.99__12.0.0-12.5.2.patch b/core/modules/vmware15/patches/vmmon__4.9-4.9.99__12.0.0-12.5.2.patch
new file mode 100644
index 00000000..054dd8a1
--- /dev/null
+++ b/core/modules/vmware15/patches/vmmon__4.9-4.9.99__12.0.0-12.5.2.patch
@@ -0,0 +1,13 @@
+--- a/linux/hostif.c 2016-12-22 14:27:00.425933040 +0100
++++ b/linux/hostif.c 2016-12-22 14:27:38.746706220 +0100
+@@ -1162,7 +1162,9 @@
+ int retval;
+
+ down_read(&current->mm->mmap_sem);
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++ retval = get_user_pages((unsigned long)uvAddr, numPages, 0, ppages, NULL);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+ retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);
+ #else
+ retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
diff --git a/core/modules/vmware15/patches/vmnet__3.13-3.13__1.0-10.0.2.patch b/core/modules/vmware15/patches/vmnet__3.13-3.13__1.0-10.0.2.patch
new file mode 100644
index 00000000..54607506
--- /dev/null
+++ b/core/modules/vmware15/patches/vmnet__3.13-3.13__1.0-10.0.2.patch
@@ -0,0 +1,27 @@
+--- a/filter.c 2014-04-17 05:30:43.497846349 -0700
++++ b/filter.c 2014-04-17 05:30:41.445846394 -0700
+@@ -203,7 +203,11 @@
+ #endif
+
+ static unsigned int
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
+ VNetFilterHookFn(unsigned int hooknum, // IN:
++#else
++VNetFilterHookFn(const struct nf_hook_ops *ops, // IN:
++#endif
+ #ifdef VMW_NFHOOK_USES_SKB
+ struct sk_buff *skb, // IN:
+ #else
+@@ -252,7 +256,11 @@
+
+ /* When the host transmits, hooknum is VMW_NF_INET_POST_ROUTING. */
+ /* When the host receives, hooknum is VMW_NF_INET_LOCAL_IN. */
+- transmit = (hooknum == VMW_NF_INET_POST_ROUTING);
++ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
++ transmit = (hooknum == VMW_NF_INET_POST_ROUTING);
++ #else
++ transmit = (ops->hooknum == VMW_NF_INET_POST_ROUTING);
++ #endif
+
+ packetHeader = compat_skb_network_header(skb);
+ ip = (struct iphdr*)packetHeader;
diff --git a/core/modules/vmware15/patches/vmnet__4.9-4.9.99__12.0.0-12.5.2.patch b/core/modules/vmware15/patches/vmnet__4.9-4.9.99__12.0.0-12.5.2.patch
new file mode 100644
index 00000000..18ef062b
--- /dev/null
+++ b/core/modules/vmware15/patches/vmnet__4.9-4.9.99__12.0.0-12.5.2.patch
@@ -0,0 +1,13 @@
+--- a/userif.c 2016-12-22 14:29:43.237218623 +0100
++++ b/userif.c 2016-12-22 14:31:03.258834075 +0100
+@@ -113,7 +113,9 @@
+ int retval;
+
+ down_read(&current->mm->mmap_sem);
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++ retval = get_user_pages(addr, 1, 0, &page, NULL);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+ retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
+ #else
+ retval = get_user_pages(current, current->mm, addr,