diff options
author | flz <flz@FreeBSD.org> | 2005-04-15 18:20:18 +0800 |
---|---|---|
committer | flz <flz@FreeBSD.org> | 2005-04-15 18:20:18 +0800 |
commit | 42dc60fcd8205bd45acf122df584fa002838047a (patch) | |
tree | db1e1498976b670934f7a5e39af61d394bc860c3 /emulators/vmware2 | |
parent | 5c4be27ccf5d4134e28e061d43a4b0c115b7587b (diff) | |
download | freebsd-ports-gnome-42dc60fcd8205bd45acf122df584fa002838047a.tar.gz freebsd-ports-gnome-42dc60fcd8205bd45acf122df584fa002838047a.tar.zst freebsd-ports-gnome-42dc60fcd8205bd45acf122df584fa002838047a.zip |
- Should fix compilation and vmmon in latest 5.x.
PR: ports/68202
Submitted by: Marc van Kempen <marc@bowtie.nl>
Approved by: maintainer
Diffstat (limited to 'emulators/vmware2')
-rw-r--r-- | emulators/vmware2/Makefile | 18 | ||||
-rw-r--r-- | emulators/vmware2/files/Makefile_FreeBSD.patch | 12 | ||||
-rw-r--r-- | emulators/vmware2/files/cdevsw.patch | 12 | ||||
-rw-r--r-- | emulators/vmware2/files/driver_c.patch | 58 | ||||
-rw-r--r-- | emulators/vmware2/files/patch-bd | 14 | ||||
-rw-r--r-- | emulators/vmware2/files/patch-be | 34 | ||||
-rw-r--r-- | emulators/vmware2/scripts/pre-install | 7 |
7 files changed, 140 insertions, 15 deletions
diff --git a/emulators/vmware2/Makefile b/emulators/vmware2/Makefile index 29392bba00fc..9aac5f1e92cd 100644 --- a/emulators/vmware2/Makefile +++ b/emulators/vmware2/Makefile @@ -71,9 +71,9 @@ IGNORE= "Kernel source files required" .endif .if ${OSVERSION} < 500023 -VMNET1_MINOR= 0x00010001 +VMNET1_MINOR= 0x00010001 .else -VMNET1_MINOR= 0x00800001 +VMNET1_MINOR= 0x00800001 .endif SCRIPTS_ENV+= LINUXBASE="${LINUXBASE}" \ @@ -89,6 +89,12 @@ PLIST_SUB+= FREEBSD5="@comment " PLIST_SUB+= FREEBSD5="" .endif +.if ${OSVERSION} >= 500104 +LINUXBASE_MAYBE= +.else +LINUXBASE_MAYBE= ${LINUXBASE} +.endif + post-extract: .for m in ${MODULES} ${TAR} -xf ${WRKSRC}/lib/modules/source/${m}.tar -C ${WRKSRC} @@ -123,10 +129,11 @@ post-patch: cd ${WRKSRC}/vmmon-only/freebsd && ${TOUCH} bus_if.h device_if.h .if ${OSVERSION} >= 500019 ${PERL} -i -pe 's,<machine/ioctl_fd\.h>,<sys/fdcio.h>,' \ - ${WRKSRC}/vmmon-only/freebsd/*.c \ - ${WRKSRC}/vmware-distrib/vmmon-only/freebsd/*.c + ${WRKDIR}/vmmon-only/freebsd/*.c \ + ${WRKDIR}/vmware-distrib/vmmon-only/freebsd/*.c .endif ${CAT} ${FILESDIR}/kmoddeps.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1 + ${CAT} ${FILESDIR}/Makefile_FreeBSD.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1 .if ${OSVERSION} >= 500038 ${CAT} ${FILESDIR}/fo_ioctl.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1 .endif @@ -136,6 +143,7 @@ post-patch: .endif .if ${OSVERSION} >= 500104 ${CAT} ${FILESDIR}/cdevsw.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1 + ${CAT} ${FILESDIR}/driver_c.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1 .endif .if ${OSVERSION} >= 500109 || ${OSVERSION} < 500000 && ${OSVERSION} >= 480102 ${CAT} ${FILESDIR}/hostif_c.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1 @@ -152,7 +160,7 @@ setoptions: ${FILESDIR}/config > ${WRKDIR}/config ${SED} -e 's;@@PREFIX@@;${PREFIX};' \ - -e 's;@@LINUXBASE@@;${LINUXBASE};' \ + -e 's;@@LINUXBASE@@;${LINUXBASE_MAYBE};' \ -e 's;@@NETWORKING@@;${VMNET_NETWORKING};' \ -e 's;@@BRIDGED@@;${VMNET_BRIDGED};' \ -e 's;@@BRIDGE_INTF@@;${VMNET_BRIDGED_INTERFACE};' \ diff --git a/emulators/vmware2/files/Makefile_FreeBSD.patch b/emulators/vmware2/files/Makefile_FreeBSD.patch new file mode 100644 index 000000000000..b5c76a1535c5 --- /dev/null +++ b/emulators/vmware2/files/Makefile_FreeBSD.patch @@ -0,0 +1,12 @@ +--- vmmon-only/Makefile.FreeBSD.orig Tue Jun 22 16:52:23 2004 ++++ vmmon-only/Makefile.FreeBSD Tue Jun 22 16:51:58 2004 +@@ -57,7 +59,9 @@ + + device: + rm -f /compat/linux/dev/${DEVNAME} ++.if ${OSVERSION} > 500104 + mknod /compat/linux/dev/${DEVNAME} c ${CDEV_MAJOR} 0 ++.endif + + + .include <bsd.kmod.mk> diff --git a/emulators/vmware2/files/cdevsw.patch b/emulators/vmware2/files/cdevsw.patch index e8f15423009a..68b70e1a2c28 100644 --- a/emulators/vmware2/files/cdevsw.patch +++ b/emulators/vmware2/files/cdevsw.patch @@ -1,10 +1,14 @@ --- vmmon-only/freebsd/driver.c_original Wed Mar 5 19:22:35 2003 +++ vmmon-only/freebsd/driver.c Wed Mar 5 19:22:44 2003 -@@ -155,6 +155,14 @@ +@@ -155,6 +155,18 @@ /* static struct cdevsw vmmon_cdevsw = { */ static struct cdevsw vmmon_cdevsw = { +#if __FreeBSD_version >= 500104 ++#if __FreeBSD_version >= 502103 ++ .d_version = D_VERSION, ++ .d_flags = D_NEEDGIANT, ++#endif + .d_open = FreeBSD_Driver_Open, + .d_close = FreeBSD_Driver_Close, + .d_ioctl = FreeBSD_Driver_Ioctl, @@ -54,11 +58,15 @@ } --- vmnet-only/freebsd/vmnet.c_original Wed Mar 5 19:21:51 2003 +++ vmnet-only/freebsd/vmnet.c Wed Mar 5 19:22:00 2003 -@@ -103,6 +103,16 @@ +@@ -103,6 +103,20 @@ static int vmnet_modeevent(module_t mod, int cmd, void *arg); static struct cdevsw vmnet_cdevsw = { +#if __FreeBSD_version >= 500104 ++#if __FreeBSD_version >= 502103 ++ .d_version = D_VERSION, ++ .d_flags = D_NEEDGIANT, ++#endif + .d_open = vmnet_open, + .d_close = vmnet_close, + .d_read = vmnet_read, diff --git a/emulators/vmware2/files/driver_c.patch b/emulators/vmware2/files/driver_c.patch new file mode 100644 index 000000000000..0dad4c78be7b --- /dev/null +++ b/emulators/vmware2/files/driver_c.patch @@ -0,0 +1,58 @@ +--- vmmon-only/freebsd/driver.c.original Tue Jun 22 15:24:52 2004 ++++ vmmon-only/freebsd/driver.c Tue Jun 22 10:01:30 2004 +@@ -157,8 +157,8 @@ + static struct cdevsw vmmon_cdevsw = { + #if __FreeBSD_version >= 500104 + #if __FreeBSD_version >= 502103 +- .d_version = D_VERSION, +- .d_flags = D_NEEDGIANT, ++ .d_version = D_VERSION, ++ .d_flags = D_NEEDGIANT, + #endif + .d_open = FreeBSD_Driver_Open, + .d_close = FreeBSD_Driver_Close, +@@ -233,7 +233,7 @@ + * + *---------------------------------------------------------------------- + */ +-static dev_t vmmon_dev; ++static struct cdev * vmmon_dev; + static int + init_module(void) + { +@@ -359,7 +359,7 @@ + *---------------------------------------------------------------------- + */ + static int +-FreeBSD_Driver_Open(dev_t dev, int oflag, int devtype, struct thread *td) ++FreeBSD_Driver_Open(struct cdev * dev, int oflag, int devtype, struct thread *td) + { + VMFreeBSD *vmFreeBSD; + VMDriver *vm; +@@ -439,7 +439,7 @@ + */ + + static int +-FreeBSD_Driver_Close(dev_t dev, int fflag, int devtype, struct thread *td) ++FreeBSD_Driver_Close(struct cdev * dev, int fflag, int devtype, struct thread *td) + { + VMFreeBSD *vmFreeBSD = (VMFreeBSD *) dev->si_drv1; + +@@ -491,7 +491,7 @@ + */ + + static int +-FreeBSD_Driver_Poll(dev_t dev, int events, struct thread *td) ++FreeBSD_Driver_Poll(struct cdev * dev, int events, struct thread *td) + { + int revents = 0; + +@@ -573,7 +573,7 @@ + *---------------------------------------------------------------------- + */ + static int +-FreeBSD_Driver_Ioctl( dev_t dev, u_long cmd, caddr_t parg, int mode, ++FreeBSD_Driver_Ioctl( struct cdev * dev, u_long cmd, caddr_t parg, int mode, + struct thread *td) + { + VMFreeBSD *vmFreeBSD = (VMFreeBSD *) dev->si_drv1; diff --git a/emulators/vmware2/files/patch-bd b/emulators/vmware2/files/patch-bd index ff0ea92d6a36..f50a82d3b335 100644 --- a/emulators/vmware2/files/patch-bd +++ b/emulators/vmware2/files/patch-bd @@ -1,5 +1,5 @@ ---- vmmon-only/freebsd/driver.c.orig Thu Jun 29 21:06:18 2000 -+++ vmmon-only/freebsd/driver.c Sat Sep 23 01:41:34 2000 +--- vmmon-only/freebsd/driver.c.orig Sat Apr 10 16:52:28 2004 ++++ vmmon-only/freebsd/driver.c Sat Apr 10 16:54:39 2004 @@ -73,6 +73,24 @@ #include "private.h" #endif @@ -25,3 +25,13 @@ #ifdef SUPPORT_PASSTHROUGH #include "passthrough.h" // _driver_ version of passthrough.h #endif +@@ -256,7 +274,9 @@ + + #include <machine/md_var.h> + #include <machine/segments.h> ++#if __FreeBSD_version < 501114 + #include <i386/isa/intr_machep.h> ++#endif + + static int + vmmon_modeevent(module_t mod, int cmd, void *arg) diff --git a/emulators/vmware2/files/patch-be b/emulators/vmware2/files/patch-be index 3515097e1e04..5ae4894ac02d 100644 --- a/emulators/vmware2/files/patch-be +++ b/emulators/vmware2/files/patch-be @@ -1,5 +1,5 @@ ---- vmmon-only/freebsd/hostif.c.orig Mon Sep 2 19:19:50 2002 -+++ vmmon-only/freebsd/hostif.c Mon Sep 2 19:30:03 2002 +--- vmmon-only/freebsd/hostif.c.orig Sat Apr 10 16:52:23 2004 ++++ vmmon-only/freebsd/hostif.c Sat Apr 10 16:54:17 2004 @@ -55,7 +55,11 @@ #include <vm/vm.h> @@ -57,7 +57,33 @@ return 0; } -@@ -1066,10 +1098,33 @@ +@@ -1006,8 +1038,12 @@ + HostIF_APIC_Base(VMDriver *vm, Bool setVMPtr) + { + #if defined(SMP) ++#if __FreeBSD_version < 501114 + return cpu_apic_address; ++#else ++ return 0; /* XXX */ ++#endif + #else + return 0; + #endif + } +@@ -1035,8 +1070,12 @@ + HostIF_IOAPIC_Base(VMDriver *vm) + { + #if defined(SMP) ++#if __FreeBSD_version < 501114 + return io_apic_address[0]; /* XXX How about another APIC's */ + #else ++ return 0; /* XXX */ ++#endif ++#else + return 0; + #endif + } +@@ -1066,10 +1105,33 @@ return NULL; } paddr = vtophys(addr); @@ -91,7 +117,7 @@ return ka->kaddr; } -@@ -1079,9 +1134,29 @@ +@@ -1079,9 +1141,29 @@ if (ka->map==NULL) return 0; diff --git a/emulators/vmware2/scripts/pre-install b/emulators/vmware2/scripts/pre-install index 29261ccebb9d..9539dabbd9be 100644 --- a/emulators/vmware2/scripts/pre-install +++ b/emulators/vmware2/scripts/pre-install @@ -17,8 +17,11 @@ ln -s /dev/ttyvb ${linux_dev}/tty12 ln -s ${linux_dev}/tty1 ${linux_dev}/tty0 mknod ${linux_dev}/null c 2 2 chmod 666 ${linux_dev}/null -echo Creating vmnet1 node -mknod /compat/linux/dev/vmnet1 c 149 ${VMNET1_MINOR} +rm -f /compat/linux/dev/vmnet1 +if [ "$OSVERSION" -lt "500104" ]; then + echo Creating vmnet1 node + mknod /compat/linux/dev/vmnet1 c 149 ${VMNET1_MINOR} +fi echo Creating $linux_dev/hd\? mknod ${linux_dev}/hda b 0 0x00010002 mknod ${linux_dev}/hdb b 0 0x0001000a |