source: build-files/ports-overlay/emulators/open-vm-tools/files/vmware-kmod.in @ 1e102bd

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since 1e102bd was 1e102bd, checked in by Kris Moore <kris@…>, 12 months ago

Add a bunch of modified ports for 10.0, so we can fix the building

  • Property mode set to 100644
File size: 2.6 KB
Line 
1#!/bin/sh
2#
3# $FreeBSD: emulators/open-vm-tools/files/vmware-kmod.in 302141 2012-08-05 23:19:36Z dougb $
4#
5
6# PROVIDE: vmware-kmod
7# REQUIRE: FILESYSTEMS
8# BEFORE: netif
9
10. /etc/rc.subr
11
12# Global
13checkvm_cmd="%%PREFIX%%/bin/vmware-checkvm > /dev/null"
14
15# Functions
16vmware_mod_load()
17{
18        echo -n "Loading $1 kernel module: "
19        kldstat -n %%PREFIX%%/lib/vmware-tools/modules/drivers/$1.ko >/dev/null 2>&1
20        if [ "$?" = "0" ]; then
21                echo "already loaded."
22        else
23                kldload %%PREFIX%%/lib/vmware-tools/modules/drivers/$1.ko >/dev/null 2>&1
24                if [ "$?" = "0" ]; then
25                        echo "done."
26                else
27                        echo "failed."
28                fi
29        fi
30}
31vmware_mod_status()
32{
33        echo -n "Checking $1 kernel module: "
34        kldstat -n %%PREFIX%%/lib/vmware-tools/modules/drivers/$1.ko >/dev/null 2>&1
35        if [ "$?" = "0" ]; then
36                echo "loaded."
37        else
38                echo "not loaded"
39        fi
40}
41
42# VMware kernel module: vmmemctl
43kernel_mod="vmmemctl"
44name="vmware_guest_${kernel_mod}"
45rcvar=vmware_guest_${kernel_mod}_enable
46extra_commands="status"
47status_cmd="vmware_mod_status ${kernel_mod}"
48start_precmd="${checkvm_cmd}"
49start_cmd="vmware_mod_load ${kernel_mod}"
50stop_precmd="${checkvm_cmd}"
51stop_cmd=":"
52
53load_rc_config $name
54[ -z "$vmware_guest_vmmemctl_enable" ] && vmware_guest_vmmemctl_enable="NO"
55[ -n "$vmware_guest_kmod_enable" ] && vmware_guest_vmmemctl_enable="$vmware_guest_kmod_enable"
56run_rc_command "$1"
57
58# VMware kernel module: vmxnet
59kernel_mod="vmxnet"
60name="vmware_guest_${kernel_mod}"
61rcvar=vmware_guest_${kernel_mod}_enable
62extra_commands="status"
63status_cmd="vmware_mod_status ${kernel_mod}"
64start_precmd="${checkvm_cmd}"
65start_cmd="vmware_mod_load ${kernel_mod}"
66stop_precmd="${checkvm_cmd}"
67stop_cmd=":"
68
69load_rc_config $name
70[ -z "$vmware_guest_vmxnet_enable" ] && vmware_guest_vmxnet_enable="NO"
71run_rc_command "$1"
72
73# VMware kernel module: vmblock
74kernel_mod="vmblock"
75name="vmware_guest_${kernel_mod}"
76rcvar=vmware_guest_${kernel_mod}_enable
77extra_commands="status"
78status_cmd="vmware_mod_status ${kernel_mod}"
79start_precmd="${checkvm_cmd}"
80start_cmd="vmware_mod_load ${kernel_mod}"
81stop_precmd="${checkvm_cmd}"
82stop_cmd=":"
83
84load_rc_config $name
85[ -z "$vmware_guest_vmblock_enable" ] && vmware_guest_vmblock_enable="NO"
86run_rc_command "$1"
87
88# VMware kernel module: vmhgfs
89kernel_mod="vmhgfs"
90name="vmware_guest_${kernel_mod}"
91rcvar=vmware_guest_${kernel_mod}_enable
92extra_commands="status"
93status_cmd="vmware_mod_status ${kernel_mod}"
94start_precmd="${checkvm_cmd}"
95start_cmd="vmware_mod_load ${kernel_mod}"
96stop_precmd="${checkvm_cmd}"
97stop_cmd=":"
98
99load_rc_config $name
100[ -z "$vmware_guest_vmhgfs_enable" ] && vmware_guest_vmhgfs_enable="NO"
101run_rc_command "$1"
Note: See TracBrowser for help on using the repository browser.