diff options
author | Philip M. Gollucci <pgollucci@FreeBSD.org> | 2010-09-14 03:20:16 +0000 |
---|---|---|
committer | Philip M. Gollucci <pgollucci@FreeBSD.org> | 2010-09-14 03:20:16 +0000 |
commit | 1b726b37e119e4e32464026699df826d2d245322 (patch) | |
tree | 96e7999e202aa613e25e5ab4f2eb110bbed957e6 /emulators/open-vm-tools/files | |
parent | 3d83509ea83c56aa0121e1616a7021aa0db8ddfd (diff) | |
download | ports-1b726b37e119e4e32464026699df826d2d245322.tar.gz ports-1b726b37e119e4e32464026699df826d2d245322.zip |
Notes
Diffstat (limited to 'emulators/open-vm-tools/files')
-rw-r--r-- | emulators/open-vm-tools/files/vmware-kmod.sh.in | 65 |
1 files changed, 41 insertions, 24 deletions
diff --git a/emulators/open-vm-tools/files/vmware-kmod.sh.in b/emulators/open-vm-tools/files/vmware-kmod.sh.in index 323f804979d7..433604f536d4 100644 --- a/emulators/open-vm-tools/files/vmware-kmod.sh.in +++ b/emulators/open-vm-tools/files/vmware-kmod.sh.in @@ -13,32 +13,40 @@ checkvm_cmd="%%PREFIX%%/bin/vmware-checkvm > /dev/null" # Functions -vmware_guest_vmmemctl_start() +vmware_mod_load() { - echo 'Loading vmmemctl kernel module.' - kldload %%PREFIX%%/lib/vmware-tools/modules/drivers/vmmemctl.ko >/dev/null 2>&1 + echo -n "Loading $1 kernel module: " + kldstat -n %%PREFIX%%/lib/vmware-tools/modules/drivers/$1.ko >/dev/null 2>&1 + if [ "$?" = "0" ]; then + echo "already loaded." + else + kldload %%PREFIX%%/lib/vmware-tools/modules/drivers/$1.ko >/dev/null 2>&1 + if [ "$?" = "0" ]; then + echo "done." + else + echo "failed." + fi + fi } -vmware_guest_vmxnet_start() +vmware_mod_status() { - echo 'Loading vmxnet kernel module.' - kldload %%PREFIX%%/lib/vmware-tools/modules/drivers/vmxnet.ko >/dev/null 2>&1 -} -vmware_guest_vmblock_start() -{ - echo 'Loading vmblock kernel module.' - kldload %%PREFIX%%/lib/vmware-tools/modules/drivers/vmblock.ko >/dev/null 2>&1 -} -vmware_guest_vmhgfs_start() -{ - echo 'Loading vmhgfs kernel module.' - kldload %%PREFIX%%/lib/vmware-tools/modules/drivers/vmhgfs.ko >/dev/null 2>&1 + echo -n "Checking $1 kernel module: " + kldstat -n %%PREFIX%%/lib/vmware-tools/modules/drivers/$1.ko >/dev/null 2>&1 + if [ "$?" = "0" ]; then + echo "loaded." + else + echo "not loaded" + fi } # VMware kernel module: vmmemctl -name="vmware_guest_vmmemctl" +kernel_mod="vmmemctl" +name="vmware_guest_${kernel_mod}" rcvar=`set_rcvar` +extra_commands="status" +status_cmd="vmware_mod_status ${kernel_mod}" start_precmd="${checkvm_cmd}" -start_cmd="vmware_guest_vmmemctl_start" +start_cmd="vmware_mod_load ${kernel_mod}" stop_precmd="${checkvm_cmd}" stop_cmd=":" @@ -48,10 +56,13 @@ load_rc_config $name run_rc_command "$1" # VMware kernel module: vmxnet -name="vmware_guest_vmxnet" +kernel_mod="vmxnet" +name="vmware_guest_${kernel_mod}" rcvar=`set_rcvar` +extra_commands="status" +status_cmd="vmware_mod_status ${kernel_mod}" start_precmd="${checkvm_cmd}" -start_cmd="vmware_guest_vmxnet_start" +start_cmd="vmware_mod_load ${kernel_mod}" stop_precmd="${checkvm_cmd}" stop_cmd=":" @@ -60,10 +71,13 @@ load_rc_config $name run_rc_command "$1" # VMware kernel module: vmblock -name="vmware_guest_vmblock" +kernel_mod="vmblock" +name="vmware_guest_${kernel_mod}" rcvar=`set_rcvar` +extra_commands="status" +status_cmd="vmware_mod_status ${kernel_mod}" start_precmd="${checkvm_cmd}" -start_cmd="vmware_guest_vmblock_start" +start_cmd="vmware_mod_load ${kernel_mod}" stop_precmd="${checkvm_cmd}" stop_cmd=":" @@ -72,10 +86,13 @@ load_rc_config $name run_rc_command "$1" # VMware kernel module: vmhgfs -name="vmware_guest_vmhgfs" +kernel_mod="vmhgfs" +name="vmware_guest_${kernel_mod}" rcvar=`set_rcvar` +extra_commands="status" +status_cmd="vmware_mod_status ${kernel_mod}" start_precmd="${checkvm_cmd}" -start_cmd="vmware_guest_vmhgfs_start" +start_cmd="vmware_mod_load ${kernel_mod}" stop_precmd="${checkvm_cmd}" stop_cmd=":" |