diff options
author | veego <veego@pkgsrc.org> | 2001-07-07 14:40:07 +0000 |
---|---|---|
committer | veego <veego@pkgsrc.org> | 2001-07-07 14:40:07 +0000 |
commit | 1cbf3e2f984c6a00c1291dfeec07a92c0d3b769c (patch) | |
tree | 386e684756d41ab634c8623bb0f44db4542c661a /emulators | |
parent | 7ce0890b1f33656e922b50023d9878d67d4dd3fc (diff) | |
download | pkgsrc-1cbf3e2f984c6a00c1291dfeec07a92c0d3b769c.tar.gz |
VMware module that contains the lkm's to run VMware.
patch-ac is from Atsushi Onoe <onoe@sm.sony.co.jp>.
Note that you have to fetch the distfile manually.
Diffstat (limited to 'emulators')
-rw-r--r-- | emulators/vmware-module/Makefile | 85 | ||||
-rw-r--r-- | emulators/vmware-module/distinfo | 9 | ||||
-rw-r--r-- | emulators/vmware-module/patches/patch-aa | 31 | ||||
-rw-r--r-- | emulators/vmware-module/patches/patch-ab | 75 | ||||
-rw-r--r-- | emulators/vmware-module/patches/patch-ac | 38 | ||||
-rw-r--r-- | emulators/vmware-module/patches/patch-ad | 71 | ||||
-rw-r--r-- | emulators/vmware-module/patches/patch-ae | 16 | ||||
-rw-r--r-- | emulators/vmware-module/pkg/DESCR | 3 | ||||
-rw-r--r-- | emulators/vmware-module/pkg/INSTALL | 37 | ||||
-rw-r--r-- | emulators/vmware-module/pkg/PLIST | 21 |
10 files changed, 386 insertions, 0 deletions
diff --git a/emulators/vmware-module/Makefile b/emulators/vmware-module/Makefile new file mode 100644 index 00000000000..549c756429e --- /dev/null +++ b/emulators/vmware-module/Makefile @@ -0,0 +1,85 @@ +# $NetBSD: Makefile,v 1.1.1.1 2001/07/07 14:40:07 veego Exp $ + +DISTNAME= vmware-netbsd-1.0 +PKGNAME= vmware-module-1.0 +CATEGORIES= emulators +MASTER_SITES= # empty +EXTRACT_SUFX= .tgz + +MAINTAINER= veego@netbsd.org +HOMEPAGE= http://www.wasabisystems.com/ +COMMENT= Kernel modules for the VMware emulator + +ONLY_FOR_PLATFORM= NetBSD-*-i386 + +NO_WRKSUBDIR= # defined +NO_CONFIGURE= # defined + +NO_SRC_ON_FTP= ${RESTRICTED} +NO_SRC_ON_CDROM= ${RESTRICTED} +NO_BIN_ON_FTP= ${RESTRICTED} +NO_BIN_ON_CDROM= ${RESTRICTED} + +DOWNLOAD= http://www.wasabisystems.com/vmware-survey.html + +do-fetch: + @if [ ! -f ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} ]; then \ + ${ECHO_MSG} "==============================================================="; \ + ${ECHO_MSG} " The VMware kernel module must be fetched into \"${DISTDIR}\""; \ + ${ECHO_MSG} " via the Web formular available under this URL:"; \ + ${ECHO_MSG} " ${DOWNLOAD}"; \ + ${ECHO_MSG} "==============================================================="; \ + ${FALSE}; \ + fi + +# to override <bsd.own.mk>, MUST be set this way BEFORE bsd.prefs.mk +BSDSRCDIR?= /nonexistent + +.include "../../mk/bsd.prefs.mk" + +pre-extract: +.if ${BSDSRCDIR} == "/nonexistent" + @${ECHO_MSG} "Please set BSDSRCDIR in /etc/mk.conf, pointing it" + @${ECHO_MSG} "to a directory that contains sources that match" + @${ECHO_MSG} "your currently running system (esp. kernel), e.g." + @${ECHO_MSG} "/usr/src." + @${FALSE} +.endif +.if !exists(${BSDSRCDIR}/sys/lib/libkern/libkern.h) + @${ECHO_MSG} "Need a kernel source tree in ${BSDSRCDIR}/sys." + @${ECHO_MSG} "(Or set BSDSRCDIR correctly in /etc/mk.conf.)" + @${FALSE} +.endif + +do-build: + for dirs in linuxrtc vmmon vmnet; do \ + cd ${WRKSRC}/source/$${dirs} && ${MAKE}; \ + done + +do-install: + ${INSTALL_DATA_DIR} ${PREFIX}/lkm ${PREFIX}/etc/rc.conf.d + ${INSTALL_DATA} ${WRKDIR}/rc.conf.d/linuxrtc ${PREFIX}/etc/rc.conf.d/ + ${INSTALL_DATA} ${WRKDIR}/rc.conf.d/vmmon ${PREFIX}/etc/rc.conf.d/ + ${INSTALL_DATA} ${WRKDIR}/rc.conf.d/vmnet ${PREFIX}/etc/rc.conf.d/ + ${INSTALL_DATA} ${WRKDIR}/rc.conf.d/vmnetif ${PREFIX}/etc/rc.conf.d/ + ${INSTALL_DATA} ${WRKDIR}/source/linuxrtc/linuxrtc.o ${PREFIX}/lkm/ + ${INSTALL_DATA} ${WRKDIR}/source/vmmon/vmmon.o ${PREFIX}/lkm/ + ${INSTALL_DATA} ${WRKDIR}/source/vmnet/if_hub.o ${PREFIX}/lkm/ + ${INSTALL_SCRIPT} ${WRKDIR}/share/lkm/if_hub_post.sh ${PREFIX}/lkm/ + ${INSTALL_SCRIPT} ${WRKDIR}/share/lkm/linuxrtc_post.sh ${PREFIX}/lkm/ + ${INSTALL_SCRIPT} ${WRKDIR}/share/lkm/vmmon_post.sh ${PREFIX}/lkm/ + @cd ${WRKSRC}/rc.d && for f in linuxrtc vmmon vmnet vmnetif; do \ + ${SED} -e 's,@PREFIX@,${PREFIX},' < $$f > $$f.patched; \ + ${INSTALL_SCRIPT} $$f.patched ${PREFIX}/etc/rc.d/$$f; \ + done + ${SED} -e 's,@VMWARE_PREFIX@,${PREFIX},' \ + < ${WRKSRC}/rc.conf.d/vmware > ${WRKSRC}/rc.conf.d/vmware.patched + ${INSTALL_DATA} ${WRKSRC}/rc.conf.d/vmware.patched \ + ${PREFIX}/etc/rc.conf.d/vmware + +post-install: + PKG_PREFIX="${PREFIX}" ${SH} ${INSTALL_FILE} - POST-INSTALL + +.include "../../mk/bsd.pkg.mk" + +LDFLAGS= # empty since we use BSD-style makefiles diff --git a/emulators/vmware-module/distinfo b/emulators/vmware-module/distinfo new file mode 100644 index 00000000000..92059a49adf --- /dev/null +++ b/emulators/vmware-module/distinfo @@ -0,0 +1,9 @@ +$NetBSD: distinfo,v 1.1.1.1 2001/07/07 14:40:07 veego Exp $ + +SHA1 (vmware-netbsd-1.0.tgz) = ea3ec59de0bab2ecd57aedbff0ade54f88f84ae2 +Size (vmware-netbsd-1.0.tgz) = 93286 bytes +SHA1 (patch-aa) = dc008ea571bb2fd15be77a3bd39bfdecf9f1f243 +SHA1 (patch-ab) = 2ff6e47f7e57c56ac026749e579bf4ebe0d8ac6f +SHA1 (patch-ac) = 528dab24b0daebb97fcfd911d9abe0c60804351a +SHA1 (patch-ad) = fa3a8aef090c0cb9ef54bf423a6a9c78bfbb1a49 +SHA1 (patch-ae) = 9f4025f006228505d14d241e2a89be291105e7f4 diff --git a/emulators/vmware-module/patches/patch-aa b/emulators/vmware-module/patches/patch-aa new file mode 100644 index 00000000000..fa3b16b1e99 --- /dev/null +++ b/emulators/vmware-module/patches/patch-aa @@ -0,0 +1,31 @@ +$NetBSD: patch-aa,v 1.1.1.1 2001/07/07 14:40:07 veego Exp $ + +--- source/linuxrtc/Makefile Tue Apr 3 02:03:20 2001 ++++ source/linuxrtc/Makefile Sun Jun 10 10:14:02 2001 +@@ -1,5 +1,5 @@ + #S?= /work/trees/current/sys +-S?= /work/trees/netbsd-1-5/sys ++S?= ${BSDSRCDIR}/sys + MKMAN= no + KMOD?= linuxrtc + SRCS= rtc.c +--- source/vmmon/Makefile Tue Apr 3 01:05:04 2001 ++++ source/vmmon/Makefile Sun May 13 22:02:16 2001 +@@ -1,7 +1,7 @@ + MKMAN= no + KMOD= vmmon + #S= /work/trees/current/sys +-S= /work/trees/netbsd-1-5/sys ++S?= ${BSDSRCDIR}/sys + SRCS= + WARNS?= 1 + +--- source/vmnet/Makefile Tue Apr 3 00:54:50 2001 ++++ source/vmnet/Makefile Sun May 13 22:02:52 2001 +@@ -1,5 +1,5 @@ + #S?= /work/trees/current/sys +-S?= /work/trees/netbsd-1-5/sys ++S?= ${BSDSRCDIR}/sys + MKMAN= no + KMOD?= if_hub + SRCS= if_hubmod.c diff --git a/emulators/vmware-module/patches/patch-ab b/emulators/vmware-module/patches/patch-ab new file mode 100644 index 00000000000..16d3840f2d5 --- /dev/null +++ b/emulators/vmware-module/patches/patch-ab @@ -0,0 +1,75 @@ +$NetBSD: patch-ab,v 1.1.1.1 2001/07/07 14:40:07 veego Exp $ + +--- rc.d/linuxrtc Wed Apr 4 04:43:17 2001 ++++ rc.d/linuxrtc Sun Jun 10 13:55:56 2001 +@@ -2,6 +2,7 @@ + # + + # PROVIDE: linuxrtc ++# BEFORE: securelevel + + . /etc/rc.subr + +@@ -13,8 +14,8 @@ + + load_rc_config $name + +-linuxrtc_lkm="$vmware_prefix/share/vmware/lkm/linuxrtc.o" +-linuxrtc_post_script="$vmware_prefix/share/vmware/lkm/linuxrtc_post.sh" ++linuxrtc_lkm="@PREFIX@/lkm/linuxrtc.o" ++linuxrtc_post_script="@PREFIX@/lkm/linuxrtc_post.sh" + + linuxrtc_prestart() + { +--- rc.d/vmmon Wed Apr 4 04:42:40 2001 ++++ rc.d/vmmon Sun Jun 10 13:56:04 2001 +@@ -2,6 +2,7 @@ + # + + # PROVIDE: vmmon ++# BEFORE: securelevel + + . /etc/rc.subr + +@@ -13,8 +14,8 @@ + + load_rc_config $name + +-vmmon_lkm="$vmware_prefix/share/vmware/lkm/vmmon.o" +-vmmon_post_script="$vmware_prefix/share/vmware/lkm/vmmon_post.sh" ++vmmon_lkm="@PREFIX@/lkm/vmmon.o" ++vmmon_post_script="@PREFIX@/lkm/vmmon_post.sh" + + vmmon_prestart() + { +--- rc.d/vmnet Wed Apr 4 04:42:40 2001 ++++ rc.d/vmnet Sun Jun 10 13:56:12 2001 +@@ -2,6 +2,7 @@ + # + + # PROVIDE: vmnet ++# BEFORE: securelevel + + . /etc/rc.subr + +@@ -13,8 +14,8 @@ + + load_rc_config $name + +-vmnet_lkm="$vmware_prefix/share/vmware/lkm/if_hub.o" +-vmnet_post_script="$vmware_prefix/share/vmware/lkm/if_hub_post.sh" ++vmnet_lkm="@PREFIX@/lkm/if_hub.o" ++vmnet_post_script="@PREFIX@/lkm/if_hub_post.sh" + + vmnet_prestart() + { +--- rc.d/vmnetif Wed Apr 4 04:43:19 2001 ++++ rc.d/vmnetif Sun Jun 10 13:37:57 2001 +@@ -2,6 +2,7 @@ + + # PROVIDE: vmnet-netifup + # REQUIRE: vmmon vmnet ++# BEFORE: securelevel + + . /etc/rc.subr + diff --git a/emulators/vmware-module/patches/patch-ac b/emulators/vmware-module/patches/patch-ac new file mode 100644 index 00000000000..3662b1a54af --- /dev/null +++ b/emulators/vmware-module/patches/patch-ac @@ -0,0 +1,38 @@ +$NetBSD: patch-ac,v 1.1.1.1 2001/07/07 14:40:07 veego Exp $ + +--- source/vmmon/netbsd/host.c Tue Apr 3 14:23:08 2001 ++++ source/vmmon/netbsd/host.c Thu Jun 28 21:52:09 2001 +@@ -315,9 +315,16 @@ + + /* + * now locate it and write the results back to the pmap ++ * ++ * Under extreme memory pressure, the page may be gone again. ++ * Just fail the lock in that case. ++ * (It was ASSERT_BUG(6339, mpn).) ++ * -- edward + */ + mpn = FindMPN(vpn); +- ASSERT(mpn); ++ if (mpn == 0) { ++ return 0; ++ } + + /* + * XXX SMP. +@@ -628,6 +635,7 @@ + if (vm->crossvaddr != NULL) + Warning("KernelAddr already allocated\n"); + ++ PHOLD(curproc); + uvm_vslock(curproc, addr, PAGE_SIZE, + VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); + +@@ -636,6 +644,7 @@ + pmap_extract(vm_map_pmap(&curproc->p_vmspace->vm_map), uaddr, &paddr); + pmap_kenter_pa(kvaddr, paddr, + VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE); ++ PRELE(curproc); + vm->crossvaddr = (void *)kvaddr; + vm->crossuaddr = addr; + #ifdef DEBUG diff --git a/emulators/vmware-module/patches/patch-ad b/emulators/vmware-module/patches/patch-ad new file mode 100644 index 00000000000..22b3d26faec --- /dev/null +++ b/emulators/vmware-module/patches/patch-ad @@ -0,0 +1,71 @@ +$NetBSD: patch-ad,v 1.1.1.1 2001/07/07 14:40:07 veego Exp $ + +--- source/vmnet/if_hubvar.h Tue Apr 3 00:57:57 2001 ++++ source/vmnet/if_hubvar.h Sun Jun 10 11:35:34 2001 +@@ -76,4 +76,8 @@ + #define MAKEHUBDEV(d,u) MAKEPORTDEV(d,0,-1) + + #define HUBMINPKT ETHER_HDR_LEN +-#define HUBMAXPKT (ETHER_MAX_FRAME(ETHERTYPE_VLAN, 1)) ++#if __NetBSD_Version__ >= 105230000 ++# define HUBMAXPKT(ifp) (ETHER_MAX_FRAME(ifp, ETHERTYPE_VLAN, 1)) ++#else ++# define HUBMAXPKT (ETHER_MAX_FRAME(ETHERTYPE_VLAN, 1)) ++#endif +--- source/vmnet/if_hubmod.c Tue Apr 3 22:51:19 2001 ++++ source/vmnet/if_hubmod.c Sat Jun 23 23:56:58 2001 +@@ -141,10 +141,19 @@ + { + int error = 0, i, j; + struct hubdev_softc *sc; ++#if __NetBSD_Version__ >= 105230000 ++ struct ifnet *ifp; ++#endif + + switch (cmd) { + case LKM_E_LOAD: ++#if __NetBSD_Version__ >= 105230000 ++ ifp = (struct ifnet *)malloc(sizeof(*ifp), M_MRTABLE, M_WAITOK); ++ ifp->if_mtu = ETHERMTU; ++ if (HUBMAXPKT(ifp) > MCLBYTES) { ++#else + if (HUBMAXPKT > MCLBYTES) { ++#endif + printf("if_hub: HUBMAXPKT > MCLBYTES\n"); + return EIO; + } +@@ -496,6 +505,11 @@ + fp->f_type = DTYPE_VNODE; + fp->f_ops = &vnops; + fp->f_data = (caddr_t)vp; ++#if __NetBSD_Version__ >= 105230000 ++#ifdef FILE_SET_MATURE ++ FILE_SET_MATURE(fp); ++#endif ++#endif + FILE_UNUSE(fp, p); + + p->p_dupfd = fd; +@@ -903,6 +917,9 @@ + struct hubport_softc *portsc; + struct mbuf *m; + int error; ++#if __NetBSD_Version__ >= 105230000 ++ struct ifnet *ifp; ++#endif + + hubsc = hub_scs[HUBUNIT(dev)]; + if (hubsc == NULL) +@@ -917,7 +934,12 @@ + if (uio->uio_resid == 0) + return (0); + ++#if __NetBSD_Version__ >= 105230000 ++ ifp = &portsc->port_if; ++ if ((uio->uio_resid < HUBMINPKT) || (uio->uio_resid > HUBMAXPKT(ifp))) { ++#else + if ((uio->uio_resid < HUBMINPKT) || (uio->uio_resid > HUBMAXPKT)) { ++#endif + HUBDEBUG("if_hub: write: illegal length %d\n", uio->uio_resid); + return EIO; + } diff --git a/emulators/vmware-module/patches/patch-ae b/emulators/vmware-module/patches/patch-ae new file mode 100644 index 00000000000..280ea575e27 --- /dev/null +++ b/emulators/vmware-module/patches/patch-ae @@ -0,0 +1,16 @@ +$NetBSD: patch-ae,v 1.1.1.1 2001/07/07 14:40:07 veego Exp $ + +--- source/vmmon/netbsd/drv.c Tue Apr 3 00:41:32 2001 ++++ source/vmmon/netbsd/drv.c Sat Jun 23 22:12:21 2001 +@@ -280,6 +280,11 @@ + fp->f_type = DTYPE_VNODE; + fp->f_ops = &vnops; + fp->f_data = (caddr_t)vp; ++#if __NetBSD_Version__ >= 105230000 ++#ifdef FILE_SET_MATURE ++ FILE_SET_MATURE(fp); ++#endif ++#endif + FILE_UNUSE(fp, p); + + p->p_dupfd = fd; diff --git a/emulators/vmware-module/pkg/DESCR b/emulators/vmware-module/pkg/DESCR new file mode 100644 index 00000000000..99b3dc1deb7 --- /dev/null +++ b/emulators/vmware-module/pkg/DESCR @@ -0,0 +1,3 @@ +This package consists of set of kernel modules and scripts that will +allow owners of the Linux version of VMware to run their binaries under +NetBSD. diff --git a/emulators/vmware-module/pkg/INSTALL b/emulators/vmware-module/pkg/INSTALL new file mode 100644 index 00000000000..8c97b4b093a --- /dev/null +++ b/emulators/vmware-module/pkg/INSTALL @@ -0,0 +1,37 @@ +#!/bin/sh +# +# $NetBSD: INSTALL,v 1.1.1.1 2001/07/07 14:40:07 veego Exp $ + +case $2 in +PRE-INSTALL) + ;; +POST-INSTALL) + /bin/cat << EOF +=========================================================================== +Copy the following files from ${PKG_PREFIX}/etc/rc.d to /etc/rc.d: + +linuxrtc vmmon vmnet vmnetif vmware + +and append the content of ${PKG_PREFIX}/etc/rc.conf.d to /etc/rc.conf: + +vmware_prefix=${PKG_PREFIX} +vmmon=YES +vmnet=YES +linuxrtc=NO +# XXX should cater for multiple interfaces +vmnetif=YES +vmnetifname=vmnet1 +vmnetdev=/dev/vmnet1 +vmnetifconfig="inet 172.16.212.1 netmask 0xffffff00" +vmnetif_use_dhcpd=NO + +Then, reboot your system. +=========================================================================== +EOF + ;; +*) + echo "Unexpected argument: $2" + exit 1 + ;; +esac +exit 0 diff --git a/emulators/vmware-module/pkg/PLIST b/emulators/vmware-module/pkg/PLIST new file mode 100644 index 00000000000..6999c31f6a1 --- /dev/null +++ b/emulators/vmware-module/pkg/PLIST @@ -0,0 +1,21 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2001/07/07 14:40:07 veego Exp $ +etc/rc.conf.d/linuxrtc +etc/rc.conf.d/vmmon +etc/rc.conf.d/vmnet +etc/rc.conf.d/vmnetif +etc/rc.conf.d/vmware +etc/rc.d/linuxrtc +etc/rc.d/vmmon +etc/rc.d/vmnet +etc/rc.d/vmnetif +lkm/if_hub.o +lkm/if_hub_post.sh +lkm/linuxrtc.o +lkm/linuxrtc_post.sh +lkm/vmmon.o +lkm/vmmon_post.sh +@dirrm etc/rc.conf.d +@unexec rm -f %D/lkm/if_hub. 2>/dev/null || true +@unexec rm -f %D/lkm/linuxrtc 2>/dev/null || true +@unexec rm -f %D/lkm/vmmon 2>/dev/null || true +@unexec rmdir %D/lkm 2>/dev/null || true |