aboutsummaryrefslogtreecommitdiffstats
path: root/emulators
diff options
context:
space:
mode:
authorswills <swills@FreeBSD.org>2017-03-24 22:43:24 +0800
committerswills <swills@FreeBSD.org>2017-03-24 22:43:24 +0800
commit649315cb13b3de5e616c87782e2db647146d8eb6 (patch)
tree2e173648894cc4856183dd9d63dc19d472dcda7c /emulators
parent687c4fa69dba49037eab61f12430a219ad44ad52 (diff)
downloadfreebsd-ports-gnome-649315cb13b3de5e616c87782e2db647146d8eb6.tar.gz
freebsd-ports-gnome-649315cb13b3de5e616c87782e2db647146d8eb6.tar.zst
freebsd-ports-gnome-649315cb13b3de5e616c87782e2db647146d8eb6.zip
emulators/open-vm-tools: improve scripts
Make it possible to disable the rc scripts. Still default to enabled, but only when checkvm says we are in a VM. While here, improve scripts slightly. Requested by: mat Tested by: mat
Diffstat (limited to 'emulators')
-rw-r--r--emulators/open-vm-tools/Makefile5
-rw-r--r--emulators/open-vm-tools/files/vmware-guestd.in33
-rw-r--r--emulators/open-vm-tools/files/vmware-kmod.in8
-rw-r--r--emulators/open-vm-tools/pkg-plist4
4 files changed, 25 insertions, 25 deletions
diff --git a/emulators/open-vm-tools/Makefile b/emulators/open-vm-tools/Makefile
index 2e4138402bad..071e06420508 100644
--- a/emulators/open-vm-tools/Makefile
+++ b/emulators/open-vm-tools/Makefile
@@ -3,6 +3,7 @@
PORTNAME= open-vm-tools
PORTVERSION= ${RELEASE_VER}
+PORTREVISION= 1
PORTEPOCH= 2
MASTER_SITES= https://github.com/vmware/open-vm-tools/files/590760/
DISTNAME= open-vm-tools-${RELEASE_VER}-${BUILD_VER}
@@ -92,9 +93,5 @@ post-install:
${MKDIR} ${STAGEDIR}${PREFIX}/share/open-vm-tools/scripts/
${MKDIR} ${STAGEDIR}${PREFIX}/share/open-vm-tools/tests/
${MKDIR} ${STAGEDIR}${PREFIX}/etc/rc.conf.d
- ${ECHO} 'vmware_guest_vmblock_enable="yes"' > ${STAGEDIR}${PREFIX}/etc/rc.conf.d/vmware_guest_vmblock
- ${ECHO} 'vmware_guest_vmmemctl_enable="yes"' > ${STAGEDIR}${PREFIX}/etc/rc.conf.d/vmware_guest_vmmemctl
- ${ECHO} 'vmware_guest_vmxnet_enable="yes"' > ${STAGEDIR}${PREFIX}/etc/rc.conf.d/vmware_guest_vmxnet
- ${ECHO} 'vmware_guestd_enable="yes"' > ${STAGEDIR}${PREFIX}/etc/rc.conf.d/vmware_guestd
.include <bsd.port.post.mk>
diff --git a/emulators/open-vm-tools/files/vmware-guestd.in b/emulators/open-vm-tools/files/vmware-guestd.in
index 9a93701b4a5e..4d6e4fd5c9f2 100644
--- a/emulators/open-vm-tools/files/vmware-guestd.in
+++ b/emulators/open-vm-tools/files/vmware-guestd.in
@@ -4,26 +4,33 @@
#
# PROVIDE: vmware-guestd
-# REQUIRE: DAEMON netif
+# REQUIRE: FILESYSTEMS
# BEFORE: LOGIN
-. /etc/rc.subr
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# vmware_guestd_enable (bool): Set to YES by default.
+# Set it to NO to disable vmware_guestd.
-# Global
-checkvm_cmd="%%PREFIX%%/bin/vmware-checkvm > /dev/null"
+. /etc/rc.subr
-# VMware guest daemon
name="vmware_guestd"
rcvar=vmware_guestd_enable
-start_precmd="${checkvm_cmd}"
-unset start_cmd
-stop_precmd="${checkvm_cmd}"
-unset stop_cmd
+
+load_rc_config $name
+
+checkvm_cmd="%%PREFIX%%/bin/vmware-checkvm > /dev/null"
+if ${checkvm_cmd} > /dev/null ; then
+ : ${vmware_guestd_enable:="YES"}
+else
+ : ${vmware_guestd_enable:="NO"}
+fi
+
command="%%PREFIX%%/bin/vmtoolsd"
-command_args="-c %%PREFIX%%/share/vmware-tools/tools.conf -p %%PREFIX%%/lib/open-vm-tools/plugins/vmsvc"
pidfile="/var/run/${name}.pid"
+start_precmd="${checkvm_cmd}"
+stop_precmd="${checkvm_cmd}"
+command_args="--background ${pidfile} -c %%PREFIX%%/share/vmware-tools/tools.conf -p %%PREFIX%%/lib/open-vm-tools/plugins/vmsvc"
-load_rc_config $name
-[ -z "$vmware_guestd_enable" ] && vmware_guestd_enable="YES"
-[ -z "$vmware_guestd_flags" ] && vmware_guestd_flags="--background ${pidfile}"
run_rc_command "$1"
diff --git a/emulators/open-vm-tools/files/vmware-kmod.in b/emulators/open-vm-tools/files/vmware-kmod.in
index ab0d624b9bab..89b89b03e132 100644
--- a/emulators/open-vm-tools/files/vmware-kmod.in
+++ b/emulators/open-vm-tools/files/vmware-kmod.in
@@ -51,8 +51,8 @@ stop_precmd="${checkvm_cmd}"
stop_cmd=":"
load_rc_config $name
-[ -z "$vmware_guest_vmmemctl_enable" ] && vmware_guest_vmmemctl_enable="NO"
-[ -n "$vmware_guest_kmod_enable" ] && vmware_guest_vmmemctl_enable="$vmware_guest_kmod_enable"
+: ${vmware_guest_kmod_enable:="YES"}
+: ${vmware_guest_vmmemctl_enable:=$vmware_guest_kmod_enable}
run_rc_command "$1"
# VMware kernel module: vmxnet
@@ -67,7 +67,7 @@ stop_precmd="${checkvm_cmd}"
stop_cmd=":"
load_rc_config $name
-[ -z "$vmware_guest_vmxnet_enable" ] && vmware_guest_vmxnet_enable="NO"
+: ${vmware_guest_vmxnet_enable:=$vmware_guest_kmod_enable}
run_rc_command "$1"
# VMware kernel module: vmblock
@@ -82,5 +82,5 @@ stop_precmd="${checkvm_cmd}"
stop_cmd=":"
load_rc_config $name
-[ -z "$vmware_guest_vmblock_enable" ] && vmware_guest_vmblock_enable="NO"
+: ${vmware_guest_vmblock_enable:=$vmware_guest_kmod_enable}
run_rc_command "$1"
diff --git a/emulators/open-vm-tools/pkg-plist b/emulators/open-vm-tools/pkg-plist
index 3b14e7fa95df..89090aa5b46c 100644
--- a/emulators/open-vm-tools/pkg-plist
+++ b/emulators/open-vm-tools/pkg-plist
@@ -57,10 +57,6 @@ share/vmware-tools/vm-support
@rmtry share/vmware-tools/tools.conf
@rmtry etc/vmware-tools/plugins
etc/pam.d/vmtoolsd
-etc/rc.conf.d/vmware_guest_vmblock
-etc/rc.conf.d/vmware_guest_vmmemctl
-etc/rc.conf.d/vmware_guest_vmxnet
-etc/rc.conf.d/vmware_guestd
@dir %%DATADIR%%/scripts/vmware
@dir %%DATADIR%%/tests
@preunexec %%PREFIX%%/bin/vmware-rpctool 'tools.set.version 0' ; service vmware-guestd stop ; true