diff options
Diffstat (limited to 'emulators/virtualbox-ose')
19 files changed, 743 insertions, 64 deletions
diff --git a/emulators/virtualbox-ose/Makefile b/emulators/virtualbox-ose/Makefile index 721fa3eb4066..2274d54e411e 100644 --- a/emulators/virtualbox-ose/Makefile +++ b/emulators/virtualbox-ose/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= virtualbox-ose -DISTVERSION= 4.3.6 +DISTVERSION= 4.3.8 CATEGORIES= emulators MASTER_SITES= http://download.virtualbox.org/virtualbox/${DISTVERSION}/ \ http://tmp.chruetertee.ch/ \ @@ -26,7 +26,7 @@ BUILD_DEPENDS= yasm:${PORTSDIR}/devel/yasm \ LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png \ libxslt.so:${PORTSDIR}/textproc/libxslt \ libcurl.so:${PORTSDIR}/ftp/curl -RUN_DEPENDS= ${KMODDIR}/vboxdrv.ko:${PORTSDIR}/emulators/virtualbox-ose-kmod \ +RUN_DEPENDS= ${LOCALBASE}/etc/rc.d/vboxnet:${PORTSDIR}/emulators/virtualbox-ose-kmod \ cdrecord:${PORTSDIR}/sysutils/cdrtools WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} @@ -54,7 +54,7 @@ VBOX_GUEST_VER= ${PORTVERSION} OPTIONS_DEFINE= QT4 DEBUG GUESTADDITIONS DBUS PULSEAUDIO UDPTUNNEL VDE VNC WEBSERVICE NLS X11 VPX PYTHON OPTIONS_DEFAULT= QT4 DBUS X11 UDPTUNNEL VNC WEBSERVICE PYTHON -OPTIONS_SUB= X11 QT4 GUESTADDITIONS VNC NLS WEBSERVICE PYTHON +OPTIONS_SUB= yes DEBUG_DESC= Debug symbols, additional logs and assertions QT4_DESC= Build with QT4 Frontend GUESTADDITIONS_DESC= Build with Guest Additions @@ -87,14 +87,12 @@ ENV= .SHELL: path="/bin/sh" unsetenv=true .endif -NO_STAGE= yes .include <bsd.port.options.mk> -KMODDIR= /boot/modules - -PLIST_SUB+= PYTHON_VER=${PYTHON_VER} \ +PLIST_SUB+= GUEST_VER=${VBOX_GUEST_VER} \ + PYTHON_VER=${PYTHON_VER} \ PYTHON_VERU=${PYTHON_VER:S/./_/} \ - GUEST_VER=${VBOX_GUEST_VER} + VBOXGROUP=${VBOXGROUP} SUB_LIST+= VBOXUSER=${VBOXUSER} \ VBOXWSUSER=${VBOXWSUSER} @@ -102,7 +100,7 @@ USE_RC_SUBR+= vboxheadless vboxwatchdog KMK_BUILDTYPE= release KMK_CONFIG= VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys -KMK_FLAGS= -j 1 +KMK_FLAGS= -j${MAKE_JOBS_NUMBER} .if empty(PORT_OPTIONS:MQT4) && !empty(PORT_OPTIONS:MNLS) BROKEN= NLS support requires QT4 frontend. Run 'make config' again! @@ -170,8 +168,8 @@ PLIST_SUB+= ARCH="${KMK_ARCH}" .include <bsd.port.pre.mk> .if ${OSVERSION} < 900000 -EXTRA_PATCHES+= ${FILESDIR}/extrapatch-src-VBox-Main-src-server-generic-NetIf-generic.cpp \ - ${FILESDIR}/extrapatch-src-VBox-Devices-PC-vbox.dsl +EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src-VBox-Devices-PC-vbox.dsl \ + ${PATCHDIR}/extrapatch-src-VBox-Main-src-server-generic-NetIf-generic.cpp .endif pre-everything:: @@ -225,83 +223,63 @@ post-patch: .endif pre-build: - @${REINPLACE_CMD} -e 's|/bin/bash|/bin/sh|' \ - ${WRKSRC}/env.sh + @${REINPLACE_CMD} -e 's|/bin/bash|/bin/sh|' ${WRKSRC}/env.sh do-build: - cd ${WRKSRC} && ${SH} env.sh && ${KMK_CONFIG} ${LOCALBASE}/bin/kmk ${KMK_FLAGS} + cd ${WRKSRC} && ${SH} env.sh && \ + ${KMK_CONFIG} ${LOCALBASE}/bin/kmk ${KMK_FLAGS} do-install: - ${MKDIR} ${DATADIR} - (cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/sdk/bindings/xpcom && ${COPYTREE_SHARE} "idl samples" ${DATADIR}) + ${MKDIR} ${STAGEDIR}${DATADIR} + cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/sdk/bindings/xpcom && ${COPYTREE_SHARE} "idl samples" ${STAGEDIR}${DATADIR} - ${MKDIR} ${PREFIX}/include/virtualbox - (cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/sdk/bindings/xpcom/include && ${COPYTREE_SHARE} "*" ${PREFIX}/include/virtualbox) + ${MKDIR} ${STAGEDIR}${PREFIX}/include/virtualbox + cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/sdk/bindings/xpcom/include && ${COPYTREE_SHARE} "*" ${STAGEDIR}${PREFIX}/include/virtualbox - ${MKDIR} ${PREFIX}/lib/virtualbox - (cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin && ${COPYTREE_SHARE} "*.so *.gc *.r0 *.fd components VBoxExtPackHelperApp" ${PREFIX}/lib/virtualbox) + ${MKDIR} ${STAGEDIR}${PREFIX}/lib/virtualbox + cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin && ${COPYTREE_SHARE} "*.so *.gc *.r0 *.fd components VBoxExtPackHelperApp" ${STAGEDIR}${PREFIX}/lib/virtualbox .if ${PORT_OPTIONS:MNLS} - ${MKDIR} ${DATADIR}/nls - (cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/obj/VirtualBox/qtnls && ${COPYTREE_SHARE} "*.qm" ${DATADIR}/nls) + cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/obj/VirtualBox/qtnls && ${COPYTREE_SHARE} "*.qm" ${STAGEDIR}${DATADIR}/nls .endif - ${MKDIR} ${PREFIX}/bin .for f in VBoxManage VBoxNetAdpCtl VBoxNetDHCP VBoxSVC VBoxXPCOMIPCD VBoxBalloonCtrl ${VBOX_FRONTENDS} ${VBOX_WEB} - ${INSTALL_PROGRAM} ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/${f} ${PREFIX}/lib/virtualbox/ - ${LN} -sf ${PREFIX}/lib/virtualbox/${f} ${PREFIX}/bin/ -.endfor - -.for f in VBoxNetAdpCtl VBoxNetDHCP ${VBOX_FRONTENDS} - ${CHMOD} 4511 ${PREFIX}/lib/virtualbox/${f} -.endfor - -.for f in VBoxManage VBoxSVC VBoxXPCOMIPCD VBoxExtPackHelperApp VBoxBalloonCtrl - ${CHMOD} 0711 ${PREFIX}/lib/virtualbox/${f} + ${INSTALL_PROGRAM} ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/${f} ${STAGEDIR}${PREFIX}/lib/virtualbox/ + ${LN} -sf ${PREFIX}/lib/virtualbox/${f} ${STAGEDIR}${PREFIX}/bin/ .endfor .if ${PORT_OPTIONS:MVNC} - ${MKDIR} ${PREFIX}/lib/virtualbox/ExtensionPacks - ${CP} -a ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/ExtensionPacks/VNC ${PREFIX}/lib/virtualbox/ExtensionPacks + ${MKDIR} ${STAGEDIR}${PREFIX}/lib/virtualbox/ExtensionPacks/VNC/${KMK_ARCH} + ${INSTALL_DATA} ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/ExtensionPacks/VNC/ExtPack* ${STAGEDIR}${PREFIX}/lib/virtualbox/ExtensionPacks/VNC/ + ${INSTALL_LIB} ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/ExtensionPacks/VNC/${KMK_ARCH}/* ${STAGEDIR}${PREFIX}/lib/virtualbox/ExtensionPacks/VNC/${KMK_ARCH}/ .endif .if ${PORT_OPTIONS:MWEBSERVICE} - ${MKDIR} ${DATADIR}/sdk/bindings/webservice + ${MKDIR} ${STAGEDIR}${DATADIR}/sdk/bindings/webservice .for f in vboxweb.wsdl - ${INSTALL_DATA} ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/obj/webservice/${f} ${DATADIR}/sdk/bindings/webservice/ + ${INSTALL_DATA} ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/obj/webservice/${f} ${STAGEDIR}${DATADIR}/sdk/bindings/webservice/ .endfor .endif .if ${PORT_OPTIONS:MGUESTADDITIONS} - ${MKDIR} ${PREFIX}/lib/virtualbox/additions - ${INSTALL_DATA} ${DISTDIR}/${GUESTADDITIONS} ${PREFIX}/lib/virtualbox/additions/ - ${LN} -sf ${PREFIX}/lib/virtualbox/additions/${GUESTADDITIONS} ${PREFIX}/lib/virtualbox/additions/VBoxGuestAdditions.iso + ${MKDIR} ${STAGEDIR}${PREFIX}/lib/virtualbox/additions + ${INSTALL_DATA} ${DISTDIR}/${GUESTADDITIONS} ${STAGEDIR}${PREFIX}/lib/virtualbox/additions/ + ${LN} -sf ${PREFIX}/lib/virtualbox/additions/${GUESTADDITIONS} ${STAGEDIR}${PREFIX}/lib/virtualbox/additions/VBoxGuestAdditions.iso .endif .if ${PORT_OPTIONS:MPYTHON} cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/sdk/installer && \ - VBOX_INSTALL_PATH="${PREFIX}/lib/virtualbox" ${PYTHON_CMD} vboxapisetup.py install + ${SETENV} VBOX_INSTALL_PATH="${PREFIX}/lib/virtualbox" \ + ${PYTHON_CMD} vboxapisetup.py install --root=${STAGEDIR} - @${MKDIR} ${PYTHON_SITELIBDIR} - (cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/sdk/bindings/xpcom/python && ${COPYTREE_SHARE} "*" ${PYTHON_SITELIBDIR}) - ${PYTHON_CMD} -mcompileall ${PYTHON_SITELIBDIR}/xpcom/ + @${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR} + cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/sdk/bindings/xpcom/python && ${COPYTREE_SHARE} "*" ${STAGEDIR}${PYTHON_SITELIBDIR} + ${PYTHON_CMD} -mcompileall ${STAGEDIR}${PYTHON_SITELIBDIR}/xpcom/ .endif -post-install: -.for f in VBoxManage VBoxNetDHCP VBoxSVC VBoxXPCOMIPCD VBoxExtPackHelperApp VBoxBalloonCtrl ${VBOX_FRONTENDS} - ${CHOWN} root:${VBOXGROUP} ${PREFIX}/lib/virtualbox/${f} -.endfor - - @${FIND} ${DATADIR} -type d -print0 | ${XARGS} -0 ${CHMOD} 755 - @${FIND} ${PREFIX}/include/virtualbox -type d -print0 | ${XARGS} -0 ${CHMOD} 755 - @${FIND} ${PREFIX}/lib/virtualbox -type d -print0 | ${XARGS} -0 ${CHMOD} 755 - .if ${PORT_OPTIONS:MQT4} - ${MKDIR} ${PREFIX}/share/pixmaps/ - ${INSTALL_DATA} ${WRKSRC}/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_48px.png ${PREFIX}/share/pixmaps/VBox.png - ${MKDIR} ${PREFIX}/share/applications/ - ${INSTALL_DATA} ${WRKSRC}/src/VBox/Installer/freebsd/virtualbox.desktop ${PREFIX}/share/applications/virtualbox.desktop + ${INSTALL_DATA} ${WRKSRC}/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_48px.png ${STAGEDIR}${PREFIX}/share/pixmaps/VBox.png + ${INSTALL_DATA} ${WRKSRC}/src/VBox/Installer/freebsd/virtualbox.desktop ${STAGEDIR}${PREFIX}/share/applications/virtualbox.desktop .endif - @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> diff --git a/emulators/virtualbox-ose/distinfo b/emulators/virtualbox-ose/distinfo index 8eda22d67cee..50082a66d3fa 100644 --- a/emulators/virtualbox-ose/distinfo +++ b/emulators/virtualbox-ose/distinfo @@ -1,4 +1,4 @@ -SHA256 (VirtualBox-4.3.6.tar.bz2) = c547e1e32e0b06fba9ee4ca7842f8ddee8e94c64aab17c2b0d0793f0caccbb27 -SIZE (VirtualBox-4.3.6.tar.bz2) = 89609199 -SHA256 (VBoxGuestAdditions_4.3.6.iso) = 95648fcdb5d028e64145a2fe2f2f28c946d219da366389295a61fed296ca79f0 -SIZE (VBoxGuestAdditions_4.3.6.iso) = 64161792 +SHA256 (VirtualBox-4.3.8.tar.bz2) = ffabd8735bdc80753cec29d01b499769f41e083f37a3f58b3055f19d3b1b9641 +SIZE (VirtualBox-4.3.8.tar.bz2) = 90224116 +SHA256 (VBoxGuestAdditions_4.3.8.iso) = a1e58f3a15cab81b82424c6382a490bb02377d78d537a57538692fa83ce448c7 +SIZE (VBoxGuestAdditions_4.3.8.iso) = 64540672 diff --git a/emulators/virtualbox-ose/files/extrapatch-Config.kmk b/emulators/virtualbox-ose/files/extrapatch-Config.kmk new file mode 100644 index 000000000000..7df1b0883f27 --- /dev/null +++ b/emulators/virtualbox-ose/files/extrapatch-Config.kmk @@ -0,0 +1,11 @@ +--- Config.kmk.orig 2012-05-24 01:15:53.393052000 +0200 ++++ Config.kmk 2012-05-24 01:16:15.883067161 +0200 +@@ -3188,7 +3188,7 @@ + | xargs -J% objcopy % $(out) + + ## Strip debug info (comment out if debugging or something). +- objcopy --strip-debug $(out) ++# objcopy --strip-debug $(out) + endef + else # x86 + TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT = $(outbase).kld diff --git a/emulators/virtualbox-ose/files/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile b/emulators/virtualbox-ose/files/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile new file mode 100644 index 000000000000..67361da543f7 --- /dev/null +++ b/emulators/virtualbox-ose/files/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig 2012-10-18 16:23:16.000000000 +0200 ++++ src/VBox/HostDrivers/Support/freebsd/Makefile 2012-10-20 08:13:07.301179212 +0200 +@@ -27,7 +27,7 @@ + + KMOD = vboxdrv + +-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS ++CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DDEBUG + + .if (${MACHINE_ARCH} == "i386") + CFLAGS += -DRT_ARCH_X86 diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c new file mode 100644 index 000000000000..269546e610d5 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c @@ -0,0 +1,255 @@ +--- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig 2014-02-25 12:00:25.000000000 -0500 ++++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c 2014-03-01 03:23:16.000000000 -0500 +@@ -89,8 +89,7 @@ + /* + * Character device file handlers. + */ +-static d_fdopen_t VBoxGuestFreeBSDOpen; +-static d_close_t VBoxGuestFreeBSDClose; ++static d_open_t VBoxGuestFreeBSDOpen; + static d_ioctl_t VBoxGuestFreeBSDIOCtl; + static d_write_t VBoxGuestFreeBSDWrite; + static d_read_t VBoxGuestFreeBSDRead; +@@ -121,8 +120,7 @@ + { + .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE | D_NEEDMINOR, +- .d_fdopen = VBoxGuestFreeBSDOpen, +- .d_close = VBoxGuestFreeBSDClose, ++ .d_open = VBoxGuestFreeBSDOpen, + .d_ioctl = VBoxGuestFreeBSDIOCtl, + .d_read = VBoxGuestFreeBSDRead, + .d_write = VBoxGuestFreeBSDWrite, +@@ -130,106 +128,45 @@ + .d_name = DEVICE_NAME + }; + ++/** Device structure. */ ++static struct cdev *g_pDev; + /** Device extention & session data association structure. */ + static VBOXGUESTDEVEXT g_DevExt; +-/** List of cloned device. Managed by the kernel. */ +-static struct clonedevs *g_pVBoxGuestFreeBSDClones; +-/** The dev_clone event handler tag. */ +-static eventhandler_tag g_VBoxGuestFreeBSDEHTag; + /** Reference counter */ + static volatile uint32_t cUsers; + /** selinfo structure used for polling. */ + static struct selinfo g_SelInfo; + +-/** +- * DEVFS event handler. +- */ +-static void VBoxGuestFreeBSDClone(void *pvArg, struct ucred *pCred, char *pszName, int cchName, struct cdev **ppDev) ++static void VBoxGuestFreeBSDDtr(void *pSession) + { +- int iUnit; +- int rc; +- +- Log(("VBoxGuestFreeBSDClone: pszName=%s ppDev=%p\n", pszName, ppDev)); +- +- /* +- * One device node per user, si_drv1 points to the session. +- * /dev/vboxguest<N> where N = {0...255}. +- */ +- if (!ppDev) +- return; +- if (strcmp(pszName, "vboxguest") == 0) +- iUnit = -1; +- else if (dev_stdclone(pszName, NULL, "vboxguest", &iUnit) != 1) +- return; +- if (iUnit >= 256) +- { +- Log(("VBoxGuestFreeBSDClone: iUnit=%d >= 256 - rejected\n", iUnit)); +- return; +- } +- +- Log(("VBoxGuestFreeBSDClone: pszName=%s iUnit=%d\n", pszName, iUnit)); +- +- rc = clone_create(&g_pVBoxGuestFreeBSDClones, &g_VBoxGuestFreeBSDChrDevSW, &iUnit, ppDev, 0); +- Log(("VBoxGuestFreeBSDClone: clone_create -> %d; iUnit=%d\n", rc, iUnit)); +- if (rc) +- { +- *ppDev = make_dev(&g_VBoxGuestFreeBSDChrDevSW, +- iUnit, +- UID_ROOT, +- GID_WHEEL, +- 0664, +- "vboxguest%d", iUnit); +- if (*ppDev) +- { +- dev_ref(*ppDev); +- (*ppDev)->si_flags |= SI_CHEAPCLONE; +- Log(("VBoxGuestFreeBSDClone: Created *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n", +- *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2)); +- (*ppDev)->si_drv1 = (*ppDev)->si_drv2 = NULL; +- } +- else +- Log(("VBoxGuestFreeBSDClone: make_dev iUnit=%d failed\n", iUnit)); +- } +- else +- Log(("VBoxGuestFreeBSDClone: Existing *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n", +- *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2)); ++ VBoxGuestCloseSession(&g_DevExt, pSession); ++ ASMAtomicDecU32(&cUsers); + } + + /** + * File open handler + * + */ +-#if __FreeBSD_version >= 700000 +-static int VBoxGuestFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd, struct file *pFd) +-#else +-static int VBoxGuestFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd) +-#endif ++static int VBoxGuestFreeBSDOpen(struct cdev *pDev, int fOpen, int DevType, struct thread *pTd) + { +- int rc; +- PVBOXGUESTSESSION pSession; ++ PVBOXGUESTSESSION pSession; ++ int rc; + + LogFlow((DEVICE_NAME ":VBoxGuestFreeBSDOpen\n")); + + /* +- * Try grab it (we don't grab the giant, remember). +- */ +- if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, (void *)0x42, NULL)) +- return EBUSY; +- +- /* + * Create a new session. + */ + rc = VBoxGuestCreateUserSession(&g_DevExt, &pSession); + if (RT_SUCCESS(rc)) + { +- if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42)) +- { +- Log((DEVICE_NAME ":VBoxGuestFreeBSDOpen success: g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf())); ++ Log((DEVICE_NAME ":VBoxGuestFreeBSDOpen success: g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf())); ++ rc = devfs_set_cdevpriv(pSession, VBoxGuestFreeBSDDtr); ++ if (rc) ++ VBoxGuestCloseSession(&g_DevExt, pSession); ++ else + ASMAtomicIncU32(&cUsers); +- return 0; +- } +- +- VBoxGuestCloseSession(&g_DevExt, pSession); ++ return rc; + } + + LogRel((DEVICE_NAME ":VBoxGuestFreeBSDOpen: failed. rc=%d\n", rc)); +@@ -237,47 +174,19 @@ + } + + /** +- * File close handler +- * +- */ +-static int VBoxGuestFreeBSDClose(struct cdev *pDev, int fFile, int DevType, struct thread *pTd) +-{ +- PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1; +- Log(("VBoxGuestFreeBSDClose: fFile=%#x pSession=%p\n", fFile, pSession)); +- +- /* +- * Close the session if it's still hanging on to the device... +- */ +- if (VALID_PTR(pSession)) +- { +- VBoxGuestCloseSession(&g_DevExt, pSession); +- if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, NULL, pSession)) +- Log(("VBoxGuestFreeBSDClose: si_drv1=%p expected %p!\n", pDev->si_drv1, pSession)); +- ASMAtomicDecU32(&cUsers); +- /* Don't use destroy_dev here because it may sleep resulting in a hanging user process. */ +- destroy_dev_sched(pDev); +- } +- else +- Log(("VBoxGuestFreeBSDClose: si_drv1=%p!\n", pSession)); +- return 0; +-} +- +-/** + * IOCTL handler + * + */ + static int VBoxGuestFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd) + { +- LogFlow((DEVICE_NAME ":VBoxGuestFreeBSDIOCtl\n")); ++ PVBOXGUESTSESSION pSession; ++ int rc; + +- int rc = 0; ++ LogFlow((DEVICE_NAME ":VBoxGuestFreeBSDIOCtl\n")); + +- /* +- * Validate the input. +- */ +- PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1; +- if (RT_UNLIKELY(!VALID_PTR(pSession))) +- return EINVAL; ++ rc = devfs_get_cdevpriv((void **)&pSession); ++ if (rc) ++ return rc; + + /* + * Validate the request wrapper. +@@ -361,12 +270,14 @@ + + static int VBoxGuestFreeBSDPoll (struct cdev *pDev, int fEvents, struct thread *td) + { +- int fEventsProcessed; ++ PVBOXGUESTSESSION pSession; ++ int fEventsProcessed, rc; + + LogFlow((DEVICE_NAME "::Poll: fEvents=%d\n", fEvents)); + +- PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1; +- if (RT_UNLIKELY(!VALID_PTR(pSession))) { ++ rc = devfs_get_cdevpriv((void **)&pSession); ++ if (rc) ++ { + Log((DEVICE_NAME "::Poll: no state data for %s\n", devtoname(pDev))); + return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); + } +@@ -407,10 +318,7 @@ + /* + * Reverse what we did in VBoxGuestFreeBSDAttach. + */ +- if (g_VBoxGuestFreeBSDEHTag != NULL) +- EVENTHANDLER_DEREGISTER(dev_clone, g_VBoxGuestFreeBSDEHTag); +- +- clone_cleanup(&g_pVBoxGuestFreeBSDClones); ++ destroy_dev(g_pDev); + + VBoxGuestFreeBSDRemoveIRQ(pDevice, pState); + +@@ -562,18 +470,21 @@ + if (RT_SUCCESS(rc)) + { + /* +- * Configure device cloning. ++ * Configure device. + */ +- clone_setup(&g_pVBoxGuestFreeBSDClones); +- g_VBoxGuestFreeBSDEHTag = EVENTHANDLER_REGISTER(dev_clone, VBoxGuestFreeBSDClone, 0, 1000); +- if (g_VBoxGuestFreeBSDEHTag) ++ g_pDev = make_dev(&g_VBoxGuestFreeBSDChrDevSW, ++ 0, ++ UID_ROOT, ++ GID_WHEEL, ++ 0664, ++ "vboxguest"); ++ if (g_pDev) + { + printf(DEVICE_NAME ": loaded successfully\n"); + return 0; + } + +- printf(DEVICE_NAME ": EVENTHANDLER_REGISTER(dev_clone,,,) failed\n"); +- clone_cleanup(&g_pVBoxGuestFreeBSDClones); ++ printf(DEVICE_NAME ": make_dev failed\n"); + VBoxGuestFreeBSDRemoveIRQ(pDevice, pState); + } + else diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile new file mode 100644 index 000000000000..ed9f2b80ce46 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile @@ -0,0 +1,10 @@ +--- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig 2013-11-29 14:20:37.000000000 -0500 ++++ src/VBox/Additions/common/VBoxGuest/freebsd/Makefile 2013-12-15 00:12:59.000000000 -0500 +@@ -155,6 +155,7 @@ + SRCS += \ + semspinmutex-r0drv-generic.c \ + mpnotification-r0drv-generic.c \ ++ threadctxhooks-r0drv-generic.c \ + RTMpIsCpuWorkPending-r0drv-generic.c + + .PATH: ${.CURDIR}/VBox diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest new file mode 100644 index 000000000000..cde44a17359a --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest @@ -0,0 +1,10 @@ +--- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig 2014-01-04 05:34:34.000000000 +0000 ++++ src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest 2014-01-04 05:34:41.000000000 +0000 +@@ -185,6 +185,7 @@ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h=>r0drv/freebsd/sleepqueue-r0drv-freebsd.h \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c=>r0drv/generic/semspinmutex-r0drv-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp=>r0drv/generic/mpnotification-r0drv-generic.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/threadctxhooks-r0drv-generic.cpp=>r0drv/generic/threadctxhooks-r0drv-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp=>r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/memobj-r0drv.cpp=>r0drv/memobj-r0drv.c \ + ${PATH_ROOT}/src/VBox/Runtime/VBox/log-vbox.cpp=>VBox/log-vbox.c \ diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuestLib-Makefile.kmk b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuestLib-Makefile.kmk new file mode 100644 index 000000000000..71e85c9b2012 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuestLib-Makefile.kmk @@ -0,0 +1,18 @@ +--- src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk.orig 2010-10-07 11:37:10.000000000 +0200 ++++ src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk 2010-10-07 11:36:16.000000000 +0200 +@@ -140,6 +140,7 @@ + # the X server runtime instead of IPRT, for use with old servers where the + # C library is not available. + # ++ifdef VBOX_WITH_X11_ADDITIONS + VBoxGuestR3LibXFree86_TEMPLATE = VBOXGUESTR3XF86LIB + VBoxGuestR3LibXFree86_DEFS = \ + VBOX_WITH_HGCM \ +@@ -163,6 +164,7 @@ + $(VBOX_PATH_X11_XFREE_4_3)/exports/include/X11 + + VBoxGuestR3LibRuntimeXF86.cpp_CXXFLAGS = -Wno-shadow ++endif + + include $(KBUILD_PATH)/subfooter.kmk + diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Additions-freebsd-Makefile b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-freebsd-Makefile new file mode 100644 index 000000000000..0908c1b15eb2 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-freebsd-Makefile @@ -0,0 +1,19 @@ +--- src/VBox/Additions/freebsd/Makefile.orig 2014-02-25 12:00:30.000000000 -0500 ++++ src/VBox/Additions/freebsd/Makefile 2014-03-03 15:27:32.000000000 -0500 +@@ -19,14 +19,14 @@ + + all: + @echo "*** Building 'vboxguest' module ***" +- @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxguest ++ @$(MAKE) CC=cc LDFLAGS= KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxguest + @if [ -f vboxguest/vboxguest.ko ]; then \ + cp vboxguest/vboxguest.ko .; \ + fi + @echo + @if [ -d vboxvfs ]; then \ + echo "*** Building 'vboxvfs' module ***"; \ +- $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvfs; \ ++ $(MAKE) CC=cc LDFLAGS= KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvfs; \ + if [ -f vboxvfs/vboxvfs.ko ]; then \ + cp vboxvfs/vboxvfs.ko .; \ + fi; \ diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient new file mode 100644 index 000000000000..edb9514f95c5 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient @@ -0,0 +1,27 @@ +--- src/VBox/Additions/x11/Installer/98vboxadd-xclient.orig 2010-09-10 14:24:55.000000000 +0200 ++++ src/VBox/Additions/x11/Installer/98vboxadd-xclient 2010-12-29 20:42:00.000000000 +0100 +@@ -28,8 +28,8 @@ + xorgbin=Xorg + found=`which Xorg | grep "no Xorg"` + if test ! -z "$found"; then +- if test -f "/usr/X11/bin/Xorg"; then +- xorgbin=/usr/X11/bin/Xorg ++ if test -f "/usr/local/bin/Xorg"; then ++ xorgbin=/usr/local/bin/Xorg + else + exit 1 + fi +@@ -40,9 +40,9 @@ + no_display=1 + fi + +-/usr/bin/VBoxClient --clipboard +-/usr/bin/VBoxClient --checkhostversion ++/usr/local/bin/VBoxClient --clipboard ++/usr/local/bin/VBoxClient --checkhostversion + test -z "$no_display" && +- /usr/bin/VBoxClient --display ++ /usr/local/bin/VBoxClient --display + test -z "$no_display" && +- /usr/bin/VBoxClient --seamless ++ /usr/local/bin/VBoxClient --seamless diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-vboxclient.desktop b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-vboxclient.desktop new file mode 100644 index 000000000000..fadd31bc4d48 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-vboxclient.desktop @@ -0,0 +1,10 @@ +--- src/VBox/Additions/x11/Installer/vboxclient.desktop.orig 2009-06-12 12:34:57.000000000 +0000 ++++ src/VBox/Additions/x11/Installer/vboxclient.desktop 2011-01-13 22:07:37.000000000 +0000 +@@ -8,6 +8,6 @@ + Comment=VirtualBox User Session Services + Comment[it]=Servizi di sessione utente di VirtualBox + Comment[pl]=Usługi sesji użytkownika VirtualBox +-Exec=/usr/bin/VBoxClient-all ++Exec=/usr/local/bin/VBoxClient-all + X-GNOME-Autostart-enabled=true + X-KDE-autostart-after=panel diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-vboxvideo-Makefile.kmk b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-vboxvideo-Makefile.kmk new file mode 100644 index 000000000000..7f5ea7b042dc --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-vboxvideo-Makefile.kmk @@ -0,0 +1,138 @@ +--- src/VBox/Additions/x11/vboxvideo/Makefile.kmk.orig 2014-02-25 12:00:33.000000000 -0500 ++++ src/VBox/Additions/x11/vboxvideo/Makefile.kmk 2014-02-26 16:10:28.000000000 -0500 +@@ -33,7 +33,7 @@ + vboxvideo_13_DEFS := $(vboxvideo_70_DEFS) VBOXVIDEO_13 + vboxvideo_15_DEFS := \ + $(vboxvideo_13_DEFS) NO_ANSIC PCIACCESS XSERVER_LIBPCIACCESS +-if1of ($(KBUILD_TARGET), linux solaris) ++if1of ($(KBUILD_TARGET), freebsd linux solaris) + vboxvideo_15_DEFS += \ + VBOX_DRI + endif +@@ -198,7 +198,7 @@ + vboxvideo_drv_15_TEMPLATE = VBOXGUESTR3XORGMOD + vboxvideo_drv_15_CFLAGS := $(vboxvideo_drv_70_CFLAGS) + vboxvideo_drv_15_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100503000 +-if1of ($(KBUILD_TARGET), linux solaris) ++if1of ($(KBUILD_TARGET), freebsd linux solaris) + vboxvideo_drv_15_DEFS += \ + VBOX_DRI_OLD + endif +@@ -207,7 +207,7 @@ + $(VBOX_PATH_X11_ROOT)/xorg-server-1.5.3 + vboxvideo_drv_15_INCS += $(PATH_ROOT)/src/VBox/Runtime/include + vboxvideo_drv_15_SOURCES = $(vboxvideo_drv_13_SOURCES) +-if1of ($(KBUILD_TARGET), linux solaris) ++if1of ($(KBUILD_TARGET), freebsd linux solaris) + vboxvideo_drv_15_SOURCES += \ + vboxvideo_dri.c + endif +@@ -220,7 +220,7 @@ + vboxvideo_drv_16_TEMPLATE = VBOXGUESTR3XORGMOD + vboxvideo_drv_16_CFLAGS := $(vboxvideo_drv_70_CFLAGS) + vboxvideo_drv_16_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100600000 +-if1of ($(KBUILD_TARGET), linux solaris) ++if1of ($(KBUILD_TARGET), freebsd linux solaris) + vboxvideo_drv_16_DEFS += \ + VBOX_DRI_OLD + endif +@@ -238,11 +238,19 @@ + vboxvideo_drv_17_TEMPLATE = VBOXGUESTR3XORGMOD + vboxvideo_drv_17_CFLAGS := $(vboxvideo_drv_70_CFLAGS) + vboxvideo_drv_17_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100699000 ++if1of ($(KBUILD_TARGET), freebsd) ++ vboxvideo_drv_17_DEFS += \ ++ VBOX_DRI_OLD ++endif + vboxvideo_drv_17_INCS = \ + $(vboxvideo_xorg_INCS) \ + $(VBOX_PATH_X11_ROOT)/xorg-server-1.7.7 + vboxvideo_drv_17_INCS += $(PATH_ROOT)/src/VBox/Runtime/include + vboxvideo_drv_17_SOURCES := $(vboxvideo_drv_13_SOURCES) ++if1of ($(KBUILD_TARGET), freebsd) ++ vboxvideo_drv_17_SOURCES += \ ++ vboxvideo_dri.c ++endif + if1of ($(KBUILD_TARGET), linux solaris) + vboxvideo_drv_17_SOURCES += \ + vboxvideo_dri2.c +@@ -256,6 +264,10 @@ + vboxvideo_drv_18_TEMPLATE = VBOXGUESTR3XORGMOD + vboxvideo_drv_18_CFLAGS := $(vboxvideo_drv_70_CFLAGS) + vboxvideo_drv_18_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100800000 ++if1of ($(KBUILD_TARGET), freebsd) ++ vboxvideo_drv_18_DEFS += \ ++ VBOX_DRI_OLD ++endif + vboxvideo_drv_18_INCS = \ + $(vboxvideo_xorg_INCS) \ + $(VBOX_PATH_X11_ROOT)/xorg-server-1.8.0 +@@ -270,6 +282,10 @@ + vboxvideo_drv_19_TEMPLATE = VBOXGUESTR3XORGMOD + vboxvideo_drv_19_CFLAGS := $(vboxvideo_drv_70_CFLAGS) + vboxvideo_drv_19_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100900000 ++if1of ($(KBUILD_TARGET), freebsd) ++ vboxvideo_drv_19_DEFS += \ ++ VBOX_DRI_OLD ++endif + vboxvideo_drv_19_INCS = \ + $(vboxvideo_xorg_INCS) \ + $(VBOX_PATH_X11_ROOT)/xorg-server-1.9.0 +@@ -288,7 +304,11 @@ + $(vboxvideo_xorg_INCS) \ + $(VBOX_PATH_X11_ROOT)/xorg-server-1.10.0 + vboxvideo_drv_110_INCS += $(PATH_ROOT)/src/VBox/Runtime/include +-vboxvideo_drv_110_SOURCES := $(vboxvideo_drv_17_SOURCES) ++vboxvideo_drv_110_SOURCES := $(vboxvideo_drv_13_SOURCES) ++if1of ($(KBUILD_TARGET), freebsd linux solaris) ++ vboxvideo_drv_110_SOURCES += \ ++ vboxvideo_dri2.c ++endif + + + # +@@ -302,7 +322,7 @@ + $(vboxvideo_xorg_INCS) \ + $(VBOX_PATH_X11_ROOT)/xorg-server-1.11.0 + vboxvideo_drv_111_INCS += $(PATH_ROOT)/src/VBox/Runtime/include +-vboxvideo_drv_111_SOURCES := $(vboxvideo_drv_17_SOURCES) ++vboxvideo_drv_111_SOURCES := $(vboxvideo_drv_110_SOURCES) + + + # +@@ -316,7 +336,7 @@ + $(vboxvideo_xorg_INCS) \ + $(VBOX_PATH_X11_ROOT)/xorg-server-1.12.0 + vboxvideo_drv_112_INCS += $(PATH_ROOT)/src/VBox/Runtime/include +-vboxvideo_drv_112_SOURCES := $(vboxvideo_drv_17_SOURCES) ++vboxvideo_drv_112_SOURCES := $(vboxvideo_drv_110_SOURCES) + + + # +@@ -330,7 +350,7 @@ + $(vboxvideo_xorg_INCS) \ + $(VBOX_PATH_X11_ROOT)/xorg-server-1.13.0 + vboxvideo_drv_113_INCS += $(PATH_ROOT)/src/VBox/Runtime/include +-vboxvideo_drv_113_SOURCES := $(vboxvideo_drv_17_SOURCES) ++vboxvideo_drv_113_SOURCES := $(vboxvideo_drv_110_SOURCES) + + + # +@@ -344,7 +364,7 @@ + $(vboxvideo_xorg_INCS) \ + $(VBOX_PATH_X11_ROOT)/xorg-server-1.14.0 + vboxvideo_drv_114_INCS += $(PATH_ROOT)/src/VBox/Runtime/include +-vboxvideo_drv_114_SOURCES := $(vboxvideo_drv_17_SOURCES) ++vboxvideo_drv_114_SOURCES := $(vboxvideo_drv_110_SOURCES) + + + # +@@ -358,7 +378,7 @@ + $(vboxvideo_xorg_INCS) \ + $(VBOX_PATH_X11_ROOT)/xorg-server-1.15.0 + vboxvideo_drv_115_INCS += $(PATH_ROOT)/src/VBox/Runtime/include +-vboxvideo_drv_115_SOURCES := $(vboxvideo_drv_17_SOURCES) ++vboxvideo_drv_115_SOURCES := $(vboxvideo_drv_110_SOURCES) + + + ifdef VBOX_USE_SYSTEM_XORG_HEADERS diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Network-slirp-resolv_conf_parser.c b/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Network-slirp-resolv_conf_parser.c new file mode 100644 index 000000000000..0248be948790 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Network-slirp-resolv_conf_parser.c @@ -0,0 +1,11 @@ +--- src/VBox/Devices/Network/slirp/resolv_conf_parser.c.orig 2014-01-30 22:19:47.429683181 +0400 ++++ src/VBox/Devices/Network/slirp/resolv_conf_parser.c 2014-01-30 22:22:08.149672985 +0400 +@@ -15,6 +15,8 @@ + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + */ + ++#include <sys/socket.h> ++ + #include <iprt/assert.h> + #include <iprt/initterm.h> + #include <iprt/net.h> diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile b/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile new file mode 100644 index 000000000000..56fa83e858e0 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile @@ -0,0 +1,10 @@ +--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig 2013-10-17 00:51:57.724397794 +0400 ++++ src/VBox/HostDrivers/Support/freebsd/Makefile 2013-10-17 00:52:05.491398026 +0400 +@@ -170,6 +170,7 @@ + SRCS += \ + semspinmutex-r0drv-generic.c \ + mpnotification-r0drv-generic.c \ ++ threadctxhooks-r0drv-generic.c \ + RTMpIsCpuWorkPending-r0drv-generic.c + + .PATH: ${.CURDIR}/VBox diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk b/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk new file mode 100644 index 000000000000..01d25b3ac02a --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk @@ -0,0 +1,25 @@ +Fix kmod panic when VIMAGE is disabled in the kernel and port + +Submitted by: Gleb Kurtsou <gleb@freebsd.org> +--- src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk.orig 2013-04-12 03:38:10.000000000 -0700 ++++ src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk 2013-06-11 21:24:05.000000000 -0700 +@@ -143,12 +143,15 @@ + $$(if $$(eq $$(VBoxNetAdp/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \ + | $$(dir $$@) + $(QUIET)$(RM) -f -- $@ +- ifndef VBOX_WITH_HARDENING +- $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $< +- else + $(QUIET)$(CP) -f $< $@ ++ ifndef VBOX_WITH_HARDENING ++ $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@ ++ ${QUIET}$(MV) -f $@.tmp $@ ++ endif ++ ifndef VBOX_WITH_NETFLT_VIMAGE ++ $(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output $@.tmp $@ ++ ${QUIET}$(MV) -f $@.tmp $@ + endif +- + endif # freebsd + + include $(FILE_KBUILD_SUB_FOOTER) diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c b/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c new file mode 100644 index 000000000000..6cb5a1ebd30c --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c @@ -0,0 +1,72 @@ +Add VLAN trunking support to vboxnetflt + +See: http://lists.freebsd.org/pipermail/freebsd-emulation/2012-April/009698.html +See: http://lists.freebsd.org/pipermail/freebsd-emulation/2013-May/010605.html +Submitted by: Landon J Fuller <landonf at plausible.coop> +--- ./src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig 2013-04-12 06:38:11.000000000 -0400 ++++ ./src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2013-05-25 20:14:52.152180452 -0400 +@@ -51,6 +51,7 @@ + #include <net/if_dl.h> + #include <net/if_types.h> + #include <net/ethernet.h> ++#include <net/if_vlan_var.h> + + #include <netgraph/ng_message.h> + #include <netgraph/netgraph.h> +@@ -427,6 +428,8 @@ + struct ifnet *ifp = pThis->u.s.ifp; + unsigned int cSegs = 0; + bool fDropIt = false, fActive; ++ bool is_vl_tagged = false; ++ uint16_t vl_tag; + PINTNETSG pSG; + + VBOXCURVNET_SET(ifp->if_vnet); +@@ -439,6 +442,19 @@ + if (m == NULL) + break; + ++ /* Prepend a VLAN header for consumption by the virtual switch */ ++ if (m->m_flags & M_VLANTAG) { ++ vl_tag = m->m_pkthdr.ether_vtag; ++ is_vl_tagged = true; ++ ++ m = ether_vlanencap(m, m->m_pkthdr.ether_vtag); ++ if (m == NULL) { ++ printf("vboxflt: unable to prepend VLAN header\n"); ++ break; ++ } ++ m->m_flags &= ~M_VLANTAG; ++ } ++ + for (m0 = m; m0 != NULL; m0 = m0->m_next) + if (m0->m_len > 0) + cSegs++; +@@ -453,6 +469,27 @@ + vboxNetFltFreeBSDMBufToSG(pThis, m, pSG, cSegs, 0); + fDropIt = pThis->pSwitchPort->pfnRecv(pThis->pSwitchPort, NULL /* pvIf */, pSG, INTNETTRUNKDIR_WIRE); + RTMemTmpFree(pSG); ++ ++ /* Restore the VLAN flags before re-injecting the packet */ ++ if (is_vl_tagged && !fDropIt) { ++ struct ether_vlan_header *vl_hdr; ++ ++ /* This shouldn't fail, as the header was just prepended */ ++ if (m->m_len < sizeof(*vl_hdr) && (m = m_pullup(m, sizeof(*vl_hdr))) == NULL) { ++ printf("vboxflt: unable to pullup VLAN header\n"); ++ m_freem(m); ++ break; ++ } ++ ++ /* Copy the MAC dhost/shost over the 802.1q field */ ++ vl_hdr = mtod(m, struct ether_vlan_header *); ++ bcopy((char *)vl_hdr, (char *)vl_hdr + ETHER_VLAN_ENCAP_LEN, ETHER_HDR_LEN - ETHER_TYPE_LEN); ++ m_adj(m, ETHER_VLAN_ENCAP_LEN); ++ ++ m->m_pkthdr.ether_vtag = vl_tag; ++ m->m_flags |= M_VLANTAG; ++ } ++ + if (fDropIt) + m_freem(m); + else diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-NetworkServices-NAT-VBoxNetLwipNAT.cpp b/emulators/virtualbox-ose/files/patch-src-VBox-NetworkServices-NAT-VBoxNetLwipNAT.cpp new file mode 100644 index 000000000000..aff879d1cd90 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-NetworkServices-NAT-VBoxNetLwipNAT.cpp @@ -0,0 +1,11 @@ +--- src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp.orig 2014-02-25 12:09:19.000000000 -0500 ++++ src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp 2014-03-03 14:50:41.000000000 -0500 +@@ -73,6 +73,8 @@ + #include <vector> + #include <string> + ++#include <stdio.h> ++ + #include "../NetLib/VBoxNetLib.h" + #include "../NetLib/VBoxNetBaseService.h" + #include "../NetLib/utils.h" diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h b/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h new file mode 100644 index 000000000000..e1ae4d7ea855 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h @@ -0,0 +1,20 @@ +Without this patch any waits for periods shorter than a single tick return +immediately leading to a lot of unnecessary spinning. For example, I observe that +my guest's idle loop does a lot of sleeps with periods slightly shorter than 1 ms +(1/hz), e.g. 900us. All that waiting turns into pure spinning and VirtualBox eats +100% of a core. +The patch improves the situation significantly. Also, it (approximately) follows +what tvtohz does. + +Submitted by: Andriy Gapon <avg@FreeBSD.org> +--- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig 2012-12-19 19:27:29.000000000 +0100 ++++ src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h 2012-12-20 12:07:48.941861966 +0100 +@@ -82,6 +82,8 @@ + uint64_t cTicks = ASMMultU64ByU32DivByU32(uTimeout, hz, UINT32_C(1000000000)); + if (cTicks >= INT_MAX) + return RTSEMWAIT_FLAGS_INDEFINITE; ++ else if (cTicks == 0 && uTimeout > 0) ++ pWait->iTimeout = 1; + else + pWait->iTimeout = (int)cTicks; + #endif diff --git a/emulators/virtualbox-ose/pkg-plist b/emulators/virtualbox-ose/pkg-plist index e9bb8a41cd07..032c2f5a65c8 100644 --- a/emulators/virtualbox-ose/pkg-plist +++ b/emulators/virtualbox-ose/pkg-plist @@ -13,24 +13,48 @@ bin/VBoxXPCOMIPCD %%WEBSERVICE%%bin/webtest lib/virtualbox/DBGCPlugInDiggers.so lib/virtualbox/VBoxAuth.so +@group %%VBOXGROUP%% +@mode 4511 lib/virtualbox/VBoxAutostart +@group +@mode lib/virtualbox/VBoxAuthSimple.so +@group %%VBOXGROUP%% +@mode 0711 lib/virtualbox/VBoxBalloonCtrl +@group +@mode %%QT4%%lib/virtualbox/VBoxDbg.so lib/virtualbox/VBoxDD.so lib/virtualbox/VBoxDD2.so lib/virtualbox/VBoxDDU.so lib/virtualbox/VBoxEFI32.fd lib/virtualbox/VBoxEFI64.fd +@group %%VBOXGROUP%% +@mode 0711 lib/virtualbox/VBoxExtPackHelperApp +@group +@mode lib/virtualbox/VBoxGuestControlSvc.so lib/virtualbox/VBoxGuestPropSvc.so +@group %%VBOXGROUP%% +@mode 4511 lib/virtualbox/VBoxHeadless +@group +@mode lib/virtualbox/VBoxHeadless.so %%X11%%lib/virtualbox/VBoxKeyboard.so +@group %%VBOXGROUP%% +@mode 0711 lib/virtualbox/VBoxManage +@group +@mode +@mode 4511 lib/virtualbox/VBoxNetAdpCtl +@group %%VBOXGROUP%% lib/virtualbox/VBoxNetDHCP +@group +@mode lib/virtualbox/VBoxNetDHCP.so lib/virtualbox/VBoxNetNAT.so %%X11%%lib/virtualbox/VBoxOGLhostcrutil.so @@ -38,13 +62,25 @@ lib/virtualbox/VBoxNetNAT.so %%X11%%lib/virtualbox/VBoxOGLrenderspu.so %%PYTHON%%lib/virtualbox/VBoxPython.so lib/virtualbox/VBoxREM.so +@group %%VBOXGROUP%% +@mode 4511 %%QT4%%lib/virtualbox/VBoxTestOGL +@group +@mode %%I386%%lib/virtualbox/VBoxREM32.so %%I386%%lib/virtualbox/VBoxREM64.so lib/virtualbox/VBoxRT.so +@group %%VBOXGROUP%% +@mode 4511 %%X11%%lib/virtualbox/VBoxSDL +@group +@mode %%X11%%lib/virtualbox/VBoxSDL.so +@group %%VBOXGROUP%% +@mode 0711 lib/virtualbox/VBoxSVC +@group +@mode lib/virtualbox/VBoxSharedClipboard.so %%X11%%lib/virtualbox/VBoxSharedCrOpenGL.so lib/virtualbox/VBoxSharedFolders.so @@ -52,8 +88,16 @@ lib/virtualbox/VBoxVMM.so lib/virtualbox/VBoxVMMPreload.so lib/virtualbox/VBoxXPCOM.so lib/virtualbox/VBoxXPCOMC.so +@group %%VBOXGROUP%% +@mode 0711 lib/virtualbox/VBoxXPCOMIPCD +@group +@mode +@group %%VBOXGROUP%% +@mode 4511 %%QT4%%lib/virtualbox/VirtualBox +@group +@mode %%QT4%%lib/virtualbox/VirtualBox.so lib/virtualbox/VBoxDD2GC.gc lib/virtualbox/VBoxDDGC.gc @@ -615,14 +659,13 @@ include/virtualbox/xpcom/xpcom-config.h @dirrm include/virtualbox/nsprpub @dirrm include/virtualbox/ipcd @dirrm include/virtualbox -%%NLS%%@dirrm %%DATADIR%%/nls %%WEBSERVICE%%@dirrm %%DATADIR%%/sdk/bindings/webservice %%WEBSERVICE%%@dirrm %%DATADIR%%/sdk/bindings %%WEBSERVICE%%@dirrm %%DATADIR%%/sdk @dirrm %%DATADIR%%/samples +%%NLS%%@dirrm %%DATADIR%%/nls @dirrm %%DATADIR%%/idl @dirrm %%DATADIR%% -%%QT4%%@dirrmtry share/applications @dirrm lib/virtualbox/components %%VNC%%@dirrm lib/virtualbox/ExtensionPacks/VNC/%%ARCH%% %%VNC%%@dirrm lib/virtualbox/ExtensionPacks/VNC |