diff options
author | pgollucci <pgollucci@FreeBSD.org> | 2010-09-14 11:20:16 +0800 |
---|---|---|
committer | pgollucci <pgollucci@FreeBSD.org> | 2010-09-14 11:20:16 +0800 |
commit | f989753d2ff4df03a68aed883cfba45273222214 (patch) | |
tree | a9c7ab6f38d747670634825eb5b5be9f3f30d10d /emulators | |
parent | 0288a36b403c8a8401d515dc48962954e3f48887 (diff) | |
download | freebsd-ports-graphics-f989753d2ff4df03a68aed883cfba45273222214.tar.gz freebsd-ports-graphics-f989753d2ff4df03a68aed883cfba45273222214.tar.zst freebsd-ports-graphics-f989753d2ff4df03a68aed883cfba45273222214.zip |
- add a `status` command
- make the `start` command more verbose (e.g. for debugging)
- remove (some) duplicate code
PR: ports/148068
Submitted by: Frank Wall <fw@moov.de>
Approved by: maintainer timeout (mbr; 82 days)
Diffstat (limited to 'emulators')
-rw-r--r-- | emulators/open-vm-tools/Makefile | 1 | ||||
-rw-r--r-- | emulators/open-vm-tools/files/vmware-kmod.sh.in | 65 |
2 files changed, 42 insertions, 24 deletions
diff --git a/emulators/open-vm-tools/Makefile b/emulators/open-vm-tools/Makefile index 9d7d76f409c..bed82453e33 100644 --- a/emulators/open-vm-tools/Makefile +++ b/emulators/open-vm-tools/Makefile @@ -7,6 +7,7 @@ PORTNAME= open-vm-tools PORTVERSION= ${BUILD_VER} +PORTREVISION= 1 CATEGORIES= emulators kld MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${RELEASE_DATE} DISTNAME= open-vm-tools-${RELEASE_DATE}-${BUILD_VER} diff --git a/emulators/open-vm-tools/files/vmware-kmod.sh.in b/emulators/open-vm-tools/files/vmware-kmod.sh.in index 323f804979d..433604f536d 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=":" |