summaryrefslogtreecommitdiffstats
path: root/core/modules/vmware12
diff options
context:
space:
mode:
authorSimon Rettberg2017-11-20 18:25:48 +0100
committerYour Name2017-11-20 18:25:48 +0100
commitf40674d631da306db2e9263adf7eecf5e4c2598e (patch)
tree1258f2adc937a08784ce881485f75cd553260ec2 /core/modules/vmware12
parent[inc/chroot] Improbe unmount logic ;) (diff)
downloadmltk-f40674d631da306db2e9263adf7eecf5e4c2598e.tar.gz
mltk-f40674d631da306db2e9263adf7eecf5e4c2598e.tar.xz
mltk-f40674d631da306db2e9263adf7eecf5e4c2598e.zip
[vmware12] Split vmware module into 12 and 14 until 14 is stable
Diffstat (limited to 'core/modules/vmware12')
-rwxr-xr-xcore/modules/vmware12/data/addon-init6
-rw-r--r--core/modules/vmware12/data/etc/X11/Xreset.d/vmware17
l---------core/modules/vmware12/data/etc/systemd/system/graphical.target.wants/vmware.service1
-rw-r--r--core/modules/vmware12/data/etc/systemd/system/vmware.service9
-rw-r--r--core/modules/vmware12/data/etc/vmware-vix/bootstrap2
-rw-r--r--core/modules/vmware12/data/etc/vmware/bootstrap12
l---------core/modules/vmware12/data/etc/vmware/icu1
-rw-r--r--core/modules/vmware12/data/etc/vmware/locations3
-rw-r--r--core/modules/vmware12/data/etc/vmware/usbarb.rules4
-rwxr-xr-xcore/modules/vmware12/data/opt/openslx/bin/vmplayer16
l---------core/modules/vmware12/data/opt/openslx/bin/vmware1
-rwxr-xr-xcore/modules/vmware12/data/opt/openslx/scripts/systemd-vmware_env106
-rw-r--r--core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/create_vmhome_preferences_file.inc79
-rw-r--r--core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/determine_hardware_limitations.inc197
-rw-r--r--core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/init_core.inc53
-rw-r--r--core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/log_config_summary.inc60
-rw-r--r--core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/parse_vmx.inc22
-rw-r--r--core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc265
-rw-r--r--core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/nvrambin0 -> 270840 bytes
-rw-r--r--core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/run-virt.include61
l---------core/modules/vmware12/data/usr/bin/vmplayer1
l---------core/modules/vmware12/data/usr/bin/vmware1
-rw-r--r--core/modules/vmware12/data/usr/share/icons/hicolor/index.theme1662
-rw-r--r--core/modules/vmware12/module.build211
-rw-r--r--core/modules/vmware12/module.conf70
-rw-r--r--core/modules/vmware12/module.conf.ubuntu137
-rw-r--r--core/modules/vmware12/patches/vmblock__3.0-3.9__1.0-100.0.patch11
-rw-r--r--core/modules/vmware12/patches/vmblock__3.10__1.0-100.0.patch34
-rw-r--r--core/modules/vmware12/patches/vmblock__3.11-9.9__1.0-11.0.patch123
-rw-r--r--core/modules/vmware12/patches/vmci__4.3-4.3__12.0.0.patch26
-rw-r--r--core/modules/vmware12/patches/vmmon__4.14__12.0-14.0.patch61
-rw-r--r--core/modules/vmware12/patches/vmmon__4.3-4.3__12.0.0.patch13
-rw-r--r--core/modules/vmware12/patches/vmmon__4.9-4.9.99__12.0.0-12.5.2.patch13
-rw-r--r--core/modules/vmware12/patches/vmnet__3.13-3.13__1.0-10.0.2.patch27
-rw-r--r--core/modules/vmware12/patches/vmnet__4.13-9.9__12.5-12.5.99.patch12
-rw-r--r--core/modules/vmware12/patches/vmnet__4.9-4.9.99__12.0.0-12.5.2.patch13
36 files changed, 3330 insertions, 0 deletions
diff --git a/core/modules/vmware12/data/addon-init b/core/modules/vmware12/data/addon-init
new file mode 100755
index 00000000..d844c282
--- /dev/null
+++ b/core/modules/vmware12/data/addon-init
@@ -0,0 +1,6 @@
+#!/bin/ash
+
+systemctl daemon-reload
+systemctl start vmware
+exit 0
+
diff --git a/core/modules/vmware12/data/etc/X11/Xreset.d/vmware b/core/modules/vmware12/data/etc/X11/Xreset.d/vmware
new file mode 100644
index 00000000..83bfb392
--- /dev/null
+++ b/core/modules/vmware12/data/etc/X11/Xreset.d/vmware
@@ -0,0 +1,17 @@
+#
+# VMWare cleanup
+#
+
+# Unmount dirs that vmware sometimes leaves around
+VMWARE_TMP_DIRS="$(cat /proc/mounts | grep "/tmp/vmware-" | awk -F " " '{print $1}')"
+for DIR in $VMWARE_TMP_DIRS; do
+ umount "$DIR" && rmdir "$DIR"
+done
+
+# Delete redo/temp files that sometimes stay around e.g. on vmware crash
+for file in $(find /tmp/virt/vmware -type f -size +4M); do
+ fuser -s "$file" || rm -- "$file"
+done
+
+true
+
diff --git a/core/modules/vmware12/data/etc/systemd/system/graphical.target.wants/vmware.service b/core/modules/vmware12/data/etc/systemd/system/graphical.target.wants/vmware.service
new file mode 120000
index 00000000..7deb4820
--- /dev/null
+++ b/core/modules/vmware12/data/etc/systemd/system/graphical.target.wants/vmware.service
@@ -0,0 +1 @@
+../vmware.service \ No newline at end of file
diff --git a/core/modules/vmware12/data/etc/systemd/system/vmware.service b/core/modules/vmware12/data/etc/systemd/system/vmware.service
new file mode 100644
index 00000000..78f75726
--- /dev/null
+++ b/core/modules/vmware12/data/etc/systemd/system/vmware.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Sets up the vmware environment
+Requires=run-virt-env.service setup-partitions.service network.target
+After=run-virt-env.service setup-partitions.service network.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/opt/openslx/scripts/systemd-vmware_env start
diff --git a/core/modules/vmware12/data/etc/vmware-vix/bootstrap b/core/modules/vmware12/data/etc/vmware-vix/bootstrap
new file mode 100644
index 00000000..425074de
--- /dev/null
+++ b/core/modules/vmware12/data/etc/vmware-vix/bootstrap
@@ -0,0 +1,2 @@
+BINDIR="/usr/bin"
+
diff --git a/core/modules/vmware12/data/etc/vmware/bootstrap b/core/modules/vmware12/data/etc/vmware/bootstrap
new file mode 100644
index 00000000..0cc4af90
--- /dev/null
+++ b/core/modules/vmware12/data/etc/vmware/bootstrap
@@ -0,0 +1,12 @@
+PREFIX="/usr"
+BINDIR="/usr/bin"
+SBINDIR="/usr/sbin"
+LIBDIR="/usr/lib"
+DATADIR="/usr/share"
+SYSCONFDIR="/etc"
+DOCDIR="/usr/share/doc"
+MANDIR="/usr/share/man"
+INCLUDEDIR="/usr/include"
+INITDIR="/etc"
+INITSCRIPTDIR="/etc/init.d"
+
diff --git a/core/modules/vmware12/data/etc/vmware/icu b/core/modules/vmware12/data/etc/vmware/icu
new file mode 120000
index 00000000..d1ebea7d
--- /dev/null
+++ b/core/modules/vmware12/data/etc/vmware/icu
@@ -0,0 +1 @@
+/usr/lib/vmware/icu \ No newline at end of file
diff --git a/core/modules/vmware12/data/etc/vmware/locations b/core/modules/vmware12/data/etc/vmware/locations
new file mode 100644
index 00000000..2d419546
--- /dev/null
+++ b/core/modules/vmware12/data/etc/vmware/locations
@@ -0,0 +1,3 @@
+# Empty locations file to catch downgrade
+# to WS 6.0
+# OpenSLX: No idea what above means, but better have this file... ;-)
diff --git a/core/modules/vmware12/data/etc/vmware/usbarb.rules b/core/modules/vmware12/data/etc/vmware/usbarb.rules
new file mode 100644
index 00000000..ae107c7b
--- /dev/null
+++ b/core/modules/vmware12/data/etc/vmware/usbarb.rules
@@ -0,0 +1,4 @@
+{
+ "version": 1,
+ "rules": []
+}
diff --git a/core/modules/vmware12/data/opt/openslx/bin/vmplayer b/core/modules/vmware12/data/opt/openslx/bin/vmplayer
new file mode 100755
index 00000000..05a4ec3a
--- /dev/null
+++ b/core/modules/vmware12/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/vmware12/data/opt/openslx/bin/vmware b/core/modules/vmware12/data/opt/openslx/bin/vmware
new file mode 120000
index 00000000..aa0b74b1
--- /dev/null
+++ b/core/modules/vmware12/data/opt/openslx/bin/vmware
@@ -0,0 +1 @@
+vmplayer \ No newline at end of file
diff --git a/core/modules/vmware12/data/opt/openslx/scripts/systemd-vmware_env b/core/modules/vmware12/data/opt/openslx/scripts/systemd-vmware_env
new file mode 100755
index 00000000..1b0c0f99
--- /dev/null
+++ b/core/modules/vmware12/data/opt/openslx/scripts/systemd-vmware_env
@@ -0,0 +1,106 @@
+#!/bin/ash
+# -----------------------------------------------------------------------------
+# Copyright (c) 2013 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# systemd-vmware_env
+# - This is the systemd configuration and provisioning script for the various
+# VMware modules and services
+################################################################################
+
+VMWARE_CONF_DIR=/opt/openslx/vmchooser/vmware
+VMCHOOSER_CONF_DIR=/opt/openslx/vmchooser/config
+
+load_modules () {
+ local FAILED=""
+ # module stuff
+ insmod /lib/modules/vmware/vmmon.ko || FAILED="$FAILED vmmon"
+ insmod /lib/modules/vmware/vmnet.ko || FAILED="$FAILED vmnet"
+ #insmod /lib/modules/vmware/vmci.ko || FAILED="$FAILED vmci"
+ #insmod /lib/modules/vmware/vmblock.ko || FAILED="$FAILED vmblock"
+ #insmod /lib/modules/vmware/vsock.ko || FAILED="$FAILED vsock"
+ [ -n "$FAILED" ] && slxlog "vmware-insmod" "Error loading vmware kernel module(s) $FAILED"
+}
+
+unload_modules () {
+ rmmod vmnet vmmon #vsock vmci vmblock
+}
+
+vmnetif () {
+ # create the needed devices which effects all vmware options
+ # they are not created automatically via module load
+ for device in "/dev/vmnet0 c 119 0" "/dev/vmnet1 c 119 1" \
+ "/dev/vmnet2 c 119 2" "/dev/vmmon c 10 165"; do
+ mknod ${device}
+ done
+ chmod 0700 /dev/vmnet*
+
+ # setup bridge (vmnet0), nat (vmnet1) and software defined networking (vmnet2) interfaces
+ if ! /usr/bin/vmnet-netifup -d /var/run/vmnet-netifup-vmnet0.pid /dev/vmnet0 vmnet0 ; then
+ slxlog "vmware-netifup" "Launching /usr/bin/vmnet-netifup for vmnet0 failed."
+ fi
+ ip link set dev vmnet0 up
+ brctl addif br0 vmnet0
+ if ! /usr/bin/vmnet-netifup -d /var/run/vmnet-netifup-vmnet1.pid /dev/vmnet1 vmnet1; then
+ slxlog "vmware-netifup" "Launching /usr/bin/vmnet-netifup for vmnet1 failed."
+ fi
+ ip link set dev vmnet1 up
+ brctl addif nat1 vmnet1
+ if ! /usr/bin/vmnet-netifup -d /var/run/vmnet-netifup-vmnet2.pid /dev/vmnet2 vmnet2; then
+ slxlog "vmware-netifup" "Launching /usr/bin/vmnet-netifup for vmnet2 failed."
+ fi
+ ip link set dev vmnet2 up
+ brctl addif vsw2 vmnet2
+}
+
+vmblock () {
+ if ! /usr/bin/vmware-usbarbitrator; then
+ slxlog "vmware-usbarb" "Launching /usr/bin/vmware-usbarbitrator failed."
+ fi
+}
+
+# create required standard directories
+mkdir -p "/tmp/virt/vmware" "/dev/shm/vmware" "/run/vmware" -m 1777
+
+# FixMe: Should be rewritten for proper systemd operation
+case "$1" in
+ start)
+ # hack to access the first serial/parallel port
+ [ -c /dev/ttyS0 ] && chmod a+rw /dev/ttyS0
+ [ -c /dev/parport0 ] && chmod a+rw /dev/parport0
+ load_modules
+ vmnetif
+ vmblock
+ ;;
+ stop)
+ #stop: defines stop function for initscript
+ killall vmnet-netifup vmnet-bridge vmware vmplayer vmware-tray
+ # might take a while until all services are shut down
+ sleep 0.5
+ unload_modules
+
+ ;;
+ restart)
+ #restart: defines restart function for initscript
+ $0 stop && $0 start
+ ;;
+ status)
+ #status: defines status function for initscript
+ vmstatus
+ ;;
+esac
+
+# Breaks performance with certain workloads, so disable.
+# See https://unix.stackexchange.com/a/185172 for details and further references
+echo never > /sys/kernel/mm/transparent_hugepage/defrag
+echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag
+
+exit 0
+
diff --git a/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/create_vmhome_preferences_file.inc b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/create_vmhome_preferences_file.inc
new file mode 100644
index 00000000..2e1ed1c4
--- /dev/null
+++ b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/create_vmhome_preferences_file.inc
@@ -0,0 +1,79 @@
+#!/bin/bash
+###########################################
+# Include: Create VMware preferences file #
+###########################################
+## Functions ##
+create_vmhome_preferences_file() {
+ cat > "${VM_HOME}/preferences" <<-HEREEND
+ .encoding = "UTF-8"
+ # This configuration file was generated on $(date)
+ # by $0 for VMWare version $vmware_version
+
+ # updates
+ webUpdate.enabled = "FALSE"
+ webUpdate.lastCheck.status = "done_updates"
+ webUpdate.checkPeriod = "never"
+ pref.downloadPermission = "DENY"
+ pref.vmplayer.downloadPermission = "DENY"
+ pref.vmplayer.webUpdateOnStartup = "FALSE"
+ pref.lastUpdateCheckSec = "$(date +%s)"
+ # hints
+ pref.tip.startup = "FALSE"
+ hints.hideAll = "TRUE"
+ hint.vmui.showAllUSBDevs = "FALSE"
+ hint.usb.disconnectHostdriver = "FALSE"
+ hint.vmui.reset = "FALSE"
+ hint.vmui.poweroff = "FALSE"
+ hint.upgrade.legacyVM = "FALSE"
+ hint.tools.toolsReminder = "FALSE"
+ hint.nfsmounted.persistent = "FALSE"
+ hint.loader.debug.beta = "FALSE"
+ hint.leaveFullScreen = "FALSE"
+ hint.guestos.xp = "FALSE"
+ hint.buslogic.needDriver = "FALSE"
+
+ # configs
+ prefvmx.defaultVMPath = "${VM_HOME}"
+ prefvmx.mru.config = "$VM_RUN_FILE:"
+
+ # hot keys
+ pref.hotkey.control = "true"
+ pref.hotkey.alt = "true"
+ pref.hotkey.shift = "true"
+ pref.hotkey.gui = "true"
+
+ # fullscreen/mouse/keyboard
+ pref.fullscreen.toolbarPixels = "0"
+ pref.vmplayer.fullscreen.autohide = "TRUE"
+ pref.vmplayer.fullscreen.nobar = 1
+ pref.grabOnMouseClick = "TRUE"
+ pref.grabOnKeyPress = "TRUE"
+ pref.motionGrab = "TRUE"
+ pref.motionUngrab = "TRUE"
+ pref.hideCursorOnUngrab = "TRUE"
+ pref.autoFit = "TRUE"
+ pref.autoFitFullScreen = "fitGuestToHost"
+ pref.autoFitGuestToWindow = "TRUE"
+ pref.vmplayer.exit.vmAction = "poweroff"
+ pref.vmplayer.confirmOnExit = "TRUE"
+ pref.backgroundOnClose = "FALSE"
+ pref.trayicon.enabled = "FALSE"
+
+ # shared folders
+ pref.enableAllSharedFolders = "TRUE"
+
+ # eula
+ pref.vmplayer.firstRunDismissedVersion = "$vmware_version"
+ pref.eula.count = "2"
+ pref.eula0.product = "VMware Player"
+ pref.eula0.build = "$vmware_build"
+ pref.eula1.product = "VMware Workstation"
+ pref.eula1.build = "$vmware_build"
+ HEREEND
+ if [ -n "$SLX_EXAM" ]; then
+ echo 'pref.hotkey.rightControl = "true"' >> "${VM_HOME}/preferences"
+ fi
+ writelog "Vmware preferences file created in $VM_HOME."
+}
+
+call_post_source create_vmhome_preferences_file
diff --git a/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/determine_hardware_limitations.inc b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/determine_hardware_limitations.inc
new file mode 100644
index 00000000..c288ed09
--- /dev/null
+++ b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/determine_hardware_limitations.inc
@@ -0,0 +1,197 @@
+#!/bin/bash
+##########################################################################
+# Include: Determine limitations caused by hardware version and guest os #
+##########################################################################
+## Functions
+set_vm_hardware_limits() {
+ # Sanity checks
+ if isempty VM_OS_TYPE; then
+ writelog "VM_OS_TYPE is empty! This should have been parsed from the VM metadata."
+ EXIT_TYPE="user" EXIT_REASON="Konnte Gastbetriebsystems der gewählten virtuellen Maschine nicht ermitteln!" cleanexit 1
+ fi
+
+ declare -g MAXMEM="9999999"
+ declare -g MAXCORES="4"
+ declare -g SHARED_FOLDERS="TRUE"
+ declare -g SOUND_DEV="es1371"
+
+ # define hardware configuration depending on the guest OS used
+ # this needs to be fixed and is the base for the creation of new VMs
+ case "$VM_OS_TYPE" in
+ win31*|windows31*)
+ VM_OS_TYPE="win31"
+ SHARED_FOLDERS="FALSE"
+ SOUND_DEV="sb16"
+ MAXMEM="32"
+ MAXCORES="1"
+ ;;
+ winnt*|windowsnt*)
+ VM_OS_TYPE="winnt"
+ SHARED_FOLDERS="FALSE"
+ SOUND_DEV="sb16"
+ MAXMEM="1000"
+ MAXCORES="2"
+ ;;
+ win95*|windows95*)
+ VM_OS_TYPE="win95"
+ SHARED_FOLDERS="FALSE"
+ MAXMEM="96"
+ MAXCORES="1"
+ ;;
+ win98*|windows98*)
+ VM_OS_TYPE="win98"
+ MAXMEM="256"
+ MAXCORES="1"
+ ;;
+ winme*|windowsme*)
+ VM_OS_TYPE="winme"
+ MAXMEM="384"
+ MAXCORES="1"
+ ;;
+ win2000|windows2000|win2000pro*)
+ VM_OS_TYPE="win2000pro"
+ MAXMEM="4000"
+ MAXCORES="2"
+ ;;
+ win2000srv*|windows2000srv*|win2000serv*|windows2000serv*)
+ VM_OS_TYPE="win2000serv"
+ SHARED_FOLDERS="FALSE"
+ MAXMEM="4000"
+ MAXCORES="4"
+ ;;
+ win2000adv*|windows2000adv*|win2000dat*|windows2000dat*)
+ VM_OS_TYPE="win2000advserv"
+ SHARED_FOLDERS="FALSE"
+ MAXMEM="8000"
+ MAXCORES="8"
+ ;;
+ winnet*64|win*2003*64|windowsnet*64)
+ VM_OS_TYPE="winnetstandard-64"
+ MAXMEM="8000"
+ MAXCORES="8"
+ ;;
+ winnet*|win*2003*|windowsnet*)
+ VM_OS_TYPE="winnetstandard"
+ MAXMEM="4000"
+ MAXCORES="8"
+ ;;
+ winxphome*|windowsxphome*)
+ VM_OS_TYPE="winxphome"
+ MAXMEM="4000"
+ MAXCORES="2"
+ ;;
+ winxp*64|windowsxp*64)
+ VM_OS_TYPE="winxppro-64"
+ MAXMEM="8000"
+ MAXCORES="8"
+ ;;
+ winxp*|windowsxp*)
+ VM_OS_TYPE="winxppro"
+ MAXMEM="4000"
+ MAXCORES="4"
+ ;;
+ winvista-64)
+ VM_OS_TYPE="winvista-64"
+ MAXMEM="16000"
+ MAXCORES="4"
+ ;;
+ windows7-64)
+ VM_OS_TYPE="windows7-64"
+ MAXMEM="32000"
+ MAXCORES="8"
+ ;;
+ windows8-64)
+ VM_OS_TYPE="windows8-64"
+ MAXMEM="32000"
+ MAXCORES="8"
+ ;;
+ windows9-64)
+ VM_OS_TYPE="windows9-64"
+ MAXMEM="64000"
+ MAXCORES="8"
+ ;;
+ winvista)
+ VM_OS_TYPE="winvista"
+ MAXMEM="8000"
+ MAXCORES="2"
+ ;;
+ windows7)
+ VM_OS_TYPE="windows7"
+ MAXMEM="8000"
+ MAXCORES="4"
+ ;;
+ windows8)
+ VM_OS_TYPE="windows8"
+ MAXMEM="8000"
+ MAXCORES="4"
+ ;;
+ windows9)
+ VM_OS_TYPE="windows9"
+ MAXMEM="8000"
+ MAXCORES="4"
+ ;;
+ win*64)
+ MAXMEM="16000"
+ MAXCORES="4"
+ ;;
+ win*)
+ MAXMEM="8000"
+ MAXCORES="1"
+ ;;
+ dos|msdos*|ms-dos*)
+ VM_OS_TYPE="dos"
+ SHARED_FOLDERS="FALSE"
+ MAXMEM="128"
+ MAXCORES="1"
+ ;;
+ macos*64)
+ VM_OS_TYPE="freebsd-64"
+ MAXMEM="4000"
+ MAXCORES="2"
+ ;;
+ macos*)
+ VM_OS_TYPE="freebsd"
+ MAXMEM="4000"
+ MAXCORES="1"
+ ;;
+ beos*)
+ VM_OS_TYPE="other"
+ SHARED_FOLDERS="FALSE"
+ ;;
+ # Unknown guestOS setting in .xml - this encompasses linux too,
+ # as there is a multitude of different distributions. Perhaps further
+ # action will be needed if this leads to problems with exotic OSs.
+ *64)
+ VM_OS_TYPE="other-64"
+ # SHARED_FOLDERS="FALSE"
+ MAXMEM="123456"
+ MAXCORES="4"
+ ;;
+ *)
+ VM_OS_TYPE="other"
+ # SHARED_FOLDERS="FALSE"
+ MAXMEM="8000"
+ MAXCORES="1"
+ ;;
+ esac
+
+ declare -rg HOST_CORE_COUNT="$CPU_CORES"
+ [ "$CPU_CORES" -gt "$MAXCORES" ] && CPU_CORES="$MAXCORES"
+
+ # It currently makes no sense to set the virtual number of cores
+ # to a different value than the virtual number of cores per virtual CPU.
+ declare -rg VM_CORES_PER_SOCKET="$CPU_CORES"
+
+ if [ "x$SHARED_FOLDERS" != "xFALSE" ] && [ "$SHARE_REMAP_MODE" -gt 1 ]; then
+ declare -rg HGFS_DISABLED="FALSE"
+ else
+ declare -rg HGFS_DISABLED="TRUE"
+ fi
+
+ [ "${VM_MEM}" -ge "${MAXMEM}" ] && VM_MEM="${MAXMEM}"
+ [ "${VM_HW_VERSION}" -lt "7" -a "${VM_MEM}" -gt "3500" ] && VM_MEM="3500"
+ return 0
+}
+
+## MAIN ##
+call_post_source set_vm_hardware_limits
diff --git a/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/init_core.inc b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/init_core.inc
new file mode 100644
index 00000000..85fafc9f
--- /dev/null
+++ b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/init_core.inc
@@ -0,0 +1,53 @@
+#!/bin/bash
+#######################################################################
+# Include: Declaration of core functions and variables of this plugin #
+#######################################################################
+# This core include just runs commands directly
+
+## Sanity checks for systemd-vmware_env
+# /dev/vmmon should exist, missing vmnet's does not make vmplayer crash
+if [ ! -c /dev/vmmon ]; then
+ # would cause vmplayer to crash, so abort
+ EXIT_TYPE="internal" EXIT_REASON="VMWare wurde nicht richtig initialisiert!" cleanexit 1
+fi
+
+# For now define helpers here, maybe use a dedicated include later on
+vmw_cap_hw_version() {
+ [ -z "$1" ] && writelog "cap_hw_version called without parameter!" && return 1
+ [ "$1" -lt "$maxhardwareversion" ] && maxhardwareversion="$1"
+}
+
+# Temporary disk space for logs, etc...
+declare -rg VM_REDO_DIR="/tmp/virt/vmware/${USER}.$$"
+
+# Dir for configs and vmem file
+declare -rg VM_CONF_DIR="/tmp/virt/vmware/${USER}.$$"
+
+# The VMX file of the starting VM
+declare -rg VM_RUN_FILE="${VM_CONF_DIR}/run-vmware.conf"
+
+# Users vmware config folder
+[ -z "${HOME}" ] && declare -rg HOME=$(getent passwd "$(whoami)" | awk -F ':' '{print $6}')
+declare -rg VM_HOME="${HOME}/.vmware"
+
+# mltk generates a vmware config file with several version infos for vmware/player, read it
+$(safesource "${VMWARE_PLUGIN_DIR}/vmware.conf")
+
+# VMware start options
+# "-X": start in fullscreen
+declare -rg VM_START_OPTIONS="-X"
+
+# create vmware directories
+mkdir -p "$VM_REDO_DIR" >/dev/null 2>&1
+mkdir -p "$VM_CONF_DIR" >/dev/null 2>&1
+mkdir -p "$VM_HOME/dndlogs" >/dev/null 2>&1
+touch "$VM_HOME/dndlogs/dndlog.conf" >/dev/null 2>&1
+
+# link to VM_RUN_FILE if VM_CONF_DIR != VM_REDO_DIR
+[ "$VM_CONF_DIR" != "$VM_REDO_DIR" ] && ln -s "$VM_RUN_FILE" "$VM_REDO_DIR/run-vmware.conf" >/dev/null 2>&1
+
+# own nvram. We need it for floppy drive b, default nvram has just drive a
+if ! cp "${VMWARE_PLUGIN_DIR}/nvram" "$VM_CONF_DIR/nvram"; then
+ slxlog "virt-vmware-nvram" "Could not copy nvram from '${VMWARE_PLUGIN_DIR}/nvram' '$VM_CONF_DIR/nvram'"
+fi
+
diff --git a/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/log_config_summary.inc b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/log_config_summary.inc
new file mode 100644
index 00000000..0c20cbcc
--- /dev/null
+++ b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/log_config_summary.inc
@@ -0,0 +1,60 @@
+#!/bin/bash
+##################################################
+# Include: Print vm config summary into log file #
+##################################################
+
+log_config_summary() {
+ # write all results to logfile
+ # log disksetup
+ writelog "Directories:"
+ writelog "\tConfig dir:\t\t${VM_CONF_DIR}"
+ writelog "\tConfig file:\t\t${VM_RUN_FILE}"
+ writelog "\tRedo dir:\t\t${VM_REDO_DIR}"
+ writelog "\tVM home:\t\t${VM_HOME}"
+ writelog "\tDrag n' drop log:\t${VM_HOME}/dndlogs"
+ writelog "\t/tmp info:\t\t$(grep "/tmp " /proc/mounts) $(df -h | grep " /tmp$" | awk '{print $2}')"
+
+ # hw setup
+ writelog "Hardware:"
+ writelog "\tvCPUs:\t\t\t${CPU_CORES}"
+ writelog "\tVM RAM:\t\t\t${VM_MEM} MB"
+ writelog "\tMAC:\t\t\t${VM_MAC_ADDR}"
+ if [ -n "${network_card}" ]; then
+ writelog "\tNet Adaptor:\t\t${network_card}"
+ fi
+
+ writelog "\tCD-ROM 1:\t\t${CDROM0}"
+ writelog "\tCD-ROM 2:\t\t${CDROM1}"
+ writelog "\tFloppy A:\t\t${FLOPPY0}"
+ # echo nur wenn HOST_MEM_REMAINING gesetzt
+ if isset HOST_MEM_REMAINING; then
+ writelog "\tRemaining host RAM:\t${HOST_MEM_REMAINING} MB"
+ fi
+
+ # image
+ writelog "Disk image:"
+ writelog "\tDisk file:\t\t${VM_DISKFILE_RO}"
+ if isset VM_DISKFILE_RW; then
+ writelog "\tDisk mode:\t\twritable"
+ writelog "\tRW-Layer:\t\t${VM_DISKFILE_RW}"
+ else
+ writelog "\tDisk mode:\t\tread-only"
+ fi
+ writelog "\tHardware version:\t${VM_HW_VERSION}"
+ writelog "\tGuest OS:\t\t${VM_OS_TYPE}"
+
+ # misc
+ writelog "Misc:"
+ writelog "\tDisplayname:\t\t${VM_DISPLAYNAME}"
+ if [ "${cap3d}" = "TRUE" -a "${enable3d}" = "TRUE" ]; then
+ writelog "\t3D Graphics:\tenabled"
+ fi
+ if [ "${HGFS_DISABLED}" = "FALSE" ]; then
+ writelog "\tShared folders:\t\tdisabled"
+ else
+ writelog "\tShared folders:\t\tenabled."
+ fi
+ # empty line at end
+ writelog ""
+}
+call_post_source log_config_summary
diff --git a/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/parse_vmx.inc b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/parse_vmx.inc
new file mode 100644
index 00000000..6ca82acb
--- /dev/null
+++ b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/parse_vmx.inc
@@ -0,0 +1,22 @@
+######################################################################
+# Include: Parsing the non-legacy delivered vmxfile ${TMPCONFIG} #
+######################################################################
+## Functions
+parse_vmx() {
+ writelog "Parsing virtual machine description file..."
+ local -i HW_VERSION=$(grep -i -m1 '^virtualHW.version *= *' "${TMPCONFIG}" | awk -F '=' '{print $2}' | sed -r 's/[^0-9]//g')
+ if notempty HW_VERSION; then
+ declare -g VM_HW_VERSION="${HW_VERSION}"
+ return 0
+ fi
+ return 1
+}
+
+## MAIN ##
+if notempty TMPCONFIG; then
+ call_post_source parse_vmx
+else
+ writelog "Path to VMX file is not set or empty! Aborting..."
+ EXIT_TYPE="internal" EXIT_REASON="Konnte Pfad zur VMX-Datei nicht finden!" cleanexit 1
+fi
+
diff --git a/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc
new file mode 100644
index 00000000..a431560f
--- /dev/null
+++ b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc
@@ -0,0 +1,265 @@
+#!/bin/bash
+################################################
+# Include: Create final VMX configuration file #
+################################################
+
+
+# check for vmdk file marker %VM_DISK_PATH% and put vmdk path in it's place: also VM_DISK_MODE
+# and VM_DISK_REDOLOGDIR.
+replace_placeholders() {
+ if [ -n "$VM_DISKFILE_RW" ]; then
+ sed -i 's#%VM_DISK_PATH%#'"$VM_DISKFILE_RW"'#g' "${TMPCONFIG}"
+ sed -i 's#%VM_DISK_MODE%#'"independent-persistent"'#g' "${TMPCONFIG}"
+ else
+ sed -i 's#%VM_DISK_PATH%#'"$VM_DISKFILE_RO"'#g' "${TMPCONFIG}"
+ sed -i 's#%VM_DISK_MODE%#'"independent-nonpersistent"'#g' "${TMPCONFIG}"
+ fi
+ sed -i 's#%VM_DISK_REDOLOGDIR%#'"$VM_REDO_DIR"'#g' "${TMPCONFIG}"
+}
+
+# Ethernet: All we do is entering a generated MAC, as we do not want to interfere
+# in the possible case no networking is wanted.
+setup_ethernet() {
+ echo 'ethernet0.addressType = "static"' >> "${TMPCONFIG}"
+ echo 'ethernet0.address = "'"${VM_MAC_ADDR}"'"' >> "${TMPCONFIG}"
+}
+
+# DVD, CDROM
+setup_optical_drives() {
+ # XXX: For now it's safe to assume ide channel 1 is free, as we support only one HDD.
+ # If it's IDE, it's on channel 0
+ cat >> "${TMPCONFIG}" <<-HEREEND
+ ide1:0.present = "$CDROM0"
+ ide1:0.autodetect = "TRUE"
+ ide1:0.fileName = "auto detect"
+ ide1:0.deviceType = "cdrom-raw"
+ ide1:1.present = "$CDROM1"
+ ide1:1.autodetect = "TRUE"
+ ide1:1.fileName = "auto detect"
+ ide1:1.deviceType = "cdrom-raw"
+ HEREEND
+}
+
+setup_floppies() {
+ local SLX_FLOPPY
+ if isset SLX_FLOPPY_IMG; then
+ SLX_FLOPPY="TRUE"
+ else
+ SLX_FLOPPY="FALSE"
+ fi
+
+ # Floppies:
+ cat >> "${TMPCONFIG}" <<-HEREEND
+ floppy0.present = "TRUE"
+ floppy0.startConnected = "$FLOPPY0"
+ floppy0.autodetect = "TRUE"
+ floppy0.fileName = "auto detect"
+ floppy1.present = "$SLX_FLOPPY"
+ floppy1.startConnected = "TRUE"
+ floppy1.fileType = "file"
+ floppy1.fileName = "$SLX_FLOPPY_IMG"
+ HEREEND
+}
+
+setup_serial() {
+ # Serial port
+ if [ -n "$SERIAL0" ]; then
+ cat >> "${TMPCONFIG}" <<-HEREEND
+ serial0.present = "TRUE"
+ serial0.startConnected = "TRUE"
+ serial0.fileType = "device"
+ serial0.fileName = "$SERIAL0"
+ serial0.tryNoRxLoss = "FALSE"
+ serial0.autodetect = "FALSE"
+ HEREEND
+ fi
+
+ # Parallel port
+ if [ -n "$PARALLEL0" ]; then
+ cat >> "${TMPCONFIG}" <<-HEREEND
+ parallel0.present = "TRUE"
+ parallel0.startConnected = "TRUE"
+ parallel0.fileType = "device"
+ parallel0.fileName = "$PARALLEL0"
+ parallel0.bidirectional = "TRUE"
+ parallel0.autodetect = "FALSE"
+ HEREEND
+ fi
+}
+
+# CPU and RAM
+setup_vcpu_ram() {
+ #writelog "numvcpus = ${CPU_CORES} - maxvcpus=${HOST_CORE_COUNT}"
+ cat >> "${TMPCONFIG}" <<-HEREEND
+ numvcpus = "$CPU_CORES"
+ cpuid.coresPerSocket = "$VM_CORES_PER_SOCKET"
+ maxvcpus = "$HOST_CORE_COUNT"
+ memsize = "${VM_MEM}"
+ MemAllowAutoScaleDown = "FALSE"
+ MemTrimRate = "-1"
+ HEREEND
+}
+
+setup_usb() {
+ # USB fallback: Only write usb config if there's none
+ if ! grep -q -i "^usb\.present" "${TMPCONFIG}"; then
+ # Nothing found, go ahead
+ if [ -n "$SLX_EXAM" ]; then # TODO better handling of exam mode...
+ # Exam mode: Default to no USB
+ sed -i '/^usb\./Id' "${TMPCONFIG}"
+ echo 'usb.present = "FALSE"' >> "${TMPCONFIG}"
+ else
+ echo 'usb.present = "TRUE"' >> "${TMPCONFIG}"
+ fi
+ fi
+ sed -i '/^usb\.generic\.autoconnect/Id' "${TMPCONFIG}"
+ echo 'usb.generic.autoconnect = "TRUE"' >> "${TMPCONFIG}"
+
+ # USB 3.0 support changes quality and has different side effects
+ # with every minor release of vmware. Always force 2.0 for now.
+ # TODO: Get it fixed by vmware?
+ sed -i '/^ehci\.present/Id;/^usb_xhci\.present/Id' "${TMPCONFIG}"
+ echo 'ehci.present = "TRUE"' >> "${TMPCONFIG}"
+
+ # See if there are any USB devices connected that we want to pass through immediately
+ get_usb_devices 'usb.autoConnect.deviceXXXXX = "0x%VENDOR%:0x%PRODUCT%"' \
+ | sed -r 's/0x0+/0x/g' \
+ | awk '{sub(/XXXXX/,NR-1)}1' \
+ >> "${TMPCONFIG}"
+}
+
+setup_shared_folders() {
+ if ! notempty SHARED_FOLDERS HOME_SHARE_PATH HOME_SHARE_NAME COMMON_SHARE_PATH COMMON_SHARE_NAME; then
+ writelog "Missing information to setup shared folders."
+ return 1
+ fi
+
+ cat >> "${TMPCONFIG}" <<-HEREEND
+ sharedFolder.option = "alwaysEnabled"
+ sharedFolder0.present = "$SHARED_FOLDERS"
+ sharedFolder0.enabled = "$SHARED_FOLDERS"
+ sharedFolder0.expiration = "never"
+ sharedFolder0.guestName = "$HOME_SHARE_NAME"
+ sharedFolder0.hostPath = "$HOME_SHARE_PATH"
+ sharedFolder0.readAccess = "TRUE"
+ sharedFolder0.writeAccess = "TRUE"
+ sharedFolder1.present = "$SHARED_FOLDERS"
+ sharedFolder1.enabled = "$SHARED_FOLDERS"
+ sharedFolder1.expiration = "never"
+ sharedFolder1.guestName = "$COMMON_SHARE_NAME"
+ sharedFolder1.hostPath = "$COMMON_SHARE_PATH"
+ sharedFolder1.readAccess = "TRUE"
+ sharedFolder1.writeAccess = "FALSE"
+ sharedFolder.maxNum = "2"
+ hgfs.mapRootShare = "TRUE"
+ hgfs.linkRootShare = "TRUE"
+ HEREEND
+}
+
+setup_isolation() {
+ # Settings for isolation tools (drag & drop, copy & paste, etc...)
+ cat >> "${TMPCONFIG}" <<-HEREEND
+ isolation.tools.hgfs.disable = "$HGFS_DISABLED"
+ isolation.tools.dnd.disable = "FALSE"
+ isolation.tools.copy.enable = "TRUE"
+ isolation.tools.paste.enabled = "TRUE"
+ HEREEND
+}
+
+# Serial, parallel: Empty, nothing is being currently set. TODO later.
+
+setup_graphics() {
+ # Graphics, GPU: 3D will be enabled (even if vmware doesn't support the chip) if we whitelisted it.
+ if isset SLX_VMWARE_3D; then
+ writelog "FORCE3D set - overriding 3D in vmx file."
+ echo 'mks.gl.allowBlacklistedDrivers = "TRUE"' >> "${TMPCONFIG}"
+ # We override... play safe and cap the hwVersion to 10, since some i915 chips goofed up with 12
+ # Investigate if we might have to do this in other cases where we don't override
+ if grep -qi '^mks.enable3d.*true' "${TMPCONFIG}"; then
+ vmw_cap_hw_version "10"
+ fi
+ else
+ writelog "FORCE3D not set - 3D will only work if GPU/driver is whitelisted by vmware."
+ fi
+
+ # Disable DPI scaling information passing via vmware tools
+ sed -i '/^gui.applyHostDisplayScaling/Id' "${TMPCONFIG}"
+ echo 'gui.applyHostDisplayScalingToGuest = "FALSE"' >> "${TMPCONFIG}"
+
+ # Additinal exam mode settings
+ if [ -n "$SLX_EXAM" ]; then
+ echo 'gui.restricted = "true"' >> "${TMPCONFIG}"
+ fi
+
+ # Hack resolution if we know the desired one is not in the default list of vmx_svga
+ # For now, only do it on the odd ones, as we don't know if this has any side effects
+ # This seems unnecessary on Win7 but is required on WinXP - need more research for other OSs
+ case "$RESOLUTION" in
+ 1600x900|2560x1440|2880x1800|3200x1800)
+ X=${RESOLUTION%x*}
+ Y=${RESOLUTION#*x}
+ BYTES=$(( ( ( X * Y * 4 + 65535 ) / 65536 ) * 65536 ))
+ [ "$BYTES" -lt 16777216 ] && BYTES=16777216
+ cat >> "${TMPCONFIG}" <<-EOF
+ svga.autodetect = "FALSE"
+ svga.vramSize = $BYTES
+ svga.maxWidth = $X
+ svga.maxHeight = $Y
+ EOF
+ ;;
+ esac
+
+ # Killing duplicate lines (output much nicer than sort -u):
+ awk '!a[$0]++' "${TMPCONFIG}" > "${TMPCONFIG}.tmp" && mv -f "${TMPCONFIG}.tmp" "${TMPCONFIG}"
+}
+
+finalize_hardware() {
+ # Apply $maxhardwareversion to final VMX
+ if notempty VM_HW_VERSION && [ "$VM_HW_VERSION" -gt "$maxhardwareversion" ]; then
+ writelog "Hardware version capped to $maxhardwareversion (was $VM_HW_VERSION)"
+ sed -i 's/^virtualHW\.version.*$/virtualHW.version = "'$maxhardwareversion'"/I' "${TMPCONFIG}"
+ VM_HW_VERSION="$maxhardwareversion"
+ fi
+
+ # Enable nested virtualization if not specified in remote vmx
+ if [ -e "/run/hwinfo" ] && ! grep -qi '^vhv\.enable' "${TMPCONFIG}" \
+ && grep -qE '^flags\s*:.*\b(ept|npt)\b' "/proc/cpuinfo" \
+ && [ "$VM_HW_VERSION" -ge "9" ]; then
+ . "/run/hwinfo"
+ [ "${HW_KVM}" = "ENABLED" ] && echo 'vhv.enable = "TRUE"' >> "${TMPCONFIG}"
+ fi
+
+ # Disable space check warnings
+ sed -i '/^mainMem.freeSpaceCheck/Id' "${TMPCONFIG}"
+ echo 'mainMem.freeSpaceCheck = "FALSE"' >> "${TMPCONFIG}"
+
+ # TODO: Need a way to check if supported by hardware before enabling!
+ #grep -qi '^vpmc\.enable' "${TMPCONFIG}" || echo 'vpmc.enable = "TRUE"' >> "${TMPCONFIG}"
+}
+
+
+## MAIN ##
+write_final_vmx() {
+ replace_placeholders
+ setup_ethernet
+ setup_optical_drives
+ setup_floppies
+ setup_serial
+ setup_vcpu_ram
+ setup_usb
+ [ "x$HGFS_DISABLED" = "xFALSE" ] && setup_shared_folders
+ setup_isolation
+ setup_graphics
+ finalize_hardware
+
+ # At last: Let's copy it to $VM_CONF_DIR/run-vmware.conf
+ if cp -p "${TMPCONFIG}" "${VM_RUN_FILE}"; then
+ writelog "Copied '${TMPCONFIG}' to '${VM_RUN_FILE}'"
+ else
+ writelog "Could not copy TMPDIR/IMGUUID -${TMPCONFIG}- to VM_RUN_FILE ${VM_RUN_FILE}!"
+ # cleanexit 1 # that seems not needed!
+ fi
+}
+call_post_source write_final_vmx
+
+
diff --git a/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/nvram b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/nvram
new file mode 100644
index 00000000..88074390
--- /dev/null
+++ b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/nvram
Binary files differ
diff --git a/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/run-virt.include b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/run-virt.include
new file mode 100644
index 00000000..a552038b
--- /dev/null
+++ b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/run-virt.include
@@ -0,0 +1,61 @@
+# -----------------------------------------------------------------------------
+# Copyright (c) 2009..2017 - RZ Uni Freiburg
+# Copyright (c) 2009..2017 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# run-virt.include
+# - component for vmware/player of the vmchooser plugin vmchooser-run_virt
+################################################################################
+
+# BASH_SOURCE[0] contains the file being sourced, namely this one
+declare -rg VMWARE_PLUGIN_DIR="$(dirname "${BASH_SOURCE[0]}")"
+declare -rg VMWARE_INCLUDE_DIR="${VMWARE_PLUGIN_DIR}/includes"
+
+# TODO make this part of the metadata coming from the server
+# Define which features the VMware plugin supports
+declare -rg PLUGIN_FEATURES="firewall printer usb slxfloppy sound netshares"
+
+run_plugin() {
+ # declaration of default functions and variables for vmware
+ $(safesource --exit "${VMWARE_INCLUDE_DIR}/init_core.inc")
+
+ # get information from downloaded vmx
+ $(safesource "${VMWARE_INCLUDE_DIR}/parse_vmx.inc")
+
+ # determine limitations wrt RAM and CPU count of VM
+ $(safesource "${VMWARE_INCLUDE_DIR}/determine_hardware_limitations.inc")
+
+ # create preferences file ${HOME}/.vmware/preferences
+ $(safesource "${VMWARE_INCLUDE_DIR}/create_vmhome_preferences_file.inc")
+
+ # parse the given vmx file
+ $(safesource "${VMWARE_INCLUDE_DIR}/write_final_vmx.inc")
+
+ # print summary - needs writelog() from vmchooser-run_virt
+ $(safesource "${VMWARE_INCLUDE_DIR}/log_config_summary.inc")
+
+ # For debugging
+ cp "$VM_RUN_FILE" "/tmp/vmware-last-config"
+
+ # HACK: make the mouse disappear
+ (
+ local WINDOWS="$(xdotool search --sync --name '.*VMware.*Player.*')"
+ isempty WINDOWS && writelog "Could not find any vmplayer windows."
+ for WINDOW in $WINDOWS; do
+ xdotool set_desktop_for_window $WINDOW 0 || writelog "Could not move vmplayer to desktop 0"
+ xdotool windowactivate --sync $WINDOW || writelog "Could not activate vmplayer window"
+ xdotool key --delay 2000 --clearmodifiers ctrl+g || writelog "Could not send ctrl+g to vmplayer window"
+ done
+ ) &
+
+ # HACK: using the modified version of the wrapper script
+ declare -rg VIRTCMD="/opt/openslx/bin/vmplayer"
+ declare -rg VIRTCMDOPTS="${VM_START_OPTIONS} ${VM_RUN_FILE}"
+}
diff --git a/core/modules/vmware12/data/usr/bin/vmplayer b/core/modules/vmware12/data/usr/bin/vmplayer
new file mode 120000
index 00000000..2944838d
--- /dev/null
+++ b/core/modules/vmware12/data/usr/bin/vmplayer
@@ -0,0 +1 @@
+/opt/openslx/bin/vmplayer \ No newline at end of file
diff --git a/core/modules/vmware12/data/usr/bin/vmware b/core/modules/vmware12/data/usr/bin/vmware
new file mode 120000
index 00000000..bde6f9c0
--- /dev/null
+++ b/core/modules/vmware12/data/usr/bin/vmware
@@ -0,0 +1 @@
+/opt/openslx/bin/vmware \ No newline at end of file
diff --git a/core/modules/vmware12/data/usr/share/icons/hicolor/index.theme b/core/modules/vmware12/data/usr/share/icons/hicolor/index.theme
new file mode 100644
index 00000000..5c9c50ad
--- /dev/null
+++ b/core/modules/vmware12/data/usr/share/icons/hicolor/index.theme
@@ -0,0 +1,1662 @@
+[Icon Theme]
+Name=Hicolor
+Comment=Fallback icon theme
+Hidden=true
+Directories=16x16/actions,16x16/animations,16x16/apps,16x16/categories,16x16/devices,16x16/emblems,16x16/emotes,16x16/filesystems,16x16/intl,16x16/mimetypes,16x16/places,16x16/status,16x16/stock/chart,16x16/stock/code,16x16/stock/data,16x16/stock/form,16x16/stock/image,16x16/stock/io,16x16/stock/media,16x16/stock/navigation,16x16/stock/net,16x16/stock/object,16x16/stock/table,16x16/stock/text,22x22/actions,22x22/animations,22x22/apps,22x22/categories,22x22/devices,22x22/emblems,22x22/emotes,22x22/filesystems,22x22/intl,22x22/mimetypes,22x22/places,22x22/status,22x22/stock/chart,22x22/stock/code,22x22/stock/data,22x22/stock/form,22x22/stock/image,22x22/stock/io,22x22/stock/media,22x22/stock/navigation,22x22/stock/net,22x22/stock/object,22x22/stock/table,22x22/stock/text,24x24/actions,24x24/animations,24x24/apps,24x24/categories,24x24/devices,24x24/emblems,24x24/emotes,24x24/filesystems,24x24/intl,24x24/mimetypes,24x24/places,24x24/status,24x24/stock/chart,24x24/stock/code,24x24/stock/data,24x24/stock/form,24x24/stock/image,24x24/stock/io,24x24/stock/media,24x24/stock/navigation,24x24/stock/net,24x24/stock/object,24x24/stock/table,24x24/stock/text,32x32/actions,32x32/animations,32x32/apps,32x32/categories,32x32/devices,32x32/emblems,32x32/emotes,32x32/filesystems,32x32/intl,32x32/mimetypes,32x32/places,32x32/status,32x32/stock/chart,32x32/stock/code,32x32/stock/data,32x32/stock/form,32x32/stock/image,32x32/stock/io,32x32/stock/media,32x32/stock/navigation,32x32/stock/net,32x32/stock/object,32x32/stock/table,32x32/stock/text,36x36/actions,36x36/animations,36x36/apps,36x36/categories,36x36/devices,36x36/emblems,36x36/emotes,36x36/filesystems,36x36/intl,36x36/mimetypes,36x36/places,36x36/status,36x36/stock/chart,36x36/stock/code,36x36/stock/data,36x36/stock/form,36x36/stock/image,36x36/stock/io,36x36/stock/media,36x36/stock/navigation,36x36/stock/net,36x36/stock/object,36x36/stock/table,36x36/stock/text,48x48/actions,48x48/animations,48x48/apps,48x48/categories,48x48/devices,48x48/emblems,48x48/emotes,48x48/filesystems,48x48/intl,48x48/mimetypes,48x48/places,48x48/status,48x48/stock/chart,48x48/stock/code,48x48/stock/data,48x48/stock/form,48x48/stock/image,48x48/stock/io,48x48/stock/media,48x48/stock/navigation,48x48/stock/net,48x48/stock/object,48x48/stock/table,48x48/stock/text,64x64/actions,64x64/animations,64x64/apps,64x64/categories,64x64/devices,64x64/emblems,64x64/emotes,64x64/filesystems,64x64/intl,64x64/mimetypes,64x64/places,64x64/status,64x64/stock/chart,64x64/stock/code,64x64/stock/data,64x64/stock/form,64x64/stock/image,64x64/stock/io,64x64/stock/media,64x64/stock/navigation,64x64/stock/net,64x64/stock/object,64x64/stock/table,64x64/stock/text,72x72/actions,72x72/animations,72x72/apps,72x72/categories,72x72/devices,72x72/emblems,72x72/emotes,72x72/filesystems,72x72/intl,72x72/mimetypes,72x72/places,72x72/status,72x72/stock/chart,72x72/stock/code,72x72/stock/data,72x72/stock/form,72x72/stock/image,72x72/stock/io,72x72/stock/media,72x72/stock/navigation,72x72/stock/net,72x72/stock/object,72x72/stock/table,72x72/stock/text,96x96/actions,96x96/animations,96x96/apps,96x96/categories,96x96/devices,96x96/emblems,96x96/emotes,96x96/filesystems,96x96/intl,96x96/mimetypes,96x96/places,96x96/status,96x96/stock/chart,96x96/stock/code,96x96/stock/data,96x96/stock/form,96x96/stock/image,96x96/stock/io,96x96/stock/media,96x96/stock/navigation,96x96/stock/net,96x96/stock/object,96x96/stock/table,96x96/stock/text,128x128/actions,128x128/animations,128x128/apps,128x128/categories,128x128/devices,128x128/emblems,128x128/emotes,128x128/filesystems,128x128/intl,128x128/mimetypes,128x128/places,128x128/status,128x128/stock/chart,128x128/stock/code,128x128/stock/data,128x128/stock/form,128x128/stock/image,128x128/stock/io,128x128/stock/media,128x128/stock/navigation,128x128/stock/net,128x128/stock/object,128x128/stock/table,128x128/stock/text,192x192/actions,192x192/animations,192x192/apps,192x192/categories,192x192/devices,192x192/emblems,192x192/emotes,192x192/filesystems,192x192/intl,192x192/mimetypes,192x192/places,192x192/status,192x192/stock/chart,192x192/stock/code,192x192/stock/data,192x192/stock/form,192x192/stock/image,192x192/stock/io,192x192/stock/media,192x192/stock/navigation,192x192/stock/net,192x192/stock/object,192x192/stock/table,192x192/stock/text,256x256/actions,256x256/animations,256x256/apps,256x256/categories,256x256/devices,256x256/emblems,256x256/emotes,256x256/filesystems,256x256/intl,256x256/mimetypes,256x256/places,256x256/status,256x256/stock/chart,256x256/stock/code,256x256/stock/data,256x256/stock/form,256x256/stock/image,256x256/stock/io,256x256/stock/media,256x256/stock/navigation,256x256/stock/net,256x256/stock/object,256x256/stock/table,256x256/stock/text,scalable/actions,scalable/animations,scalable/apps,scalable/categories,scalable/devices,scalable/emblems,scalable/emotes,scalable/filesystems,scalable/intl,scalable/mimetypes,scalable/places,scalable/status,scalable/stock/chart,scalable/stock/code,scalable/stock/data,scalable/stock/form,scalable/stock/image,scalable/stock/io,scalable/stock/media,scalable/stock/navigation,scalable/stock/net,scalable/stock/object,scalable/stock/table,scalable/stock/text
+
+
+[16x16/actions]
+Size=16
+Context=Actions
+Type=Threshold
+
+[16x16/animations]
+Size=16
+Context=Animations
+Type=Threshold
+
+[16x16/apps]
+Size=16
+Context=Applications
+Type=Threshold
+
+[16x16/categories]
+Size=16
+Context=Categories
+Type=Threshold
+
+[16x16/devices]
+Size=16
+Context=Devices
+Type=Threshold
+
+[16x16/emblems]
+Size=16
+Context=Emblems
+Type=Threshold
+
+[16x16/emotes]
+Size=16
+Context=Emotes
+Type=Threshold
+
+[16x16/filesystems]
+Size=16
+Context=FileSystems
+Type=Threshold
+
+[16x16/intl]
+Size=16
+Context=International
+Type=Threshold
+
+[16x16/mimetypes]
+Size=16
+Context=MimeTypes
+Type=Threshold
+
+[16x16/places]
+Size=16
+Context=Places
+Type=Threshold
+
+[16x16/status]
+Size=16
+Context=Status
+Type=Threshold
+
+[16x16/stock/chart]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/code]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/data]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/form]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/image]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/io]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/media]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/navigation]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/net]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/object]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/table]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/text]
+Size=16
+Context=Stock
+Type=Threshold
+
+[22x22/actions]
+Size=22
+Context=Actions
+Type=Threshold
+
+[22x22/animations]
+Size=22
+Context=Animations
+Type=Threshold
+
+[22x22/apps]
+Size=22
+Context=Applications
+Type=Fixed
+
+[22x22/categories]
+Size=22
+Context=Categories
+Type=Threshold
+
+[22x22/devices]
+Size=22
+Context=Devices
+Type=Threshold
+
+[22x22/emblems]
+Size=22
+Context=Emblems
+Type=Threshold
+
+[22x22/emotes]
+Size=22
+Context=Emotes
+Type=Threshold
+
+[22x22/filesystems]
+Size=22
+Context=FileSystems
+Type=Threshold
+
+[22x22/intl]
+Size=22
+Context=International
+Type=Threshold
+
+[22x22/mimetypes]
+Size=22
+Context=MimeTypes
+Type=Threshold
+
+[22x22/places]
+Size=22
+Context=Places
+Type=Threshold
+
+[22x22/status]
+Size=22
+Context=Status
+Type=Threshold
+
+[22x22/stock/chart]
+Size=22
+Context=Stock
+Type=Threshold
+
+[22x22/stock/code]
+Size=22
+Context=Stock
+Type=Threshold
+
+[22x22/stock/data]
+Size=22
+Context=Stock
+Type=Threshold
+
+[22x22/stock/form]
+Size=22
+Context=Stock
+Type=Threshold
+
+[22x22/stock/image]
+Size=22
+Context=Stock
+Type=Threshold
+
+[22x22/stock/io]
+Size=22
+Context=Stock
+Type=Threshold
+
+[22x22/stock/media]
+Size=22
+Context=Stock
+Type=Threshold
+
+[22x22/stock/navigation]
+Size=22
+Context=Stock
+Type=Threshold
+
+[22x22/stock/net]
+Size=22
+Context=Stock
+Type=Threshold
+
+[22x22/stock/object]
+Size=22
+Context=Stock
+Type=Threshold
+
+[22x22/stock/table]
+Size=22
+Context=Stock
+Type=Threshold
+
+[22x22/stock/text]
+Size=22
+Context=Stock
+Type=Threshold
+
+[24x24/actions]
+Size=24
+Context=Actions
+Type=Threshold
+
+[24x24/animations]
+Size=24
+Context=Animations
+Type=Threshold
+
+[24x24/apps]
+Size=24
+Context=Applications
+Type=Threshold
+
+[24x24/categories]
+Size=24
+Context=Categories
+Type=Threshold
+
+[24x24/devices]
+Size=24
+Context=Devices
+Type=Threshold
+
+[24x24/emblems]
+Size=24
+Context=Emblems
+Type=Threshold
+
+[24x24/emotes]
+Size=24
+Context=Emotes
+Type=Threshold
+
+[24x24/filesystems]
+Size=24
+Context=FileSystems
+Type=Threshold
+
+[24x24/intl]
+Size=24
+Context=International
+Type=Threshold
+
+[24x24/mimetypes]
+Size=24
+Context=MimeTypes
+Type=Threshold
+
+[24x24/places]
+Size=24
+Context=Places
+Type=Threshold
+
+[24x24/status]
+Size=24
+Context=Status
+Type=Threshold
+
+[24x24/stock/chart]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/code]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/data]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/form]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/image]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/io]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/media]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/navigation]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/net]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/object]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/table]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/text]
+Size=24
+Context=Stock
+Type=Threshold
+
+[32x32/actions]
+Size=32
+Context=Actions
+Type=Threshold
+
+[32x32/animations]
+Size=32
+Context=Animations
+Type=Threshold
+
+[32x32/apps]
+Size=32
+Context=Applications
+Type=Threshold
+
+[32x32/categories]
+Size=32
+Context=Categories
+Type=Threshold
+
+[32x32/devices]
+Size=32
+Context=Devices
+Type=Threshold
+
+[32x32/emblems]
+Size=32
+Context=Emblems
+Type=Threshold
+
+[32x32/emotes]
+Size=32
+Context=Emotes
+Type=Threshold
+
+[32x32/filesystems]
+Size=32
+Context=FileSystems
+Type=Threshold
+
+[32x32/intl]
+Size=32
+Context=International
+Type=Threshold
+
+[32x32/mimetypes]
+Size=32
+Context=MimeTypes
+Type=Threshold
+
+[32x32/places]
+Size=32
+Context=Places
+Type=Threshold
+
+[32x32/status]
+Size=32
+Context=Status
+Type=Threshold
+
+[32x32/stock/chart]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/code]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/data]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/form]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/image]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/io]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/media]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/navigation]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/net]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/object]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/table]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/text]
+Size=32
+Context=Stock
+Type=Threshold
+
+[36x36/actions]
+Size=36
+Context=Actions
+Type=Threshold
+
+[36x36/animations]
+Size=36
+Context=Animations
+Type=Threshold
+
+[36x36/apps]
+Size=36
+Context=Applications
+Type=Threshold
+
+[36x36/categories]
+Size=36
+Context=Categories
+Type=Threshold
+
+[36x36/devices]
+Size=36
+Context=Devices
+Type=Threshold
+
+[36x36/emblems]
+Size=36
+Context=Emblems
+Type=Threshold
+
+[36x36/emotes]
+Size=36
+Context=Emotes
+Type=Threshold
+
+[36x36/filesystems]
+Size=36
+Context=FileSystems
+Type=Threshold
+
+[36x36/intl]
+Size=36
+Context=International
+Type=Threshold
+
+[36x36/mimetypes]
+Size=36
+Context=MimeTypes
+Type=Threshold
+
+[36x36/places]
+Size=36
+Context=Places
+Type=Threshold
+
+[36x36/status]
+Size=36
+Context=Status
+Type=Threshold
+
+[36x36/stock/chart]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/code]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/data]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/form]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/image]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/io]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/media]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/navigation]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/net]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/object]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/table]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/text]
+Size=36
+Context=Stock
+Type=Threshold
+
+[48x48/actions]
+Size=48
+Context=Actions
+Type=Threshold
+
+[48x48/animations]
+Size=48
+Context=Animations
+Type=Threshold
+
+[48x48/apps]
+Size=48
+Context=Applications
+Type=Threshold
+
+[48x48/categories]
+Size=48
+Context=Categories
+Type=Threshold
+
+[48x48/devices]
+Size=48
+Context=Devices
+Type=Threshold
+
+[48x48/emblems]
+Size=48
+Context=Emblems
+Type=Threshold
+
+[48x48/emotes]
+Size=48
+Context=Emotes
+Type=Threshold
+
+[48x48/filesystems]
+Size=48
+Context=FileSystems
+Type=Threshold
+
+[48x48/intl]
+Size=48
+Context=International
+Type=Threshold
+
+[48x48/mimetypes]
+Size=48
+Context=MimeTypes
+Type=Threshold
+
+[48x48/places]
+Size=48
+Context=Places
+Type=Threshold
+
+[48x48/status]
+Size=48
+Context=Status
+Type=Threshold
+
+[48x48/stock/chart]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/code]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/data]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/form]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/image]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/io]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/media]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/navigation]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/net]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/object]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/table]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/text]
+Size=48
+Context=Stock
+Type=Threshold
+
+[64x64/actions]
+Size=64
+Context=Actions
+Type=Threshold
+
+[64x64/animations]
+Size=64
+Context=Animations
+Type=Threshold
+
+[64x64/apps]
+Size=64
+Context=Applications
+Type=Threshold
+
+[64x64/categories]
+Size=64
+Context=Categories
+Type=Threshold
+
+[64x64/devices]
+Size=64
+Context=Devices
+Type=Threshold
+
+[64x64/emblems]
+Size=64
+Context=Emblems
+Type=Threshold
+
+[64x64/emotes]
+Size=64
+Context=Emotes
+Type=Threshold
+
+[64x64/filesystems]
+Size=64
+Context=FileSystems
+Type=Threshold
+
+[64x64/intl]
+Size=64
+Context=International
+Type=Threshold
+
+[64x64/mimetypes]
+Size=64
+Context=MimeTypes
+Type=Threshold
+
+[64x64/places]
+Size=64
+Context=Places
+Type=Threshold
+
+[64x64/status]
+Size=64
+Context=Status
+Type=Threshold
+
+[64x64/stock/chart]
+Size=64
+Context=Stock
+Type=Threshold
+
+[64x64/stock/code]
+Size=64
+Context=Stock
+Type=Threshold
+
+[64x64/stock/data]
+Size=64
+Context=Stock
+Type=Threshold
+
+[64x64/stock/form]
+Size=64
+Context=Stock
+Type=Threshold
+
+[64x64/stock/image]
+Size=64
+Context=Stock
+Type=Threshold
+
+[64x64/stock/io]
+Size=64
+Context=Stock
+Type=Threshold
+
+[64x64/stock/media]
+Size=64
+Context=Stock
+Type=Threshold
+
+[64x64/stock/navigation]
+Size=64
+Context=Stock
+Type=Threshold
+
+[64x64/stock/net]
+Size=64
+Context=Stock
+Type=Threshold
+
+[64x64/stock/object]
+Size=64
+Context=Stock
+Type=Threshold
+
+[64x64/stock/table]
+Size=64
+Context=Stock
+Type=Threshold
+
+[64x64/stock/text]
+Size=64
+Context=Stock
+Type=Threshold
+[72x72/actions]
+Size=72
+Context=Actions
+Type=Threshold
+
+[72x72/animations]
+Size=72
+Context=Animations
+Type=Threshold
+
+[72x72/apps]
+Size=72
+Context=Applications
+Type=Threshold
+
+[72x72/categories]
+Size=72
+Context=Categories
+Type=Threshold
+
+[72x72/devices]
+Size=72
+Context=Devices
+Type=Threshold
+
+[72x72/emblems]
+Size=72
+Context=Emblems
+Type=Threshold
+
+[72x72/emotes]
+Size=72
+Context=Emotes
+Type=Threshold
+
+[72x72/filesystems]
+Size=72
+Context=FileSystems
+Type=Threshold
+
+[72x72/intl]
+Size=72
+Context=International
+Type=Threshold
+
+[72x72/mimetypes]
+Size=72
+Context=MimeTypes
+Type=Threshold
+
+[72x72/places]
+Size=72
+Context=Places
+Type=Threshold
+
+[72x72/status]
+Size=72
+Context=Status
+Type=Threshold
+
+[72x72/stock/chart]
+Size=72
+Context=Stock
+Type=Threshold
+
+[72x72/stock/code]
+Size=72
+Context=Stock
+Type=Threshold
+
+[72x72/stock/data]
+Size=72
+Context=Stock
+Type=Threshold
+
+[72x72/stock/form]
+Size=72
+Context=Stock
+Type=Threshold
+
+[72x72/stock/image]
+Size=72
+Context=Stock
+Type=Threshold
+
+[72x72/stock/io]
+Size=72
+Context=Stock
+Type=Threshold
+
+[72x72/stock/media]
+Size=72
+Context=Stock
+Type=Threshold
+
+[72x72/stock/navigation]
+Size=72
+Context=Stock
+Type=Threshold
+
+[72x72/stock/net]
+Size=72
+Context=Stock
+Type=Threshold
+
+[72x72/stock/object]
+Size=72
+Context=Stock
+Type=Threshold
+
+[72x72/stock/table]
+Size=72
+Context=Stock
+Type=Threshold
+
+[72x72/stock/text]
+Size=72
+Context=Stock
+Type=Threshold
+
+[96x96/actions]
+Size=96
+Context=Actions
+Type=Threshold
+
+[96x96/animations]
+Size=96
+Context=Animations
+Type=Threshold
+
+[96x96/apps]
+Size=96
+Context=Applications
+Type=Threshold
+
+[96x96/categories]
+Size=96
+Context=Categories
+Type=Threshold
+
+[96x96/devices]
+Size=96
+Context=Devices
+Type=Threshold
+
+[96x96/emblems]
+Size=96
+Context=Emblems
+Type=Threshold
+
+[96x96/emotes]
+Size=96
+Context=Emotes
+Type=Threshold
+
+[96x96/filesystems]
+Size=96
+Context=FileSystems
+Type=Threshold
+
+[96x96/intl]
+Size=96
+Context=International
+Type=Threshold
+
+[96x96/mimetypes]
+Size=96
+Context=MimeTypes
+Type=Threshold
+
+[96x96/places]
+Size=96
+Context=Places
+Type=Threshold
+
+[96x96/status]
+Size=96
+Context=Status
+Type=Threshold
+
+[96x96/stock/chart]
+Size=96
+Context=Stock
+Type=Threshold
+
+[96x96/stock/code]
+Size=96
+Context=Stock
+Type=Threshold
+
+[96x96/stock/data]
+Size=96
+Context=Stock
+Type=Threshold
+
+[96x96/stock/form]
+Size=96
+Context=Stock
+Type=Threshold
+
+[96x96/stock/image]
+Size=96
+Context=Stock
+Type=Threshold
+
+[96x96/stock/io]
+Size=96
+Context=Stock
+Type=Threshold
+
+[96x96/stock/media]
+Size=96
+Context=Stock
+Type=Threshold
+
+[96x96/stock/navigation]
+Size=96
+Context=Stock
+Type=Threshold
+
+[96x96/stock/net]
+Size=96
+Context=Stock
+Type=Threshold
+
+[96x96/stock/object]
+Size=96
+Context=Stock
+Type=Threshold
+
+[96x96/stock/table]
+Size=96
+Context=Stock
+Type=Threshold
+
+[96x96/stock/text]
+Size=96
+Context=Stock
+Type=Threshold
+
+[128x128/actions]
+Size=128
+Context=Actions
+Type=Threshold
+
+[128x128/animations]
+Size=128
+Context=Animations
+Type=Threshold
+
+[128x128/apps]
+Size=128
+Context=Applications
+Type=Threshold
+
+[128x128/categories]
+Size=128
+Context=Categories
+Type=Threshold
+
+[128x128/devices]
+Size=128
+Context=Devices
+Type=Threshold
+
+[128x128/emblems]
+Size=128
+Context=Emblems
+Type=Threshold
+
+[128x128/emotes]
+Size=128
+Context=Emotes
+Type=Threshold
+
+[128x128/filesystems]
+Size=128
+Context=FileSystems
+Type=Threshold
+
+[128x128/intl]
+Size=128
+Context=International
+Type=Threshold
+
+[128x128/mimetypes]
+Size=128
+Context=MimeTypes
+Type=Threshold
+
+[128x128/places]
+Size=128
+Context=Places
+Type=Threshold
+
+[128x128/status]
+Size=128
+Context=Status
+Type=Threshold
+
+[128x128/stock/chart]
+Size=128
+Context=Stock
+Type=Threshold
+
+[128x128/stock/code]
+Size=128
+Context=Stock
+Type=Threshold
+
+[128x128/stock/data]
+Size=128
+Context=Stock
+Type=Threshold
+
+[128x128/stock/form]
+Size=128
+Context=Stock
+Type=Threshold
+
+[128x128/stock/image]
+Size=128
+Context=Stock
+Type=Threshold
+
+[128x128/stock/io]
+Size=128
+Context=Stock
+Type=Threshold
+
+[128x128/stock/media]
+Size=128
+Context=Stock
+Type=Threshold
+
+[128x128/stock/navigation]
+Size=128
+Context=Stock
+Type=Threshold
+
+[128x128/stock/net]
+Size=128
+Context=Stock
+Type=Threshold
+
+[128x128/stock/object]
+Size=128
+Context=Stock
+Type=Threshold
+
+[128x128/stock/table]
+Size=128
+Context=Stock
+Type=Threshold
+
+[128x128/stock/text]
+Size=128
+Context=Stock
+Type=Threshold
+
+[192x192/actions]
+Size=192
+Context=Actions
+Type=Threshold
+
+[192x192/animations]
+Size=192
+Context=Animations
+Type=Threshold
+
+[192x192/apps]
+Size=192
+Context=Applications
+Type=Threshold
+
+[192x192/categories]
+Size=192
+Context=Categories
+Type=Threshold
+
+[192x192/devices]
+Size=192
+Context=Devices
+Type=Threshold
+
+[192x192/emblems]
+Size=192
+Context=Emblems
+Type=Threshold
+
+[192x192/emotes]
+Size=192
+Context=Emotes
+Type=Threshold
+
+[192x192/filesystems]
+Size=192
+Context=FileSystems
+Type=Threshold
+
+[192x192/intl]
+Size=192
+Context=International
+Type=Threshold
+
+[192x192/mimetypes]
+Size=192
+Context=MimeTypes
+Type=Threshold
+
+[192x192/places]
+Size=192
+Context=Places
+Type=Threshold
+
+[192x192/status]
+Size=192
+Context=Status
+Type=Threshold
+
+[192x192/stock/chart]
+Size=192
+Context=Stock
+Type=Threshold
+
+[192x192/stock/code]
+Size=192
+Context=Stock
+Type=Threshold
+
+[192x192/stock/data]
+Size=192
+Context=Stock
+Type=Threshold
+
+[192x192/stock/form]
+Size=192
+Context=Stock
+Type=Threshold
+
+[192x192/stock/image]
+Size=192
+Context=Stock
+Type=Threshold
+
+[192x192/stock/io]
+Size=192
+Context=Stock
+Type=Threshold
+
+[192x192/stock/media]
+Size=192
+Context=Stock
+Type=Threshold
+
+[192x192/stock/navigation]
+Size=192
+Context=Stock
+Type=Threshold
+
+[192x192/stock/net]
+Size=192
+Context=Stock
+Type=Threshold
+
+[192x192/stock/object]
+Size=192
+Context=Stock
+Type=Threshold
+
+[192x192/stock/table]
+Size=192
+Context=Stock
+Type=Threshold
+
+[192x192/stock/text]
+Size=192
+Context=Stock
+Type=Threshold
+
+[256x256/actions]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Actions
+Type=Scalable
+
+[256x256/animations]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Animations
+Type=Scalable
+
+[256x256/apps]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Applications
+Type=Scalable
+
+[256x256/categories]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Categories
+Type=Scalable
+
+[256x256/devices]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Devices
+Type=Scalable
+
+[256x256/emblems]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Emblems
+Type=Scalable
+
+[256x256/emotes]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Emotes
+Type=Scalable
+
+[256x256/filesystems]
+MinSize=64
+Size=256
+MaxSize=256
+Context=FileSystems
+Type=Scalable
+
+[256x256/intl]
+MinSize=64
+Size=256
+MaxSize=256
+Context=International
+Type=Scalable
+
+[256x256/mimetypes]
+MinSize=64
+Size=256
+MaxSize=256
+Context=MimeTypes
+Type=Scalable
+
+[256x256/places]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Places
+Type=Scalable
+
+[256x256/status]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Status
+Type=Scalable
+
+[256x256/stock/chart]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[256x256/stock/code]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[256x256/stock/data]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[256x256/stock/form]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[256x256/stock/image]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[256x256/stock/io]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[256x256/stock/media]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[256x256/stock/navigation]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[256x256/stock/net]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[256x256/stock/object]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[256x256/stock/table]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[256x256/stock/text]
+MinSize=64
+Size=256
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[scalable/actions]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Actions
+Type=Scalable
+
+[scalable/animations]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Animations
+Type=Scalable
+
+[scalable/apps]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Applications
+Type=Scalable
+
+[scalable/categories]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Categories
+Type=Scalable
+
+[scalable/devices]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Devices
+Type=Scalable
+
+[scalable/emblems]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Emblems
+Type=Scalable
+
+[scalable/emotes]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Emotes
+Type=Scalable
+
+[scalable/filesystems]
+MinSize=1
+Size=128
+MaxSize=256
+Context=FileSystems
+Type=Scalable
+
+[scalable/intl]
+MinSize=1
+Size=128
+MaxSize=256
+Context=International
+Type=Scalable
+
+[scalable/mimetypes]
+MinSize=1
+Size=128
+MaxSize=256
+Context=MimeTypes
+Type=Scalable
+
+[scalable/places]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Places
+Type=Scalable
+
+[scalable/status]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Status
+Type=Scalable
+
+[scalable/stock/chart]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[scalable/stock/code]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[scalable/stock/data]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[scalable/stock/form]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[scalable/stock/image]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[scalable/stock/io]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[scalable/stock/media]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[scalable/stock/navigation]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[scalable/stock/net]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[scalable/stock/object]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[scalable/stock/table]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Stock
+Type=Scalable
+
+[scalable/stock/text]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Stock
+Type=Scalable
+
diff --git a/core/modules/vmware12/module.build b/core/modules/vmware12/module.build
new file mode 100644
index 00000000..a89bdb0c
--- /dev/null
+++ b/core/modules/vmware12/module.build
@@ -0,0 +1,211 @@
+#!/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..."
+ mkdir -p "${MODULE_BUILD_DIR}/bin"
+ cat > "${MODULE_BUILD_DIR}/bin/gccw" <<-EOF
+ #!/bin/sh
+ if [ "x\$1" = "x--version" ]; then
+ cat <<-FOO
+ gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ FOO
+ elif [ "x\$1" = "x-v" ]; then
+ cat >&2 <<-FOO
+ Using built-in specs.
+ COLLECT_GCC=gcc
+ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
+ Target: x86_64-linux-gnu
+ Configured with: ../src/configure -v --with-pkgversion='Ubuntu 6.3.0-12ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+ Thread model: posix
+ gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2)
+ FOO
+ elif [ "x\$1" = "x-dumpversion" ]; then
+ echo "4.8"
+ else
+ echo "\$@" > "/tmp/gcc-args.\$\$"
+ exec gcc "\$@"
+ fi
+ exit 0
+ EOF
+ chmod +x "${MODULE_BUILD_DIR}/bin/gccw"
+ 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
+ export LD_LIBRARY_PATH=/usr/lib/vmware/lib/libglibmm-2.4.so.1/:/usr/lib/x86_64-linux-gnu/gtk-2.0/modules/:\$LD_LIBRARY_PATH
+ vmware-modconfig --console --build-mod -k "${TARGET_KERNEL_LONG}" vmnet /bin/gccw "${KERNEL_HEADERS_DIR}/include" vmplayer vmnet || perror "vmnet build failed"
+ vmware-modconfig --console --build-mod -k "${TARGET_KERNEL_LONG}" vmmon /bin/gccw "${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/vmware12/module.conf b/core/modules/vmware12/module.conf
new file mode 100644
index 00000000..89a85db2
--- /dev/null
+++ b/core/modules/vmware12/module.conf
@@ -0,0 +1,70 @@
+#!/bin/bash
+REQUIRED_VERSION="12.5.7"
+REQUIRED_TYPE="workstation"
+REQUIRED_MODULES="kernel"
+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/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="
+ /var/lib/vmware
+ /etc/vmw*
+ /etc/rc?.d/???vmware*
+ /etc/rc0.d/K06vmware-workstation-server
+ /etc/pam.d/vmware-authd
+ /etc/rc3.d/S25vmamqpd
+ /etc/xdg/menus/applications-merged
+ /etc/init.d/vmamqpd
+ /etc/init.d/vmware*
+ /etc/thnuclnt
+ /etc/cups/thnuclnt.convs
+ /etc/cups/thnuclnt.types
+ /etc/modprobe.d/vmware-fuse.conf
+ /lib/modules/*-generic/misc/vmnet.ko
+ /lib/modules/*-generic/misc/vmmon.ko
+ /usr/share/mime/packages/vmware-player.xml
+ /usr/share/applications/vmware*
+ /usr/share/desktop-directories/vmware-ace-vms.directory
+ /usr/share/man/man1/vmware.1.gz
+ /usr/share/doc/vmware*
+ /usr/share/icons/hicolor/*/mimetypes/application-certificate.png
+ /usr/share/icons/hicolor/*/apps/vmware*
+ /usr/share/icons/hicolor/*/mimetypes/*vmware*
+ /usr/bin/vmnet-dhcpd
+ /usr/bin/ovftool
+ /usr/bin/vmrun
+ /usr/bin/vmware-wssc-adminTool
+ /usr/bin/vmnet-bridge
+ /usr/bin/vmplayer
+ /usr/bin/vmnet-sniffer
+ /usr/bin/vmss2core
+ /usr/bin/vm-support
+ /usr/bin/vmnet-natd
+ /usr/bin/vmnet-netifup
+ /usr/bin/vmware*
+ /usr/include/vmware-vix
+ /usr/lib/libvixAllProducts.so
+ /usr/lib/cups/filter/thnucups
+ /usr/lib/diskLibWrapper.so
+ /usr/lib/vmware*
+ /usr/sbin/vmware*
+"
diff --git a/core/modules/vmware12/module.conf.ubuntu b/core/modules/vmware12/module.conf.ubuntu
new file mode 100644
index 00000000..09b01ee9
--- /dev/null
+++ b/core/modules/vmware12/module.conf.ubuntu
@@ -0,0 +1,137 @@
+#!/bin/bash
+REQUIRED_VMWARE_DELETIONS="
+ /var/lib/vmware
+ /etc/vmware-vix
+ /etc/rc0.d/K08vmware
+ /etc/rc0.d/K06vmware-workstation-server
+ /etc/rc0.d/K06vmamqpd
+ /etc/pam.d/vmware-authd
+ /etc/rc3.d/S19vmware
+ /etc/rc3.d/S55vmware-workstation-server
+ /etc/rc3.d/S25vmamqpd
+ /etc/rc3.d/K08vmware-USBArbitrator
+ /etc/rc3.d/S50vmware-USBArbitrator
+ /etc/rc5.d/K08vmware-USBArbitrator
+ /etc/rc5.d/S50vmware-USBArbitrator
+ /etc/rc2.d/S19vmware
+ /etc/rc2.d/S55vmware-workstation-server
+ /etc/rc2.d/S25vmamqpd
+ /etc/rc2.d/K08vmware-USBArbitrator
+ /etc/rc2.d/S50vmware-USBArbitrator
+ /etc/xdg/menus/applications-merged
+ /etc/rc6.d/K08vmware
+ /etc/rc6.d/K06vmware-workstation-server
+ /etc/rc6.d/K06vmamqpd
+ /etc/rc4.d/S19vmware
+ /etc/rc4.d/S55vmware-workstation-server
+ /etc/rc4.d/S25vmamqpd
+ /etc/init.d/vmamqpd
+ /etc/init.d/vmware-USBArbitrator
+ /etc/init.d/vmware-workstation-server
+ /etc/init.d/vmware
+ /etc/thnuclnt
+ /etc/vmware-installer
+ /etc/cups/thnuclnt.convs
+ /etc/cups/thnuclnt.types
+ /etc/vmware/netmap.conf
+ /etc/vmware/icu
+ /etc/vmware/hostd
+ /etc/vmware/installer.sh
+ /etc/vmware/bootstrap
+ /etc/vmware/ssl
+ /etc/vmware/config
+ /etc/vmware/locations
+ /etc/modprobe.d/vmware-fuse.conf
+ /lib/modules/3.11.0-13-generic/misc/vmnet.ko
+ /lib/modules/3.11.0-13-generic/misc/vmmon.ko
+ /usr/share/mime/packages/vmware-player.xml
+ /usr/share/applications/vmware-workstation.desktop
+ /usr/share/applications/vmware-player.desktop
+ /usr/share/applications/vmware-netcfg.desktop
+ /usr/share/desktop-directories/vmware-ace-vms.directory
+ /usr/share/man/man1/vmware.1.gz
+ /usr/share/doc/vmware-vix
+ /usr/share/doc/vmware-workstation
+ /usr/share/doc/vmware-player
+ /usr/share/icons/hicolor/32x32/mimetypes/application-certificate.png
+ /usr/share/icons/hicolor/32x32/mimetypes/application-x-vmware-easter-egg.png
+ /usr/share/icons/hicolor/32x32/mimetypes/application-x-vmware-team.png
+ /usr/share/icons/hicolor/32x32/mimetypes/application-x-vmware-vm-legacy.png
+ /usr/share/icons/hicolor/32x32/mimetypes/application-x-vmware-vm-clone.png
+ /usr/share/icons/hicolor/32x32/mimetypes/application-x-vmware-vm.png
+ /usr/share/icons/hicolor/32x32/apps/vmware-player.png
+ /usr/share/icons/hicolor/32x32/apps/vmware-workstation.png
+ /usr/share/icons/hicolor/48x48/mimetypes/application-x-vmware-vmfoundry.png
+ /usr/share/icons/hicolor/48x48/mimetypes/application-x-vmware-vmdisk.png
+ /usr/share/icons/hicolor/48x48/mimetypes/application-x-vmware-easter-egg.png
+ /usr/share/icons/hicolor/48x48/mimetypes/application-x-vmware-team.png
+ /usr/share/icons/hicolor/48x48/mimetypes/application-x-vmware-vm-legacy.png
+ /usr/share/icons/hicolor/48x48/mimetypes/application-x-vmware-vm-clone.png
+ /usr/share/icons/hicolor/48x48/mimetypes/application-x-vmware-snapshot.png
+ /usr/share/icons/hicolor/48x48/mimetypes/application-x-vmware-vm.png
+ /usr/share/icons/hicolor/48x48/apps/vmware-player.png
+ /usr/share/icons/hicolor/48x48/apps/vmware-workstation.png
+ /usr/share/icons/hicolor/scalable/mimetypes/application-x-vmware-easter-egg.svg
+ /usr/share/icons/hicolor/scalable/mimetypes/application-x-vmware-team.svg
+ /usr/share/icons/hicolor/scalable/mimetypes/application-x-vmware-vm-clone.svg
+ /usr/share/icons/hicolor/scalable/mimetypes/application-x-vmware-snapshot.svg
+ /usr/share/icons/hicolor/scalable/mimetypes/application-x-vmware-vm-legacy.svg
+ /usr/share/icons/hicolor/scalable/mimetypes/application-x-vmware-vmfoundry.svg
+ /usr/share/icons/hicolor/scalable/mimetypes/application-certificate.svg
+ /usr/share/icons/hicolor/scalable/mimetypes/application-x-vmware-vm.svg
+ /usr/share/icons/hicolor/scalable/apps/vmware-workstation.svg
+ /usr/share/icons/hicolor/16x16/mimetypes/application-certificate.png
+ /usr/share/icons/hicolor/16x16/mimetypes/application-x-vmware-easter-egg.png
+ /usr/share/icons/hicolor/16x16/mimetypes/application-x-vmware-team.png
+ /usr/share/icons/hicolor/16x16/mimetypes/application-x-vmware-vm-legacy.png
+ /usr/share/icons/hicolor/16x16/mimetypes/application-x-vmware-vm-clone.png
+ /usr/share/icons/hicolor/16x16/mimetypes/application-x-vmware-vm.png
+ /usr/share/icons/hicolor/16x16/apps/vmware-player.png
+ /usr/share/icons/hicolor/16x16/apps/vmware-netcfg.png
+ /usr/share/icons/hicolor/16x16/apps/vmware-workstation.png
+ /usr/share/icons/hicolor/24x24/mimetypes
+ /usr/share/icons/hicolor/24x24/apps/vmware-player.png
+ /usr/share/icons/hicolor/24x24/apps/vmware-netcfg.png
+ /usr/share/icons/hicolor/24x24/apps/vmware-workstation.png
+ /usr/bin/vmnet-dhcpd
+ /usr/bin/vmware-unity-helper
+ /usr/bin/ovftool
+ /usr/bin/vmrun
+ /usr/bin/vmware-vim-cmd
+ /usr/bin/vmware-wssc-adminTool
+ /usr/bin/vmnet-bridge
+ /usr/bin/vmplayer
+ /usr/bin/vmnet-sniffer
+ /usr/bin/vmss2core
+ /usr/bin/vmware-usbarbitrator
+ /usr/bin/vmware-netcfg
+ /usr/bin/vmware-modconfig
+ /usr/bin/vmware-tray
+ /usr/bin/vmware-mount
+ /usr/bin/vm-support
+ /usr/bin/vmware-vdiskmanager
+ /usr/bin/vmware-license-enter.sh
+ /usr/bin/vmware-license-check.sh
+ /usr/bin/vmnet-natd
+ /usr/bin/vmware-uninstall
+ /usr/bin/vmware-vprobe
+ /usr/bin/vmware-fuseUI
+ /usr/bin/vmware-installer
+ /usr/bin/vmware-ping
+ /usr/bin/vmware-gksu
+ /usr/bin/vmnet-netifup
+ /usr/bin/vmware-networks
+ /usr/bin/vmware
+ /usr/bin/vmware-hostd
+ /usr/include/vmware-vix
+ /usr/lib/vmware-vix
+ /usr/lib/vmware-ovftool
+ /usr/lib/vmware-installer
+ /usr/lib/libvixAllProducts.so
+ /usr/lib/cups/filter/thnucups
+ /usr/lib/diskLibWrapper.so
+ /usr/lib/vmware
+ /usr/local/share/applications
+ /usr/sbin/vmware-authdlauncher
+ /usr/sbin/vmware-authd
+"
diff --git a/core/modules/vmware12/patches/vmblock__3.0-3.9__1.0-100.0.patch b/core/modules/vmware12/patches/vmblock__3.0-3.9__1.0-100.0.patch
new file mode 100644
index 00000000..89b3a7c6
--- /dev/null
+++ b/core/modules/vmware12/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/vmware12/patches/vmblock__3.10__1.0-100.0.patch b/core/modules/vmware12/patches/vmblock__3.10__1.0-100.0.patch
new file mode 100644
index 00000000..e54317f9
--- /dev/null
+++ b/core/modules/vmware12/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/vmware12/patches/vmblock__3.11-9.9__1.0-11.0.patch b/core/modules/vmware12/patches/vmblock__3.11-9.9__1.0-11.0.patch
new file mode 100644
index 00000000..dedb2646
--- /dev/null
+++ b/core/modules/vmware12/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/vmware12/patches/vmci__4.3-4.3__12.0.0.patch b/core/modules/vmware12/patches/vmci__4.3-4.3__12.0.0.patch
new file mode 100644
index 00000000..05dae1b7
--- /dev/null
+++ b/core/modules/vmware12/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/vmware12/patches/vmmon__4.14__12.0-14.0.patch b/core/modules/vmware12/patches/vmmon__4.14__12.0-14.0.patch
new file mode 100644
index 00000000..5278d645
--- /dev/null
+++ b/core/modules/vmware12/patches/vmmon__4.14__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/vmware12/patches/vmmon__4.3-4.3__12.0.0.patch b/core/modules/vmware12/patches/vmmon__4.3-4.3__12.0.0.patch
new file mode 100644
index 00000000..3f5a950a
--- /dev/null
+++ b/core/modules/vmware12/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/vmware12/patches/vmmon__4.9-4.9.99__12.0.0-12.5.2.patch b/core/modules/vmware12/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/vmware12/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/vmware12/patches/vmnet__3.13-3.13__1.0-10.0.2.patch b/core/modules/vmware12/patches/vmnet__3.13-3.13__1.0-10.0.2.patch
new file mode 100644
index 00000000..54607506
--- /dev/null
+++ b/core/modules/vmware12/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/vmware12/patches/vmnet__4.13-9.9__12.5-12.5.99.patch b/core/modules/vmware12/patches/vmnet__4.13-9.9__12.5-12.5.99.patch
new file mode 100644
index 00000000..c5ec7107
--- /dev/null
+++ b/core/modules/vmware12/patches/vmnet__4.13-9.9__12.5-12.5.99.patch
@@ -0,0 +1,12 @@
+--- y/bridge.c 2017-06-26 22:08:39.148034785 +1000
++++ y/bridge.c 2017-07-16 11:37:01.325802125 +1000
+@@ -636,7 +636,7 @@
+ unsigned long flags;
+ int i;
+
+- atomic_inc(&clone->users);
++ clone = skb_get(clone);
+
+ clone->dev = dev;
+ clone->protocol = eth_type_trans(clone, dev);
+
diff --git a/core/modules/vmware12/patches/vmnet__4.9-4.9.99__12.0.0-12.5.2.patch b/core/modules/vmware12/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/vmware12/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,