forked from rasa/vmware-tools-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile.sh
executable file
·38 lines (27 loc) · 955 Bytes
/
compile.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
# compile and install VMware Tools
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ ! -d vmware-tools-distrib ]]; then
echo $0: Error: Directory not found: vmware-tools-distrib >&2
exit 3
fi
if hash vmware-uninstall-tools.pl >/dev/null 2>&1; then
sudo vmware-uninstall-tools.pl
fi
if [[ -e /etc/redhat-release ]]; then
if hash yum >/dev/null 2>&1; then
sudo yum -y install gcc glibc-headers kernel-devel kernel-headers make perl
fi
fi
if [[ -e /etc/debian_version ]]; then
if hash apt-get >/dev/null 2>&1; then
sudo apt-get install -y build-essential dkms linux-headers-$(uname -r) patch perl psmisc
fi
fi
VMWARE_INSTALL_OPTIONS="--clobber-kernel-modules=pvscsi,vmblock,vmci,vmhgfs,vmmemctl,vmsync,vmxnet,vmxnet3,vsock"
if [[ -n "$1" ]]; then
VMWARE_INSTALL_OPTIONS="$1"
fi
pushd vmware-tools-distrib >/dev/null
sudo ./vmware-install.pl -d ${VMWARE_INSTALL_OPTIONS}
popd >/dev/null