blob: a62f03b465e8f39174ca0cb8ae54a283fbb5f17c (
plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#!/bin/sh
# PROVIDE: vmware-kmod
# REQUIRE: FILESYSTEMS ldconfig
# BEFORE: netif
. /etc/rc.subr
# Global
checkvm_cmd="%%PREFIX%%/bin/vmware-checkvm > /dev/null"
# Functions
vmware_mod_load()
{
echo -n "Loading $1 kernel module: "
if kldstat -qn %%PREFIX%%/lib/vmware-tools/modules/drivers/$1.ko; then
echo "already loaded."
elif kldload -q %%PREFIX%%/lib/vmware-tools/modules/drivers/$1.ko; then
echo "done."
else
echo "failed."
return 1
fi
}
vmware_mod_status()
{
echo -n "Checking $1 kernel module: "
if kldstat -qn %%PREFIX%%/lib/vmware-tools/modules/drivers/$1.ko; then
echo "loaded."
else
echo "not loaded"
return 1
fi
}
# VMware kernel module: vmmemctl
kernel_mod="vmmemctl"
name="vmware_guest_${kernel_mod}"
rcvar=vmware_guest_${kernel_mod}_enable
extra_commands="status"
status_cmd="vmware_mod_status ${kernel_mod}"
start_precmd="${checkvm_cmd}"
start_cmd="vmware_mod_load ${kernel_mod}"
stop_precmd="${checkvm_cmd}"
stop_cmd=":"
load_rc_config $name
: ${vmware_guest_kmod_enable:="YES"}
: ${vmware_guest_vmmemctl_enable:=$vmware_guest_kmod_enable}
run_rc_command "$1"
# VMware kernel module: vmblock
kernel_mod="vmblock"
name="vmware_guest_${kernel_mod}"
rcvar=vmware_guest_${kernel_mod}_enable
extra_commands="status"
status_cmd="vmware_mod_status ${kernel_mod}"
start_precmd="${checkvm_cmd}"
start_cmd="vmware_mod_load ${kernel_mod}"
stop_precmd="${checkvm_cmd}"
stop_cmd=":"
load_rc_config $name
: ${vmware_guest_vmblock_enable:=$vmware_guest_kmod_enable}
run_rc_command "$1"
|