diff options
author | matusita <matusita@FreeBSD.org> | 2004-03-16 23:37:28 +0800 |
---|---|---|
committer | matusita <matusita@FreeBSD.org> | 2004-03-16 23:37:28 +0800 |
commit | 5736d290b46439e9f18f54f95e0b962fd87cf615 (patch) | |
tree | 27744ebbbb20ad1a4e53c71df67ef4b7c6884bdc /emulators/vmware-guestd5 | |
parent | 469273fe4fe5c6be48f09a7c24d071b20bcf6104 (diff) | |
download | freebsd-ports-graphics-5736d290b46439e9f18f54f95e0b962fd87cf615.tar.gz freebsd-ports-graphics-5736d290b46439e9f18f54f95e0b962fd87cf615.tar.zst freebsd-ports-graphics-5736d290b46439e9f18f54f95e0b962fd87cf615.zip |
Update to 4.5.1 build 7568, with lots of cleanup.
- USE_RC_SUBR. Inspired by ports/net/dtcpclient (thanks ume-san).
Since now, loading kernel modules and/or start vmware-guestd can
be tweaked via following rc.conf variables:
* vmware_guestd_enable (default to YES)
* vmware_guest_kmod_enable (default to NO)
vmware-guest_kmod.sh is removed; both are handled by a single
shell script, vmware-guestd.sh.
- Bulid kernel module iff kernel source files are available.
This check is just a static checking of /usr/src/sys/Makefile.
It would be even better that '/usr/src' can be changed to other
place, but I believe that most user puts a source code under /usr/src,
or other places and set a symlink to there. If it hits you badly,
I'm willing to apply your patch to fix(?) it.
- If this ports is used by ports/emulators/vmware-tools4, install XFree86
server modules, vmware_drv.o and vmmouse_drv.o.
The vmware_drv.o is a (virtual) graphic chip driver. I believe that
if you have already installed XFree86 4.3.0, it should be the same
one but compiled on XFree86 4.3.99.2. I've confirmed that it should
work with XFree86 4.3.0 server.
The vmmouse_drv.o is a mouse driver, use it instead of default
mouse driver, mouse_drv.o. It works, but if my test is correct,
it doesn't support Emulate3Buttons. Use with care.
Both drivers are installed to appropriate directory, but renamed
(append '_VMware' to the filename) to avoid any conflicts to other
ports (especially ports/x11/XFree86*).
P.S.: Happy version 4.5.1, ACPI is enabled by default for FreeBSD guest OS.
Diffstat (limited to 'emulators/vmware-guestd5')
-rw-r--r-- | emulators/vmware-guestd5/Makefile | 31 | ||||
-rw-r--r-- | emulators/vmware-guestd5/files/vmware-guest_kmod.sh | 29 | ||||
-rw-r--r-- | emulators/vmware-guestd5/files/vmware-guestd.sh | 74 | ||||
-rw-r--r-- | emulators/vmware-guestd5/files/vmware-guestd.sh.in | 74 | ||||
-rw-r--r-- | emulators/vmware-guestd5/pkg-plist | 3 | ||||
-rw-r--r-- | emulators/vmware-guestd5/pkg-plist.tools | 2 |
6 files changed, 119 insertions, 94 deletions
diff --git a/emulators/vmware-guestd5/Makefile b/emulators/vmware-guestd5/Makefile index 9d129b2379b..96f7b840b77 100644 --- a/emulators/vmware-guestd5/Makefile +++ b/emulators/vmware-guestd5/Makefile @@ -24,6 +24,10 @@ IGNOREFILES= ${DISTFILES} WRKSRC= ${WRKDIR}/vmware-tools-distrib ONLY_FOR_ARCHS= i386 +USE_REINPLACE= yes +USE_RC_SUBR= yes +RC_SCRIPT= ${PREFIX}/etc/rc.d/vmware-guestd.sh +RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} .if !defined(BATCH) IS_INTERACTIVE= yes .endif @@ -35,8 +39,8 @@ NO_BUILD= yes RESTRICTED= "Not sure if we can redistribute this." NO_PACKAGE= ${RESTRICTED} -VMWARE_VER= 4.0.5 -BUILD_VER= 6030 +VMWARE_VER= 4.5.1 +BUILD_VER= 7568 MOUNT_DEV?= /dev/acd0 MOUNT_PT?= /mnt @@ -58,8 +62,10 @@ PLIST_SUB+= INSTALLXSERVER4:="" .else .if !defined(WITHOUT_VMWARE_VMMEMCTL) +.if exists(/usr/src/sys/Makefile) WITH_VMWARE_VMMEMCTL=YES .endif +.endif VMWARE_KMODDIR= ${PREFIX}/lib/vmware-tools/modules .if defined(WITH_VMWARE_VMMEMCTL) PLIST_SUB+= VMWARE_VMMEMCTL:="" @@ -77,7 +83,7 @@ fetch-list: do-fetch: @${ECHO} "" @${ECHO} "========================================================================" - @${ECHO} "Choose \"File\" -> \"Install VMware Tools...\" from the Workstation menu" + @${ECHO} "Choose \"VM\" -> \"Install VMware Tools...\" from the Workstation menu" @${ECHO} "to connect the VM's CD-ROM drive temporarily to installation CD image." @${ECHO} "========================================================================" @${ECHO} "" @@ -100,16 +106,22 @@ do-fetch: post-extract: ${UMOUNT} ${MOUNT_PT} -.if !defined(VMWARE_X_PORTS) +.if defined(WITH_VMWARE_VMMEMCTL) (cd ${WRKDIR}; ${TAR} xf ${WRKSRC}/lib/modules/source/vmmemctl.tar) .endif +post-patch: +.if defined(WITH_VMWARE_VMMEMCTL) + ${REINPLACE_CMD} -e 's|vmmemctl1.o||' ${WRKDIR}/vmmemctl-only/Makefile + ${ECHO_CMD} "OBJS=vmmemctl1.o" >> ${WRKDIR}/vmmemctl-only/Makefile +.endif + .if defined(VMWARE_X_PORTS) do-install: ${INSTALL_PROGRAM} ${WRKSRC}/bin/vmware-toolbox ${X11BASE}/bin .if ${XFREE86_VERSION} == 3 - ${INSTALL_PROGRAM} ${WRKSRC}/lib/configurator/XFree86-3/XF86_VMware ${X11BASE}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/lib/configurator/XFree86-3/XF86_VMware_4.5 ${X11BASE}/bin/XF86_VMware ${INSTALL_DATA} ${WRKSRC}/lib/configurator/XFree86-3/XF86Config ${X11BASE}/etc/XF86Config_VMware @${ECHO} "" @${ECHO} "You have installed XFree86 3.x X Server for VMware." @@ -117,6 +129,8 @@ do-install: @${ECHO} "Copy this file to /etc/XF86Config before starting X." .else ${INSTALL_DATA} ${WRKSRC}/lib/configurator/XFree86-4/XF86Config-4 ${X11BASE}/etc/XF86Config-4_VMware + ${INSTALL_DATA} ${WRKSRC}/lib/configurator/XFree86-4/4.3.x/vmware_drv.o ${X11BASE}/lib/modules/drivers/vmware_drv.o_VMware + ${INSTALL_DATA} ${WRKSRC}/lib/configurator/XFree86-4/4.2.x/vmmouse_drv.o ${X11BASE}/lib/modules/input/vmmouse_drv.o_VMware .endif -${LOCALBASE}/sbin/vmware-guestd --cmd toolinstall.end @@ -130,14 +144,13 @@ do-build: do-install: ${INSTALL_PROGRAM} ${WRKSRC}/sbin/vmware-guestd ${PREFIX}/sbin ${INSTALL_PROGRAM} ${WRKSRC}/sbin/vmware-checkvm ${PREFIX}/sbin - ${INSTALL_SCRIPT} -m 755 ${FILESDIR}/vmware-guestd.sh \ - ${PREFIX}/etc/rc.d/vmware-guestd.sh.sample .if defined(WITH_VMWARE_VMMEMCTL) ${MKDIR} ${VMWARE_KMODDIR} ${INSTALL_PROGRAM} ${WRKDIR}/vmmemctl-only/vmmemctl.ko ${VMWARE_KMODDIR} - ${INSTALL_SCRIPT} -m 755 ${FILESDIR}/vmware-guest_kmod.sh \ - ${PREFIX}/etc/rc.d/vmware-guest_kmod.sh.sample .endif + @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/vmware-guestd.sh > ${WRKDIR}/vmware-guestd.sh + @${INSTALL_SCRIPT} ${WRKDIR}/vmware-guestd.sh ${RC_SCRIPT} -${LOCALBASE}/sbin/vmware-guestd --cmd toolinstall.end .endif diff --git a/emulators/vmware-guestd5/files/vmware-guest_kmod.sh b/emulators/vmware-guestd5/files/vmware-guest_kmod.sh deleted file mode 100644 index 63470a3d07a..00000000000 --- a/emulators/vmware-guestd5/files/vmware-guest_kmod.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi - -case "$1" in -start) - exec 2>/dev/null - ulimit -c 0 - if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then - kldstat -v | grep vmmemctl >/dev/null || kldload ${PREFIX}/lib/vmware-tools/modules/vmmemctl.ko - echo -n ' vmware-guestkmod' - fi - ;; -stop) - exec 2>/dev/null - ulimit -c 0 - if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then - kldstat -v | grep vmmemctl >/dev/null && kldunload vmmemctl && echo -n ' vmware-guestkmod' - fi - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - ;; -esac - -exit 0 diff --git a/emulators/vmware-guestd5/files/vmware-guestd.sh b/emulators/vmware-guestd5/files/vmware-guestd.sh index 569be8a4121..3fda127b1fe 100644 --- a/emulators/vmware-guestd5/files/vmware-guestd.sh +++ b/emulators/vmware-guestd5/files/vmware-guestd.sh @@ -1,29 +1,49 @@ #!/bin/sh +# +# $FreeBSD$ +# -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi - -case "$1" in -start) - exec 2>/dev/null - ulimit -c 0 - if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then - ${PREFIX}/sbin/vmware-guestd & - echo -n ' vmware-guestd' - fi - ;; -stop) - exec 2>/dev/null - ulimit -c 0 - if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then - killall vmware-guestd && echo -n ' vmware-guestd' - fi - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - ;; -esac - -exit 0 +# PROVIDE: vmware-guestd +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: FreeBSD + +PREFIX=%%PREFIX%% +. %%RC_SUBR%% + +# Global +checkvm_cmd="${PREFIX}/sbin/vmware-checkvm > /dev/null" + +# Functions +vmware_guest_kmod_start() +{ + echo 'Loading vmmemctl kernel module.' + kldload ${PREFIX}/lib/vmware-tools/modules/vmmemctl.ko >/dev/null 2>&1 +} + +# VMware kernel modules +name="vmware_guest_kmod" +rcvar=`set_rcvar` +start_precmd="${checkvm_cmd}" +start_cmd="vmware_guest_kmod_start" +stop_precmd="${checkvm_cmd}" +stop_cmd=":" + +load_rc_config $name +[ -z "$vmware_guest_kmod_enable" ] && vmware_guest_kmod_enable="NO" +run_rc_command "$1" + +# VMware guest daemon +name="vmware_guestd" +rcvar=`set_rcvar` +start_precmd="${checkvm_cmd}" +unset start_cmd +stop_precmd="${checkvm_cmd}" +unset stop_cmd +command="${PREFIX}/sbin/vmware-guestd" +pidfile="/var/run/${name}.pid" + +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/vmware-guestd5/files/vmware-guestd.sh.in b/emulators/vmware-guestd5/files/vmware-guestd.sh.in index 569be8a4121..3fda127b1fe 100644 --- a/emulators/vmware-guestd5/files/vmware-guestd.sh.in +++ b/emulators/vmware-guestd5/files/vmware-guestd.sh.in @@ -1,29 +1,49 @@ #!/bin/sh +# +# $FreeBSD$ +# -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi - -case "$1" in -start) - exec 2>/dev/null - ulimit -c 0 - if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then - ${PREFIX}/sbin/vmware-guestd & - echo -n ' vmware-guestd' - fi - ;; -stop) - exec 2>/dev/null - ulimit -c 0 - if ${PREFIX}/sbin/vmware-checkvm >/dev/null; then - killall vmware-guestd && echo -n ' vmware-guestd' - fi - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - ;; -esac - -exit 0 +# PROVIDE: vmware-guestd +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: FreeBSD + +PREFIX=%%PREFIX%% +. %%RC_SUBR%% + +# Global +checkvm_cmd="${PREFIX}/sbin/vmware-checkvm > /dev/null" + +# Functions +vmware_guest_kmod_start() +{ + echo 'Loading vmmemctl kernel module.' + kldload ${PREFIX}/lib/vmware-tools/modules/vmmemctl.ko >/dev/null 2>&1 +} + +# VMware kernel modules +name="vmware_guest_kmod" +rcvar=`set_rcvar` +start_precmd="${checkvm_cmd}" +start_cmd="vmware_guest_kmod_start" +stop_precmd="${checkvm_cmd}" +stop_cmd=":" + +load_rc_config $name +[ -z "$vmware_guest_kmod_enable" ] && vmware_guest_kmod_enable="NO" +run_rc_command "$1" + +# VMware guest daemon +name="vmware_guestd" +rcvar=`set_rcvar` +start_precmd="${checkvm_cmd}" +unset start_cmd +stop_precmd="${checkvm_cmd}" +unset stop_cmd +command="${PREFIX}/sbin/vmware-guestd" +pidfile="/var/run/${name}.pid" + +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/vmware-guestd5/pkg-plist b/emulators/vmware-guestd5/pkg-plist index 858c18bd925..c27ee799e7d 100644 --- a/emulators/vmware-guestd5/pkg-plist +++ b/emulators/vmware-guestd5/pkg-plist @@ -1,7 +1,6 @@ sbin/vmware-checkvm sbin/vmware-guestd -etc/rc.d/vmware-guestd.sh.sample -%%VMWARE_VMMEMCTL:%%etc/rc.d/vmware-guest_kmod.sh.sample +etc/rc.d/vmware-guestd.sh %%VMWARE_VMMEMCTL:%%lib/vmware-tools/modules/vmmemctl.ko %%VMWARE_VMMEMCTL:%%@unexec rmdir %D/lib/vmware-tools/modules 2>/dev/null || true %%VMWARE_VMMEMCTL:%%@unexec rmdir %D/lib/vmware-tools 2>/dev/null || true diff --git a/emulators/vmware-guestd5/pkg-plist.tools b/emulators/vmware-guestd5/pkg-plist.tools index 4d614c4466f..acc0046b634 100644 --- a/emulators/vmware-guestd5/pkg-plist.tools +++ b/emulators/vmware-guestd5/pkg-plist.tools @@ -2,3 +2,5 @@ bin/vmware-toolbox %%INSTALLXSERVER3:%%bin/XF86_VMware %%INSTALLXSERVER3:%%etc/XF86Config_VMware %%INSTALLXSERVER4:%%etc/XF86Config-4_VMware +%%INSTALLXSERVER4:%%lib/modules/drivers/vmware_drv.o_VMware +%%INSTALLXSERVER4:%%lib/modules/input/vmmouse_drv.o_VMware |