diff --git a/UPDATING b/UPDATING index b44c2f354a8d..b011b61e8199 100644 --- a/UPDATING +++ b/UPDATING @@ -5,6 +5,23 @@ they are unavoidable. You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. +20110522: + AFFECTS: users of emulators/virtualbox-ose + AUTHOR: vbox@FreeBSD.org + + The emulators/virtualbox-ose port has been updated to 4.0.8. If you + want to stay with VirtualBox 3.2.x please run: + + # portmaster -o emulators/virtualbox-ose-kmod-legacy emulators/virtualbox-ose-kmod + # portmaster -o emulators/virtualbox-ose-legacy emulators/virtualbox-ose + or + # portupgrade -o emulators/virtualbox-ose-kmod-legacy emulators/virtualbox-ose-kmod + # portupgrade -o emulators/virtualbox-ose-legacy emulators/virtualbox-ose + + The emulators/virtualbox-ose-legacy port will always include the + latest legacy version as a fallback if you hit a serious regression + in the latest version. + 20110517: AFFECTS: users of lang/perl* AUTHOR: skv@FreeBSD.org diff --git a/emulators/virtualbox-ose-kmod/Makefile b/emulators/virtualbox-ose-kmod/Makefile index ce68f65d0f59..60b99e139a71 100644 --- a/emulators/virtualbox-ose-kmod/Makefile +++ b/emulators/virtualbox-ose-kmod/Makefile @@ -6,15 +6,13 @@ # PORTNAME= virtualbox-ose -DISTVERSION= 3.2.12 -PORTREVISION= 1 +DISTVERSION= 4.0.8 CATEGORIES= emulators kld MASTER_SITES= http://tmp.chruetertee.ch/ \ http://freebsd.unixfreunde.de/sources/ \ - http://disasterarea.chruetertee.ch/ \ - http://mirror.4bit.ws/ + http://disasterarea.chruetertee.ch/ PKGNAMESUFFIX= -kmod -DISTNAME= VirtualBox-${DISTVERSION}-OSE +DISTNAME= VirtualBox-${DISTVERSION} MAINTAINER= vbox@FreeBSD.org COMMENT= VirtualBox kernel module for FreeBSD @@ -38,9 +36,11 @@ CONFIGURE_ARGS+=--with-gcc="${CC}" --with-g++="${CXX}" --nofatal \ --disable-alsa --disable-dbus --disable-python \ --build-headless -CONFLICTS= bcc-[0-9]* virtualbox-ose-kmod-devel-3* +CONFLICTS= bcc-[0-9]* +CONFLICTS_INSTALL= virtualbox-ose-kmod-devel-[3,4]* virtualbox-ose-kmod-legacy-[3,4]* -OPTIONS= DEBUG "Build with debugging symbols" off +OPTIONS= DEBUG "Build with debugging symbols" off \ + VIMAGE "Build with VIMAGE support" off .include @@ -72,11 +72,18 @@ IGNORE= requires kernel sources .include +.if ${OSVERSION} < 800500 && defined(WITH_VIMAGE) +IGNORE= newer kernel is required to build with VIMAGE +.endif + post-patch: @${ECHO} 'VBOX_WITH_VBOXDRV = 1' > ${WRKSRC}/LocalConfig.kmk @${ECHO} 'VBOX_WITH_NETFLT = 1' >> ${WRKSRC}/LocalConfig.kmk @${ECHO} 'VBOX_WITH_NETADP = 1' >> ${WRKSRC}/LocalConfig.kmk @${ECHO} 'VBOX_WITH_ADDITIONS =' >> ${WRKSRC}/LocalConfig.kmk +.if defined(WITH_VIMAGE) + @${ECHO} 'VBOX_WITH_NETFLT_VIMAGE = 1' >> ${WRKSRC}/LocalConfig.kmk +.endif @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Config.kmk \ ${WRKSRC}/configure diff --git a/emulators/virtualbox-ose-kmod/distinfo b/emulators/virtualbox-ose-kmod/distinfo index 8a9c1e15c918..38dcc883d133 100644 --- a/emulators/virtualbox-ose-kmod/distinfo +++ b/emulators/virtualbox-ose-kmod/distinfo @@ -1,2 +1,2 @@ -SHA256 (VirtualBox-3.2.12-OSE.tar.bz2) = 064eb382e5b752a3f9189c930734393765125e70b5f99679a63ff4eb6186e261 -SIZE (VirtualBox-3.2.12-OSE.tar.bz2) = 58239733 +SHA256 (VirtualBox-4.0.8.tar.bz2) = 48961f0d6fe70c3887cbca5ea987767ac1bafd4b64dd3c4d25445682351e118e +SIZE (VirtualBox-4.0.8.tar.bz2) = 69593014 diff --git a/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile new file mode 100644 index 000000000000..f259dc7212aa --- /dev/null +++ b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile @@ -0,0 +1,11 @@ +--- ./src/VBox/HostDrivers/Support/freebsd/Makefile.orig 2011-05-16 18:33:40.000000000 +0200 ++++ ./src/VBox/HostDrivers/Support/freebsd/Makefile 2011-05-17 15:13:48.000000000 +0200 +@@ -84,6 +84,8 @@ + + .PATH: ${.CURDIR}/common/string + SRCS += \ ++ RTStrNCmp.c \ ++ RTStrCopy.c \ + RTStrCopyP.c \ + strformat.c \ + strformatrt.c \ diff --git a/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-Support-freebsd-files-vboxdrv b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-Support-freebsd-files-vboxdrv new file mode 100644 index 000000000000..166b8d40bf62 --- /dev/null +++ b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-Support-freebsd-files-vboxdrv @@ -0,0 +1,11 @@ +--- ./src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig 2011-05-16 18:33:40.000000000 +0200 ++++ ./src/VBox/HostDrivers/Support/freebsd/files_vboxdrv 2011-05-17 15:14:05.000000000 +0200 +@@ -110,6 +110,8 @@ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopyP.cpp=>common/string/RTStrCopyP.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopy.cpp=>common/string/RTStrCopy.c \ ++ ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNCmp.cpp=>common/string/RTStrNCmp.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \ diff --git a/emulators/virtualbox-ose-kmod/files/patch-src-VBox-Runtime-r0drv-freebsd-thread-r0drv-freebsd.c b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-Runtime-r0drv-freebsd-thread-r0drv-freebsd.c deleted file mode 100644 index e379ac172b4a..000000000000 --- a/emulators/virtualbox-ose-kmod/files/patch-src-VBox-Runtime-r0drv-freebsd-thread-r0drv-freebsd.c +++ /dev/null @@ -1,16 +0,0 @@ -*** ./src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c~ Wed Dec 1 12:09:43 2010 ---- ./src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c Wed Feb 9 13:44:28 2011 -*************** -*** 101,107 **** ---- 101,111 ---- - - RTDECL(bool) RTThreadYield(void) - { -+ #if (__FreeBSD_version >= 900032) -+ kern_yield(curthread->td_user_pri); -+ #else - uio_yield(); -+ #endif - return false; /** @todo figure this one ... */ - } - diff --git a/emulators/virtualbox-ose/Makefile b/emulators/virtualbox-ose/Makefile index d0cb42456601..a064829b5bd3 100644 --- a/emulators/virtualbox-ose/Makefile +++ b/emulators/virtualbox-ose/Makefile @@ -6,16 +6,14 @@ # PORTNAME= virtualbox-ose -DISTVERSION= 3.2.12 -PORTREVISION= 1 +DISTVERSION= 4.0.8 CATEGORIES= emulators MASTER_SITES= http://tmp.chruetertee.ch/ \ http://freebsd.unixfreunde.de/sources/ \ http://disasterarea.chruetertee.ch/ \ - http://mirror.4bit.ws/ \ http://dlc.sun.com/virtualbox/${VBOX_GUEST_VER}/:guestadditions -DISTFILES= VirtualBox-${DISTVERSION}-OSE${EXTRACT_SUFX} ${GADISTFILES} -EXTRACT_ONLY= VirtualBox-${DISTVERSION}-OSE${EXTRACT_SUFX} +DISTFILES= VirtualBox-${DISTVERSION}${EXTRACT_SUFX} ${GADISTFILES} +EXTRACT_ONLY= VirtualBox-${DISTVERSION}${EXTRACT_SUFX} #for discussion please use emulation@FreeBSD.org MAINTAINER= vbox@FreeBSD.org @@ -35,6 +33,7 @@ LICENSE_FILE= ${WRKSRC}/COPYING WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION}_OSE ONLY_FOR_ARCHS= i386 amd64 +USE_CDRTOOLS= yes USE_GNOME= libidl USE_BZIP2= yes USE_PYTHON= yes @@ -47,9 +46,13 @@ HAS_CONFIGURE= yes CONFIGURE_ARGS+=--with-gcc="${CC}" --with-g++="${CXX}" --passive-mesa USE_LDCONFIG= ${PREFIX}/lib/virtualbox -CONFLICTS= bcc-[0-9]* virtualbox-ose-devel-3* virtualbox-ose-additions-3* virtualbox-ose-additions-devel-3* +CONFLICTS= bcc-[0-9]* +CONFLICTS_INSTALL= virtualbox-ose-devel-[3,4]* virtualbox-ose-legacy-[3,4]* virtualbox-ose-additions-[3,4]* virtualbox-ose-additions-devel-[3,4]* +VBOXUSER?= vboxusers +VBOXWSUSER?= vboxusers VBOXGROUP?= vboxusers +USERS= ${VBOXUSER} GROUPS= ${VBOXGROUP} VBOX_FRONTENDS= VBoxHeadless VBOX_GUEST_VER= ${PORTVERSION} @@ -71,6 +74,9 @@ PLIST_SUB+= PYTHON_VER=${PYTHON_VER} \ PYTHON_VERU=${PYTHON_VER:S/./_/} \ GUEST_VER=${VBOX_GUEST_VER} +SUB_LIST+= VBOXUSER=${VBOXUSER} +USE_RC_SUBR+= vboxheadless + KMK_BUILDTYPE= release KMK_CONFIG= VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys KMK_FLAGS= @@ -151,6 +157,8 @@ CONFIGURE_ARGS+=--enable-vde .if defined(WITH_WEBSERVICE) BUILD_DEPENDS+= soapcpp2:${PORTSDIR}/devel/gsoap VBOX_WEB= vboxwebsrv webtest +USE_RC_SUBR+= vboxwebsrv +SUB_LIST+= VBOXWSUSER=${VBOXWSUSER} PLIST_SUB+= WEB="" .else PLIST_SUB+= WEB="@comment " @@ -202,6 +210,9 @@ post-patch: .if defined(WITH_VNC) @${ECHO} 'VBOX_WITH_VNC = 1' >> ${WRKSRC}/LocalConfig.kmk .endif +.if ${OSVERSION} < 800069 + @${ECHO} 'VBOX_WITH_USB=' >> ${WRKSRC}/LocalConfig.kmk +.endif .if defined(WITH_WEBSERVICE) @${ECHO} 'VBOX_WITH_WEBSERVICES = 1' >> ${WRKSRC}/LocalConfig.kmk @${ECHO} 'VBOX_GSOAP_INSTALLED = 1' >> ${WRKSRC}/LocalConfig.kmk @@ -232,7 +243,7 @@ do-install: (cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/sdk/bindings/xpcom/include && ${COPYTREE_SHARE} "*" ${PREFIX}/include/virtualbox) ${MKDIR} ${PREFIX}/lib/virtualbox - (cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin && ${COPYTREE_SHARE} "*.so *.gc *.r0 *.fd components" ${PREFIX}/lib/virtualbox) + (cd ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin && ${COPYTREE_SHARE} "*.so *.gc *.r0 *.fd components VBoxExtPackHelperApp" ${PREFIX}/lib/virtualbox) .if !defined(WITHOUT_NLS) ${MKDIR} ${DATADIR}/nls @@ -249,7 +260,7 @@ do-install: ${CHMOD} 4511 ${PREFIX}/lib/virtualbox/${f} .endfor -.for f in VBoxManage VBoxSVC VBoxXPCOMIPCD +.for f in VBoxManage VBoxSVC VBoxXPCOMIPCD VBoxExtPackHelperApp ${CHMOD} 0711 ${PREFIX}/lib/virtualbox/${f} .endfor @@ -274,7 +285,7 @@ do-install: ${PYTHON_CMD} -mcompileall ${PYTHON_SITELIBDIR}/xpcom/ post-install: -.for f in VBoxManage VBoxNetDHCP VBoxSVC VBoxXPCOMIPCD ${VBOX_FRONTENDS} +.for f in VBoxManage VBoxNetDHCP VBoxSVC VBoxXPCOMIPCD VBoxExtPackHelperApp ${VBOX_FRONTENDS} ${CHOWN} root:${VBOXGROUP} ${PREFIX}/lib/virtualbox/${f} .endfor diff --git a/emulators/virtualbox-ose/distinfo b/emulators/virtualbox-ose/distinfo index a04a6e98292d..a229bab0e81c 100644 --- a/emulators/virtualbox-ose/distinfo +++ b/emulators/virtualbox-ose/distinfo @@ -1,4 +1,4 @@ -SHA256 (VirtualBox-3.2.12-OSE.tar.bz2) = 064eb382e5b752a3f9189c930734393765125e70b5f99679a63ff4eb6186e261 -SIZE (VirtualBox-3.2.12-OSE.tar.bz2) = 58239733 -SHA256 (VBoxGuestAdditions_3.2.12.iso) = cae0d7c7d3844188caf01973dc97a722a70b2ba18ff189c9b8e82afb771de436 -SIZE (VBoxGuestAdditions_3.2.12.iso) = 33146880 +SHA256 (VirtualBox-4.0.8.tar.bz2) = 48961f0d6fe70c3887cbca5ea987767ac1bafd4b64dd3c4d25445682351e118e +SIZE (VirtualBox-4.0.8.tar.bz2) = 69593014 +SHA256 (VBoxGuestAdditions_4.0.8.iso) = f2cec4d8b176ce865cb93096e80045b1453da1504d3a084fc910b47615aa2be0 +SIZE (VBoxGuestAdditions_4.0.8.iso) = 40814592 diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Makefile.kmk b/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Makefile.kmk index 098410d5ff94..2cdf6521b3db 100644 --- a/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Makefile.kmk +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Makefile.kmk @@ -1,15 +1,13 @@ ---- src/VBox/Devices/Makefile.kmk.orig 2009-12-17 15:27:43.000000000 +0100 -+++ src/VBox/Devices/Makefile.kmk 2009-12-21 14:29:56.000000000 +0100 -@@ -31,8 +31,10 @@ - include $(PATH_SUB_CURRENT)/PC/VMI/Makefile.kmk - endif - include $(PATH_SUB_CURRENT)/Graphics/BIOS/Makefile.kmk +--- src/VBox/Devices/Makefile.kmk.orig 2010-12-06 22:42:36.000000000 +0100 ++++ src/VBox/Devices/Makefile.kmk 2010-12-06 22:42:59.000000000 +0100 +@@ -22,7 +22,9 @@ + VBOX_PATH_DEVICES_SRC := $(PATH_SUB_CURRENT) + + # Include sub-makefiles. -include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk --include $(PATH_SUB_CURRENT)/Storage/testcase/Makefile.kmk +ifdef VBOX_WITH_TESTCASES -+ include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk -+ include $(PATH_SUB_CURRENT)/Storage/testcase/Makefile.kmk ++ include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk +endif - ifndef VBOX_OSE - include $(PATH_SUB_CURRENT)/Storage/VBoxHDDFormats/Makefile.kmk - endif + if defined(VBOX_WITH_INTEL_PXE) || defined(VBOX_ONLY_EXTPACKS) + include $(PATH_SUB_CURRENT)/PC/PXE/Makefile.kmk + else ifndef VBOX_WITHOUT_ETHERBOOT diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Storage-DrvHostDVD.cpp b/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Storage-DrvHostDVD.cpp deleted file mode 100644 index 97f764a71d12..000000000000 --- a/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Storage-DrvHostDVD.cpp +++ /dev/null @@ -1,14 +0,0 @@ - ---- src/VBox/Devices/Storage/DrvHostDVD.cpp.orig 2010-05-20 10:28:06.000000000 +0300 -+++ src/VBox/Devices/Storage/DrvHostDVD.cpp 2010-05-20 10:37:47.000000000 +0300 -@@ -224,7 +224,7 @@ - */ - static DECLCALLBACK(int) drvHostDvdDoLock(PDRVHOSTBASE pThis, bool fLock) - { --#ifdef RT_OS_DARWIN -+#if defined(RT_OS_FREEBSD) || defined(RT_OS_DARWIN) - uint8_t abCmd[16] = - { - SCSI_PREVENT_ALLOW_MEDIUM_REMOVAL, 0, 0, 0, fLock, 0, - - diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Frontends-VBoxManage-VBoxInternalManage.cpp b/emulators/virtualbox-ose/files/patch-src-VBox-Frontends-VBoxManage-VBoxInternalManage.cpp deleted file mode 100644 index fdffb0aab896..000000000000 --- a/emulators/virtualbox-ose/files/patch-src-VBox-Frontends-VBoxManage-VBoxInternalManage.cpp +++ /dev/null @@ -1,48 +0,0 @@ ---- src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp.orig 2010-12-01 18:09:24.000000000 +0100 -+++ src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp 2011-03-16 10:58:37.000000000 +0100 -@@ -178,8 +178,9 @@ - " (the partitioning information in the MBR file is ignored).\n" - " The diskname is on Linux e.g. /dev/sda, and on Windows e.g.\n" - " \\\\.\\PhysicalDrive0).\n" -- " On Linux host the parameter -relative causes a VMDK file to be created\n" -- " which refers to individual partitions instead to the entire disk.\n" -+ " On Linux or FreeBSD host the parameter -relative causes a VMDK file to\n" -+ " be created which refers to individual partitions instead to the entire\n" -+ " disk.\n" - " Optionally the created image can be immediately registered.\n" - " The necessary partition numbers can be queried with\n" - " VBoxManage internalcommands listpartitions\n" -@@ -926,12 +927,12 @@ - { - fRegister = true; - } --#ifdef RT_OS_LINUX -+#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) - else if (strcmp(argv[i], "-relative") == 0) - { - fRelative = true; - } --#endif /* RT_OS_LINUX */ -+#endif /* RT_OS_LINUX || RT_OS_FREEBSD */ - else - { - return errorSyntax(USAGE_CREATERAWVMDK, "Invalid parameter '%s'", Utf8Str(argv[i]).raw()); -@@ -1280,10 +1281,16 @@ - { - if (fRelative) - { --#ifdef RT_OS_LINUX -+#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) - /* Refer to the correct partition and use offset 0. */ - char *psz; -- vrc = RTStrAPrintf(&psz, "%s%u", rawdisk.raw(), -+ vrc = RTStrAPrintf(&psz, -+#if defined(RT_OS_LINUX) -+ "%s%u", -+#elif defined(RT_OS_FREEBSD) -+ "%ss%u", -+#endif -+ rawdisk.raw(), - partitions.aPartitions[i].uIndex); - if (RT_FAILURE(vrc)) - { diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Frontends-VirtualBox-src-settings-vm-VBoxVMSettingsHD.h b/emulators/virtualbox-ose/files/patch-src-VBox-Frontends-VirtualBox-src-settings-vm-VBoxVMSettingsHD.h deleted file mode 100644 index 6b347df656ca..000000000000 --- a/emulators/virtualbox-ose/files/patch-src-VBox-Frontends-VirtualBox-src-settings-vm-VBoxVMSettingsHD.h +++ /dev/null @@ -1,11 +0,0 @@ ---- src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsHD.h.orig 2010-06-04 10:43:02.000000000 +0200 -+++ src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsHD.h 2010-06-04 10:33:40.000000000 +0200 -@@ -20,7 +20,7 @@ - #define __VBoxVMSettingsHD_h__ - - /* Global includes */ --#include /* for Q_WS_MAC */ -+#include /* for Q_WS_MAC */ - #ifdef Q_WS_MAC - /* Somewhere Carbon.h includes AssertMacros.h which defines the macro "check". - * In QItemDelegate a class method is called "check" also. As we not used the diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-SUPR3HardenedVerify.cpp b/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-SUPR3HardenedVerify.cpp new file mode 100644 index 000000000000..ffbbdbfaad16 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-SUPR3HardenedVerify.cpp @@ -0,0 +1,14 @@ +--- src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp.orig 2011-05-16 18:33:40.000000000 +0200 ++++ src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp 2011-05-19 16:53:54.000000000 +0200 +@@ -1187,6 +1187,11 @@ + permit grand parents and beyond to be group writable by admin. */ + if (pFsObjState->Stat.st_gid != 80 /*admin*/) /** @todo dynamically resolve the admin group? */ + #endif ++#ifdef RT_OS_FREEBSD ++ /* PC-BSD 9 has group-writable application directory, similar to OSX and ++ their Applications directory */ ++ if (pFsObjState->Stat.st_gid != 5 /*operators*/) /* Allow operators group-writes */ ++#endif + return supR3HardenedSetError3(VERR_SUPLIB_WRITE_NON_SYS_GROUP, pErrInfo, + "The group is not a system group and it has write access to '", pszPath, "'"); + } diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-virtualbox.desktop b/emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-virtualbox.desktop index 5f248a87bf95..8f43a89b8d8d 100644 --- a/emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-virtualbox.desktop +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-virtualbox.desktop @@ -1,5 +1,5 @@ ---- src/VBox/Installer/freebsd/virtualbox.desktop.orig 2010-10-11 17:39:54.000000000 +0200 -+++ src/VBox/Installer/freebsd/virtualbox.desktop 2010-10-11 17:40:06.000000000 +0200 +--- src/VBox/Installer/freebsd/virtualbox.desktop.orig 2010-10-07 10:42:04.000000000 +0200 ++++ src/VBox/Installer/freebsd/virtualbox.desktop 2010-10-07 10:43:20.000000000 +0200 @@ -7,7 +7,6 @@ Type=Application Exec=VirtualBox diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Main-freebsd-NetIf-freebsd.cpp b/emulators/virtualbox-ose/files/patch-src-VBox-Main-freebsd-NetIf-freebsd.cpp deleted file mode 100644 index 8e706db41fd3..000000000000 --- a/emulators/virtualbox-ose/files/patch-src-VBox-Main-freebsd-NetIf-freebsd.cpp +++ /dev/null @@ -1,30 +0,0 @@ ---- src/VBox/Main/freebsd/NetIf-freebsd.cpp.orig 2010-06-07 15:34:44.000000000 +0300 -+++ src/VBox/Main/freebsd/NetIf-freebsd.cpp 2010-06-18 16:45:31.000000000 +0300 -@@ -180,11 +180,16 @@ - char *pBuf, *pNext; - int aiMib[6]; - unsigned short u16DefaultIface; -+ int haveDefaultIface; - - /* Get the index of the interface associated with default route. */ - rc = getDefaultIfaceIndex(&u16DefaultIface, PF_INET); -- if (RT_FAILURE(rc)) -- return rc; -+ haveDefaultIface = 1; -+ if (RT_FAILURE(rc)) { -+ Log(("NetIfList: Failed to get default route interface\n")); -+ haveDefaultIface = 0; -+ rc = VINF_SUCCESS; -+ } - - aiMib[0] = CTL_NET; - aiMib[1] = PF_ROUTE; -@@ -286,7 +291,7 @@ - IfObj.createObject(); - if (SUCCEEDED(IfObj->init(Bstr(pNew->szName), enmType, pNew))) - /* Make sure the default interface gets to the beginning. */ -- if (pIfMsg->ifm_index == u16DefaultIface) -+ if (haveDefaultIface == 1 && pIfMsg->ifm_index == u16DefaultIface) - list.push_front(IfObj); - else - list.push_back(IfObj); diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-HostImpl.cpp b/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-HostImpl.cpp new file mode 100644 index 000000000000..83795f6779e7 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-HostImpl.cpp @@ -0,0 +1,20 @@ +--- src/VBox/Main/src-server/HostImpl.cpp.orig 2011-02-17 17:31:52.000000000 +0100 ++++ src/VBox/Main/src-server/HostImpl.cpp 2011-02-17 23:46:50.000000000 +0100 +@@ -249,6 +249,8 @@ + + m->pParent = aParent; + ++ HRESULT hrc = NULL; ++ + #ifdef VBOX_WITH_USB + /* + * Create and initialize the USB Proxy Service. +@@ -268,7 +270,7 @@ + # else + m->pUSBProxyService = new USBProxyService(this); + # endif +- HRESULT hrc = m->pUSBProxyService->init(); ++ hrc = m->pUSBProxyService->init(); + AssertComRCReturn(hrc, hrc); + #endif /* VBOX_WITH_USB */ + diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-VMM-VMMR3-CPUM.cpp b/emulators/virtualbox-ose/files/patch-src-VBox-VMM-VMMR3-CPUM.cpp new file mode 100644 index 000000000000..5bb1888abe18 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-VMM-VMMR3-CPUM.cpp @@ -0,0 +1,12 @@ +--- src/VBox/VMM/VMMR3/CPUM.cpp (Revision 71439) ++++ src/VBox/VMM/VMMR3/CPUM.cpp (Revision 71440) +@@ -999,7 +999,8 @@ + */ + if (!fHWVirtExEnabled) + { +- Assert(pVM->cpum.s.aGuestCpuIdStd[4].eax == 0); ++ Assert( pVM->cpum.s.aGuestCpuIdStd[4].eax == 0 ++ || pVM->cpum.s.aGuestCpuIdStd[0].eax < 0x4); + pVM->cpum.s.aGuestCpuIdStd[4].eax = 0; + } + } diff --git a/emulators/virtualbox-ose/files/vboxheadless.in b/emulators/virtualbox-ose/files/vboxheadless.in new file mode 100644 index 000000000000..f0a04a6b1aa1 --- /dev/null +++ b/emulators/virtualbox-ose/files/vboxheadless.in @@ -0,0 +1,125 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: vboxheadless +# REQUIRE: LOGIN vboxnet +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf[.local] to enable vboxheadless +# +# vboxheadless_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable vboxheadless. +# vboxheadless_machines (str): Space separated list of machines +# vboxheadless_user (str): Default user account to run with. +# (default: %%VBOXUSER%%) +# vboxheadless__name (str): Virtualbox machine name or UUID. +# vboxheadless__user (str): User account to run with. +# vboxheadless__flags (str): Additional flags for VBoxHeadless. + +. /etc/rc.subr + +name="vboxheadless" +rcvar=`set_rcvar` + +command="%%PREFIX%%/bin/VBoxHeadless" +pidbase="/var/run/${name}" + +start_cmd="${name}_start" +stop_cmd="${name}_stop" +status_cmd="${name}_status" + +vboxheadless_start() +{ + local machine mpidfile pid vmname vmuser vmflags + + echo "Starting Virtual Machines:" + for machine in ${vboxheadless_machines}; do + mpidfile="${pidbase}_${machine}.pid" + pid=$(check_pidfile $mpidfile $command) + eval vmname="\${vboxheadless_${machine}_name:-${machine}}" + eval vmuser="\${vboxheadless_${machine}_user:-${vboxheadless_user}}" + eval vmflags="\${vboxheadless_${machine}_flags:-}" + + HOME=$(/usr/sbin/pw usershow -7 -n "${vmuser}" | /usr/bin/cut -d: -f6) + + /usr/bin/printf "%25s " "${vmname}" + + /usr/bin/su ${vmuser} -c "%%PREFIX%%/bin/VBoxManage showvminfo '${vmname}' >/dev/null" 2>/dev/null + + if [ $? != 0 ]; then + echo "Unknown machine" + continue + fi + + if [ -n "${pid}" ]; then + echo "Already running? (pid=${pid})" + continue + fi + + /usr/bin/install -o ${vmuser} -g wheel -m 644 /dev/null ${mpidfile} + /usr/sbin/daemon -f -p ${mpidfile} -u ${vmuser} ${command} --startvm "${vmname}" ${vmflags} + echo "Started" + done +} + +vboxheadless_stop() +{ + local machine mpidfile pid vmname vmuser + + echo "Saving states for Virtual Machines:" + for machine in ${vboxheadless_machines}; do + mpidfile="${pidbase}_${machine}.pid" + pid=$(check_pidfile $mpidfile $command) + eval vmname="\${vboxheadless_${machine}_name:-${machine}}" + eval vmuser="\${vboxheadless_${machine}_user:-${vboxheadless_user}}" + + /usr/bin/printf "%25s " "${vmname}" + + if [ -n "${pid}" ]; then + /usr/bin/su ${vmuser} -c "%%PREFIX%%/bin/VBoxManage controlvm '${vmname}' savestate >/dev/null" 2>/dev/null + wait_for_pids $pid >/dev/null + echo "Stopped" + else + echo "Not running?" + fi + done +} + +vboxheadless_status() +{ + local machine mpidfile pid vmname vmuser + + /usr/bin/printf "%25s %s\n" "Machine" "Status" + /usr/bin/printf "%25s %s\n" "-------------------------" "------------" + + for machine in ${vboxheadless_machines}; do + mpidfile="${pidbase}_${machine}.pid" + pid=$(check_pidfile $mpidfile $command) + eval vmname="\${vboxheadless_${machine}_name:-${machine}}" + eval vmuser="\${vboxheadless_${machine}_user:-${vboxheadless_user}}" + + /usr/bin/su ${vmuser} -c "/usr/local/bin/VBoxManage showvminfo '${vmname}' >/dev/null" 2>/dev/null + + if [ $? != 0 ]; then + /usr/bin/printf "%20s %s\n" "${vmname}" "Unknown Machine" + elif [ -n "${pid}" ]; then + /usr/bin/printf "%25s %s\n" "${vmname}" "Running" + else + /usr/bin/printf "%25s %s\n" "${vmname}" "Powered Off" + fi + done +} + +load_rc_config $name + +: ${vboxheadless_enable="NO"} +: ${vboxheadless_user="%%VBOXUSER%%"} + +cmd_arg="$1" ; shift + +if [ -n "$*" ]; then + vboxheadless_machines="$*" +fi + +run_rc_command "${cmd_arg}" diff --git a/emulators/virtualbox-ose/files/vboxwebsrv.in b/emulators/virtualbox-ose/files/vboxwebsrv.in new file mode 100644 index 000000000000..2905effbb3a8 --- /dev/null +++ b/emulators/virtualbox-ose/files/vboxwebsrv.in @@ -0,0 +1,49 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: vboxwebsrv +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf[.local] to enable vboxwebsrv +# +# vboxwebsrv_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable vboxwebsrv. +# vboxwebsrv_user (str): User account to run with. +# vboxwebsrv_flags (str): Custom flags for vboxwebsrv. + +. /etc/rc.subr + +name=vboxwebsrv +rcvar=`set_rcvar` + +command="%%PREFIX%%/bin/vboxwebsrv" +pidfile="/var/run/${name}.pid" + +start_cmd="${name}_start" + +vboxwebsrv_start() +{ + local pid + + HOME=$(/usr/sbin/pw usershow -7 -n "${vboxwebsrv_user}" | /usr/bin/cut -d: -f6) + pid=$(check_pidfile $pidfile $command) + + if [ -n "${pid}" ]; then + echo "${name} already running? (pid=${pid})." + return 1 + fi + + echo -n "Starting ${name}" + /usr/bin/install -o ${vboxwebsrv_user} -g wheel -m 644 /dev/null ${pidfile} + /usr/sbin/daemon -f -p ${pidfile} -u ${vboxwebsrv_user} ${command} ${vboxwebsrv_flags} + echo '.' +} + +load_rc_config $name + +: ${vboxwebsrv_enable="NO"} +: ${vboxwebsrv_user="%%VBOXWSUSER%%"} + +run_rc_command "$1" diff --git a/emulators/virtualbox-ose/pkg-message b/emulators/virtualbox-ose/pkg-message index a5c046c48a13..93aa94f86927 100644 --- a/emulators/virtualbox-ose/pkg-message +++ b/emulators/virtualbox-ose/pkg-message @@ -6,15 +6,45 @@ You need to load the vboxdrv kernel module via /boot/loader.conf: vboxdrv_load="YES" +You also have to add all users to your vboxusers group in order to use vbox. + +% pw groupmod vboxusers -m jerry + +Reboot the machine to load the needed kernel modules. + + +Bridging Support: +================= + For bridged networking please add the following line to your /etc/rc.conf: vboxnet_enable="YES" -Reboot the machine to load the needed kernel modules. -You also have to add all users to your vboxusers group in order to use vbox. +USB Support: +============ -% pw groupmod vboxusers -m jerry +For USB support your user needs to be in the operator group and needs read +and write permissions to the USB device. + +% pw groupmod operator -m jerry + +Add the following to /etc/devfs.rules (create if it doesn't exist): + +[system=10] +add path 'usb/*' mode 0660 group operator + +To load these new rule add the following to /etc/rc.conf: + +devfs_system_ruleset="system" + +Then restart devfs to load the new rules: + +% /etc/rc.d/devfs restart + + +Troubleshooting: +================ Running VirtualBox as non-root user may fail with a fatal error NS_ERROR_FACTORY_NOT_REGISTERED. In this case delete /tmp/.vbox-*-ipc file. diff --git a/emulators/virtualbox-ose/pkg-plist b/emulators/virtualbox-ose/pkg-plist index 6335f59569a9..5f07c18b3be8 100644 --- a/emulators/virtualbox-ose/pkg-plist +++ b/emulators/virtualbox-ose/pkg-plist @@ -12,11 +12,16 @@ bin/VBoxXPCOMIPCD %%WEB%%bin/webtest %%X11%%lib/virtualbox/VBoxBFE %%X11%%lib/virtualbox/VBoxBFE.so +lib/virtualbox/DBGCPlugInDiggers.so +lib/virtualbox/VBoxAuth.so +lib/virtualbox/VBoxAuthSimple.so +lib/virtualbox/VBoxDbg.so lib/virtualbox/VBoxDD.so lib/virtualbox/VBoxDD2.so lib/virtualbox/VBoxDDU.so lib/virtualbox/VBoxEFI32.fd lib/virtualbox/VBoxEFI64.fd +lib/virtualbox/VBoxExtPackHelperApp lib/virtualbox/VBoxGuestControlSvc.so lib/virtualbox/VBoxGuestPropSvc.so lib/virtualbox/VBoxHeadless