summaryrefslogtreecommitdiff
path: root/emulators/vmware3
diff options
context:
space:
mode:
authorMike Silbersack <silby@FreeBSD.org>2004-03-13 21:29:24 +0000
committerMike Silbersack <silby@FreeBSD.org>2004-03-13 21:29:24 +0000
commitcf1d11951308fb8f82f8a9e57e4271cda429ba3a (patch)
tree5a241a961527829d24f9e5669f21df867c8f9ec6 /emulators/vmware3
parentupdate port: mail/p3scan (diff)
A slew of changes to allow vmware3 to work on 5.x with dynamic device
numbering while not breaking 4.x compatibility: - Stop using device nodes in /usr/compat/linux/dev and instead rely on the linuxaltor passing though to /dev - Create needed device nodes in /dev (on 4.x) - Account for a change in falloc's semantics that was preventing the vmmon module from being unloaded on 5.1+ machines.
Diffstat (limited to 'emulators/vmware3')
-rw-r--r--emulators/vmware3/Makefile7
-rw-r--r--emulators/vmware3/files/freebsd5.patch68
-rw-r--r--emulators/vmware3/files/patch-ab30
-rw-r--r--emulators/vmware3/files/patch-ac9
-rw-r--r--emulators/vmware3/files/vmware.sh3
-rw-r--r--emulators/vmware3/pkg-plist7
-rw-r--r--emulators/vmware3/scripts/pre-install6
7 files changed, 48 insertions, 82 deletions
diff --git a/emulators/vmware3/Makefile b/emulators/vmware3/Makefile
index 7c3d433f1fc7..d3368e757d59 100644
--- a/emulators/vmware3/Makefile
+++ b/emulators/vmware3/Makefile
@@ -7,7 +7,7 @@
PORTNAME= vmware3
PORTVERSION= 3.2.1.2242
-PORTREVISION= 5
+PORTREVISION= 6
PORTEPOCH= 1
CATEGORIES= emulators linux
MASTER_SITES= http://www4.vmware.com/software/ \
@@ -22,7 +22,7 @@ DISTFILES= VMware-workstation-${PORTVERSION:R}-${PORTVERSION:E}${EXTRACT_SUFX}:v
MAINTAINER= orlando.bassotto@ieo-research.it
COMMENT= A virtual machine emulator - a full PC in a window
-RUN_DEPENDS= ${LINUXBASE}/dev/rtc:${PORTSDIR}/emulators/rtc
+RUN_DEPENDS= ${PORTSDIR}/emulators/rtc
RESTRICTED= "Not sure if we can redistribute it"
@@ -131,9 +131,6 @@ post-patch:
.if ${OSVERSION} < 500000
${CAT} ${FILESDIR}/freebsd4.patch | (cd ${WRKSRC} && ${PATCH}) > /dev/null 2>&1
.endif
-.if ${OSVERSION} >= 502104
- ${CAT} ${FILESDIR}/freebsd5.patch | (cd ${WRKSRC} && ${PATCH}) > /dev/null 2>&1
-.endif
setoptions:
${SED} -e 's;@@PREFIX@@;${PREFIX};' \
diff --git a/emulators/vmware3/files/freebsd5.patch b/emulators/vmware3/files/freebsd5.patch
deleted file mode 100644
index 2fb3f71e1da9..000000000000
--- a/emulators/vmware3/files/freebsd5.patch
+++ /dev/null
@@ -1,68 +0,0 @@
---- vmnet-only/freebsd/vmnet.c Sun Feb 29 11:17:28 2004
-+++ vmnet-only/freebsd/vmnet.c Sun Feb 29 10:52:01 2004
-@@ -104,14 +104,22 @@
-
- static struct cdevsw vmnet_cdevsw = {
- #if __FreeBSD_version >= 500104
-+#if __FreeBSD_version >= 502104
-+ .d_version = D_VERSION,
-+ .d_flags = D_PSEUDO | D_NEEDGIANT,
-+#endif
- .d_open = vmnet_open,
- .d_close = vmnet_close,
- .d_read = vmnet_read,
- .d_write = vmnet_write,
- .d_ioctl = vmnet_ioctl,
- .d_poll = vmnet_poll,
-+#if __FreeBSD_version < 502104
- .d_name = DEVICE_NAME,
- .d_maj = CDEV_MAJOR
-+#else
-+ .d_name = DEVICE_NAME
-+#endif
- #else
- /* open */ vmnet_open,
- /* close */ vmnet_close,
---- vmmon-only/Makefile.freebsd Sun Feb 29 11:17:26 2004
-+++ vmmon-only/Makefile.freebsd Sun Feb 29 11:02:20 2004
-@@ -9,6 +9,13 @@
- KMOD= ${DEVNAME}_${MODEL}
- CDEV_MAJOR = 200
- SRCS=
-+.if !defined(OSVERSION)
-+.if exists(/sbin/sysctl)
-+OSVERSION!= /sbin/sysctl -n kern.osreldate
-+.else
-+OSVERSION!= /usr/sbin/sysctl -n kern.osreldate
-+.endif
-+.endif
-
- # For 4.0-STABLE
- # KMODDEPS= linux
-@@ -32,6 +39,8 @@
-
- device:
- rm -f /compat/linux/dev/${DEVNAME}
-+.if ${OSVERSION} >= 502104
- mknod /compat/linux/dev/${DEVNAME} c ${CDEV_MAJOR} 0
-+.endif
-
- .include <bsd.kmod.mk>
---- vmmon-only/freebsd/driver.c Sun Feb 29 11:17:28 2004
-+++ vmmon-only/freebsd/driver.c Sun Feb 29 10:58:11 2004
-@@ -163,9 +163,15 @@
-
- static struct cdevsw vmmon_cdevsw = {
- #if __FreeBSD_version >= 500104
-+#if __FreeBSD_version >= 502104
-+ .d_version = D_VERSION,
-+ .d_flags = D_NEEDGIANT,
-+#endif
- .d_open = FreeBSD_Driver_Open,
- .d_name = DEVICE_NAME,
-+#if __FreeBSD_version < 502104
- .d_maj = CDEV_MAJOR
-+#endif
- #else
- /* open */ FreeBSD_Driver_Open,
- /* close */ noclose,
diff --git a/emulators/vmware3/files/patch-ab b/emulators/vmware3/files/patch-ab
new file mode 100644
index 000000000000..b5e28455f1b5
--- /dev/null
+++ b/emulators/vmware3/files/patch-ab
@@ -0,0 +1,30 @@
+--- vmmon-only/freebsd/driver.c.orig Sat Mar 13 04:04:55 2004
++++ vmmon-only/freebsd/driver.c Sat Mar 13 04:07:43 2004
+@@ -163,9 +163,14 @@
+
+ static struct cdevsw vmmon_cdevsw = {
+ #if __FreeBSD_version >= 500104
++#if __FreeBSD_version >= 502103
++ .d_version = D_VERSION,
++ .d_flags = D_NEEDGIANT,
++#else
++ .d_maj = CDEV_MAJOR
++#endif
+ .d_open = FreeBSD_Driver_Open,
+ .d_name = DEVICE_NAME,
+- .d_maj = CDEV_MAJOR
+ #else
+ /* open */ FreeBSD_Driver_Open,
+ /* close */ noclose,
+@@ -390,6 +395,11 @@
+ fp->f_ops = &vmmon_fileops;
+ fp->f_type = DTYPE_VNODE;
+ FILEDESC_UNLOCK(p->p_fd);
++
++#if __FreeBSD_version >= 501111
++ /* falloc now returns TWO references to the file, not one. */
++ fdrop(fp, td);
++#endif
+
+ PROC_LOCK(p);
+ td->td_dupfd = fd;
diff --git a/emulators/vmware3/files/patch-ac b/emulators/vmware3/files/patch-ac
new file mode 100644
index 000000000000..300ca4b20925
--- /dev/null
+++ b/emulators/vmware3/files/patch-ac
@@ -0,0 +1,9 @@
+--- vmmon-only/Makefile.freebsd.orig Sat Mar 13 04:33:32 2004
++++ vmmon-only/Makefile.freebsd Sat Mar 13 04:41:33 2004
+@@ -32,6 +32,5 @@
+
+ device:
+ rm -f /compat/linux/dev/${DEVNAME}
+- mknod /compat/linux/dev/${DEVNAME} c ${CDEV_MAJOR} 0
+
+ .include <bsd.kmod.mk>
diff --git a/emulators/vmware3/files/vmware.sh b/emulators/vmware3/files/vmware.sh
index 34689d16b011..161c489b3009 100644
--- a/emulators/vmware3/files/vmware.sh
+++ b/emulators/vmware3/files/vmware.sh
@@ -28,7 +28,7 @@ bridged=@@BRIDGED@@
bridge_interface=@@BRIDGE_INTF@@
host_ip=`vmware_config vmnet1.HostOnlyAddress`
netmask=`vmware_config vmnet1.HostOnlyNetMask`
-dev_vmnet1=@@LINUXBASE@@/dev/vmnet1
+dev_vmnet1=/dev/vmnet1
if [ ! -x $vmware ]; then
echo "$vmware does not exist!" >&2
@@ -84,6 +84,7 @@ stop)
ngctl msg ${bridge_interface}: setautosrc 1
ngctl msg ${bridge_interface}: setpromisc 0
fi
+ kldunload vmnet.ko
fi
;;
diff --git a/emulators/vmware3/pkg-plist b/emulators/vmware3/pkg-plist
index bbe0ab33a397..1232755bcc7e 100644
--- a/emulators/vmware3/pkg-plist
+++ b/emulators/vmware3/pkg-plist
@@ -313,14 +313,11 @@ share/doc/vmware/README
@exec mkdir -p %%LINUXBASE%%/dev;for n in 0 1 2 3 4 5 6 7 8 9; do ln -s /dev/ttyv$n %%LINUXBASE%%/dev/tty$n;done
@exec ln -s /dev/ttyva %%LINUXBASE%%/dev/tty10
@exec ln -s /dev/ttyvb %%LINUXBASE%%/dev/tty11
-@exec mknod %%LINUXBASE%%/dev/null c 2 2
-@exec chmod 666 %%LINUXBASE%%/dev/null
@exec mknod %%LINUXBASE%%/dev/hda b 0 0x00010002
@exec mknod %%LINUXBASE%%/dev/hdb b 0 0x0001000a
@exec ln -sf %D/etc/vmware %%LINUXBASE%%/etc/
-@exec mknod %%LINUXBASE%%/dev/vmmon c 200 0
-@exec mknod %%LINUXBASE%%/dev/vmnet1 c 149 %%VMNET1_MINOR%%
-@unexec rm -f %%LINUXBASE%%/etc/vmware %%LINUXBASE%%/dev/vmmon %%LINUXBASE%%/dev/vmnet1 %%LINUXBASE%%/bin/df %%LINUXBASE%%/dev/tty[0-9]* %%LINUXBASE%%/dev/hd? %%LINUXBASE%%/dev/null
+@exec rm -f %%LINUXBASE%%/dev/vmmon %%LINUXBASE%%/dev/vmnet1 %%LINUXBASE%%/dev/null
+@unexec rm -f %%LINUXBASE%%/etc/vmware %%LINUXBASE%%/bin/df %%LINUXBASE%%/dev/tty[0-9]* %%LINUXBASE%%/dev/hd?
@dirrm etc/vmware
@dirrm lib/vmware/bin
@dirrm lib/vmware/help
diff --git a/emulators/vmware3/scripts/pre-install b/emulators/vmware3/scripts/pre-install
index 7d98788dbea8..f4cb4d7ebd83 100644
--- a/emulators/vmware3/scripts/pre-install
+++ b/emulators/vmware3/scripts/pre-install
@@ -15,10 +15,10 @@ done
ln -fs /dev/ttyva ${linux_dev}/tty11
ln -fs /dev/ttyvb ${linux_dev}/tty12
ln -fs ${linux_dev}/tty1 ${linux_dev}/tty0
-mknod ${linux_dev}/null c 2 2
-chmod 666 ${linux_dev}/null
+echo Creating vmmon node
+mknod /dev/vmmon c 200 0
echo Creating vmnet1 node
-mknod /compat/linux/dev/vmnet1 c 149 ${VMNET1_MINOR}
+mknod /dev/vmnet1 c 149 ${VMNET1_MINOR}
echo Creating $linux_dev/hd\?
mknod ${linux_dev}/hda b 0 0x00010002
mknod ${linux_dev}/hdb b 0 0x0001000a