-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompileKernelModules
More file actions
executable file
·51 lines (42 loc) · 1.17 KB
/
Copy pathcompileKernelModules
File metadata and controls
executable file
·51 lines (42 loc) · 1.17 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
compileVMwareDirect()
{
local readonly targetDirectory=/lib/modules/`uname -r`/misc
[[ ! -d "${targetDirectory}" ]] && mkdir -p ${targetDirectory}
cd /usr/lib/vmware/modules/source
tar -xf vmnet.tar
cd vmnet-only
make clean
make
cd ..
tar -xf vmmon.tar
cd vmmon-only
make clean
make
# Normally the ko files can also be fetched from here:
# cp vmmon-only/vmmon.ko vmnet-only/vmnet.ko ${targetDirectory}/
cp ../vmmon.o ${targetDirectory}/vmmon.ko
cp ../vmnet.o ${targetDirectory}/vmnet.ko
depmod -a
/etc/init.d/vmware restart
}
compileVMware()
{
vmware-modconfig --console --install-all
}
compileVirtualBox()
{
# As of 6.0.0 vboxdrv doesn't seem to be present anymore
# /etc/init.d/vboxdrv setup
# Use vboxconfig insstead:
/sbin/vboxconfig
}
[[ ! "$1" =~ ^vmware|vmware-direct|virtualbox|all$ ]] &&
{
echo -e "Usage:\n ${0##*/} <vmware|vmware-direct|virtualbox|all>"
exit -1
}
[[ "vmware" == "$1" ]] && compileVMware
[[ "vmware-direct" == "$1" ]] && compileVMwareDirect
[[ "virtualbox" == "$1" ]] && compileVirtualBox
[[ "all" == "$1" ]] && compileVirtualBox && compileVMware