Index: head/emulators/virtualbox-ose/Makefile =================================================================== --- head/emulators/virtualbox-ose/Makefile (revision 542550) +++ head/emulators/virtualbox-ose/Makefile (revision 542551) @@ -1,402 +1,407 @@ # Created by: Bernhard Froehlich # $FreeBSD$ PORTNAME= virtualbox-ose -PORTVERSION= 5.2.34 -PORTREVISION= 4 +PORTVERSION= 5.2.44 CATEGORIES= emulators MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ DISTFILES= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS} EXTRACT_ONLY= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} MAINTAINER= vbox@FreeBSD.org COMMENT= General-purpose full virtualizer for x86 hardware LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING PATCH_DEPENDS+= ${LOCALBASE}/share/kBuild/tools/GXX3.kmk:devel/kBuild BUILD_DEPENDS= yasm:devel/yasm \ xsltproc:textproc/libxslt \ kmk:devel/kBuild \ gtar:archivers/gtar LIB_DEPENDS= libpng.so:graphics/png \ libxslt.so:textproc/libxslt \ libcurl.so:ftp/curl RUN_DEPENDS= ${LOCALBASE}/etc/rc.d/vboxnet:emulators/virtualbox-ose-kmod CPE_VENDOR= oracle CPE_PRODUCT= vm_virtualbox WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} ONLY_FOR_ARCHS= i386 amd64 USES= compiler:c++14-lang cpe gnome iconv pkgconfig ssl tar:bzip2 USE_GNOME= libidl libxml2 HAS_CONFIGURE= yes CONFIGURE_ARGS= --disable-java --passive-mesa CONFIGURE_ARGS+= --with-gcc="${CC}" --with-g++="${CXX}" CONFLICTS_INSTALL= virtualbox-ose-additions-* \ virtualbox-ose-devel-[0-9]* \ virtualbox-ose-legacy-[0-9]* \ virtualbox-ose-lite-[0-9]* LDFLAGS= -lpthread VBOXUSER?= vboxusers VBOXWSUSER?= vboxusers VBOXGROUP?= vboxusers USERS= ${VBOXUSER} GROUPS= ${VBOXGROUP} VBOX_DIR= ${PREFIX}/${VBOX_DIR_REL} VBOX_DIR_REL= lib/virtualbox VBOX_LINKS= VBoxVRDP VBOX_PROGS= VBoxAutostart VBoxBalloonCtrl VBoxBugReport VBoxHeadless \ VBoxManage VBOX_UTILS= VBoxExtPackHelperApp VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT \ VBoxSVC VBoxXPCOMIPCD OPTIONS_DEFINE= ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS PULSEAUDIO \ PYTHON QT5 R0LOGGING UDPTUNNEL VDE VNC WEBSERVICE VPX X11 OPTIONS_DEFAULT= DBUS QT5 UDPTUNNEL VNC WEBSERVICE X11 OPTIONS_SUB= yes DEBUG_DESC= Debug symbols, additional logs and assertions GUESTADDITIONS_DESC= Build with Guest Additions MANUAL_DESC= Build with user manual NLS_DESC= Native language support (requires QT5) QT5_DESC= Build with QT5 frontend (requires X11) R0LOGGING_DESC= Enable R0 logging (requires DEBUG) UDPTUNNEL_DESC= Build with UDP tunnel support VDE_DESC= Build with VDE support VNC_DESC= Build with VNC support VPX_DESC= Use libvpx for video recording WEBSERVICE_DESC= Build Webservice ALSA_CONFIGURE_OFF= --disable-alsa ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib DBUS_CONFIGURE_OFF= --disable-dbus DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus DEBUG_CONFIGURE_ON= --build-debug MANUAL_BUILD_DEPENDS= ${LOCALBASE}/share/xml/docbook/4.4/docbookx.dtd:textproc/docbook-xml MANUAL_CONFIGURE_OFF= --disable-docs NLS_IMPLIES= QT5 PULSEAUDIO_CONFIGURE_OFF= --disable-pulse PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PYTHON_CONFIGURE_OFF= --disable-python QT5_IMPLIES= X11 R0LOGGING_IMPLIES= DEBUG UDPTUNNEL_CONFIGURE_OFF= --disable-udptunnel VDE_CONFIGURE_ON= --enable-vde VDE_RUN_DEPENDS= vde_switch:net/vde2 VNC_CONFIGURE_ON= --enable-vnc VNC_LIB_DEPENDS= libvncserver.so:net/libvncserver VPX_CONFIGURE_OFF= --disable-libvpx VPX_LIB_DEPENDS= libvpx.so:multimedia/libvpx X11_CONFIGURE_OFF= --build-headless ENV= .export ENV PLIST_SUB= GUEST_VER=${PORTVERSION} \ PYTHON_VERU=${PYTHON_VER:S/./_/}${PYTHON_ABIVER} \ VBOXGROUP=${VBOXGROUP} SUB_LIST= VBOXDIR=${VBOX_DIR} \ VBOXGROUP=${VBOXGROUP} \ VBOXUSER=${VBOXUSER} \ VBOXWSUSER=${VBOXWSUSER} USE_RC_SUBR= vboxheadless vboxwatchdog .include .if ${SLAVE_PORT} == no CONFLICTS_INSTALL+= virtualbox-ose-nox11-[0-9]* OPTIONS_DEFAULT+= PYTHON .else CONFLICTS_INSTALL+= virtualbox-ose-[0-9]* .endif .if ${ARCH} == "amd64" _ELF32!= kldstat -q -m elf32 && echo yes || echo no .endif .if ${PORT_OPTIONS:MDEBUG} KMK_BUILDTYPE= debug KMK_FLAGS+= BUILD_TYPE=debug .else KMK_BUILDTYPE= release .endif .if ${PORT_OPTIONS:MGUESTADDITIONS} GUESTADDITIONS= VBoxGuestAdditions_${PORTVERSION}.iso RESTRICTED= for personal use only RESTRICTED_FILES= ${GUESTADDITIONS} .endif .if ${PORT_OPTIONS:MMANUAL} DBKXMLDIR= ${LOCALBASE}/share/xml/docbook/4.4 DBKXSLDIR= ${LOCALBASE}/share/xsl/docbook USE_TEX= dvipsk:build formats:build .endif .if ${PORT_OPTIONS:MPYTHON} -USES+= python:2.7 +USES+= python USE_PYTHON= distutils noegginfo noflavors PYDISTUTILS_PKGNAME= vboxapi PYDISTUTILS_PKGVERSION= 1.0 .else -USES+= python:2.7,build +USES+= python:build .endif .if ${PORT_OPTIONS:MQT5} CONFIGURE_ARGS+= --enable-qt5 PLIST_SUB+= QT="" USES+= gl qmake:no_env qt:5 xorg USE_GL= gl glu USE_QT= buildtools_build core dbus gui linguisttools_build opengl USE_QT+= printsupport widgets x11extras USE_XORG= xcb INSTALLS_ICONS= yes VBOX_PROGS+= VirtualBox VBOX_UTILS+= VBoxTestOGL VBOX_WITH_QT= 1 .else CONFIGURE_ARGS+= --disable-qt PLIST_SUB+= QT="@comment " .endif .if ${PORT_OPTIONS:MWEBSERVICE} BUILD_DEPENDS+= soapcpp2:devel/gsoap USE_RC_SUBR+= vboxwebsrv VBOX_LINKS+= vboxwebsrv VBOX_UTILS+= vboxwebsrv webtest .endif .if ${PORT_OPTIONS:MX11} USES+= sdl USE_SDL= sdl USE_XORG+= xorgproto x11 xcursor xext xinerama xmu xt VBOX_PROGS+= VBoxSDL .endif .if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE} PLIST_SUB+= SDK="" .else PLIST_SUB+= SDK="@comment " .endif .if ${ARCH} == i386 KMK_ARCH= freebsd.x86 PLIST_SUB+= I386="" .else KMK_ARCH= freebsd.${ARCH} PLIST_SUB+= I386="@comment " .endif PLIST_SUB+= ARCH="${KMK_ARCH}" KMK_BUILDDIR= ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE} KMK_CONFIG= VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys KMK_FLAGS+= -j${MAKE_JOBS_NUMBER} .include .if ${PYTHON_MAJOR_VER} >= 3 PLIST_SUB+= PYTHON_PYCDIR=/__pycache__/ \ PYTHON_PYCEXT=.cpython-${PYTHON_SUFFIX}.pyc .else PLIST_SUB+= PYTHON_PYCDIR=/ \ PYTHON_PYCEXT=.pyc .endif .if ${SSL_DEFAULT} != base CONFIGURE_ARGS+= --with-openssl-dir="${OPENSSLBASE}" .endif pre-everything:: .if ${ARCH} == "amd64" .if ${_ELF32} != yes @${ECHO_MSG} 'Requires 32-bit runtime support in kernel.' @${ECHO_MSG} 'Rebuild kernel with "options COMPAT_FREEBSD32" and reboot.' @${FALSE} .elif !exists(/usr/lib32/libc.so) @${ECHO_MSG} 'Requires 32-bit libraries installed under /usr/lib32.' @${ECHO_MSG} 'Do: cd /usr/src; make build32 install32; service ldconfig restart' @${FALSE} .endif .endif post-patch: @${ECHO_CMD} 'VBOX_PATH_APP_PRIVATE_ARCH = ${VBOX_DIR}' > \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_DOCBOOK = ${DBKXSLDIR}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_DOCBOOK_DTD = ${DBKXMLDIR}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_SHARED_LIBS = ${VBOX_DIR}' >> \ ${WRKSRC}/LocalConfig.kmk # Please keep this even if using Clang to avoid repeated regressions. # PR 245048 @${ECHO_CMD} "VBOX_WITH_RUNPATH = ${_GCC_RUNTIME:D${_GCC_RUNTIME}\:}${VBOX_DIR}" >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_APP_PRIVATE = ${DATADIR}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_APP_DOCS = ${DOCSDIR}' >> ${WRKSRC}/LocalConfig.kmk .if ${SSL_DEFAULT} != base @${ECHO_CMD} 'VBOX_WITH_ALT_HASH_CODE = 1' >> ${WRKSRC}/LocalConfig.kmk .endif @${ECHO_CMD} 'VBOX_WITH_EXTPACK_VBOXDTRACE =' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_INSTALLER = 1' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_VBOXDRV =' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_TESTCASES =' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'SDK_VBOX_LIBPNG_INCS = ${PREFIX}/include/libpng' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'SDK_VBOX_LIBPNG_LIBS = png' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_ADDITIONS =' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP = ${VBOX_WITH_QT}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP_GH = ${VBOX_WITH_QT}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_VALIDATIONKIT =' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_X11_ADDITIONS =' >> ${WRKSRC}/LocalConfig.kmk .if ${PORT_OPTIONS:MR0LOGGING} @${ECHO_CMD} 'VBOX_WITH_R0_LOGGING = 1' >> ${WRKSRC}/LocalConfig.kmk .endif .if ${PORT_OPTIONS:MWEBSERVICE} @${ECHO_CMD} 'VBOX_WITH_WEBSERVICES = 1' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_GSOAP_INSTALLED = 1' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_GSOAP = ${PREFIX}/lib/gsoap' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_GSOAP_BIN = ${PREFIX}/bin' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_GSOAP_IMPORT = ${PREFIX}/share/gsoap/import' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_GCC_PEDANTIC_CXX = -Wshadow $$(VBOX_GCC_WARN) -Wno-long-long' >> \ ${WRKSRC}/LocalConfig.kmk @${REINPLACE_CMD} -E -e '/soap_socket_errno\(/s/(soap_socket_errno)(\([^)]+\))/\1/' \ ${WRKSRC}/src/VBox/Main/webservice/vboxweb.cpp .endif @${REINPLACE_CMD} -e 's| -finline-limit=8000||' \ - -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk + -e 's| -mpreferred-stack-boundary=2||' \ + -e 's|%%PYTHON_VERSION%%|${PYTHON_VERSION}|' \ + ${WRKSRC}/Config.kmk @${REINPLACE_CMD} -e 's| -fpermissive||' ${WRKSRC}/Config.kmk \ ${WRKSRC}/src/VBox/Main/webservice/Makefile.kmk @${ECHO_CMD} 'TOOL_VBoxGccFreeBSD_LD = ${CXX}' >> ${WRKSRC}/LocalConfig.kmk @${SED} -e 's|GXX3|VBoxGccFreeBSD|g' \ ${LOCALBASE}/share/kBuild/tools/GXX3.kmk > \ ${WRKSRC}/tools/kBuildTools/VBoxGccFreeBSD.kmk @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Config.kmk ${WRKSRC}/configure \ ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \ ${WRKSRC}/kBuild/units/qt5.kmk ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \ ${WRKSRC}/src/libs/xpcom18a4/python/gen_python_deps.py @${REINPLACE_CMD} \ -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \ -e 's|SUPPYTHONLIBS=.*|SUPPYTHONLIBS="${PYTHON_VERSION}${PYTHON_ABIVER}"|' \ ${WRKSRC}/configure .if empty(ICONV_LIB) @${REINPLACE_CMD} -e 's|iconv||' ${WRKSRC}/Config.kmk \ ${WRKSRC}/src/VBox/Runtime/Makefile.kmk @${ECHO_CMD} 'VBOX_ICONV_DEFS = LIBICONV_PLUG' >> ${WRKSRC}/LocalConfig.kmk .endif @${REINPLACE_CMD} -e 's|/usr/local/lib/virtualbox|${VBOX_DIR}|' \ -e 's|/usr/local|${PREFIX}|' \ ${WRKSRC}/src/VBox/Installer/freebsd/VBox.sh @${REINPLACE_CMD} \ -e 's|^versions =.*|versions = ["${PYTHON_VER}${PYTHON_ABIVER}"]|' \ ${WRKSRC}/src/libs/xpcom18a4/python/gen_python_deps.py do-build: cd ${WRKSRC} && ${SH} -c '. ${WRKSRC}/env.sh && \ ${KMK_CONFIG} ${LOCALBASE}/bin/kmk ${KMK_FLAGS}' .if ${PORT_OPTIONS:MPYTHON} ${PYTHON_CMD} -mcompileall \ ${KMK_BUILDDIR}/bin/sdk/bindings/xpcom/python/xpcom .endif do-install: .if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE} ${MKDIR} ${STAGEDIR}${DATADIR}/sdk .endif cd ${KMK_BUILDDIR}/bin/sdk/bindings/xpcom && \ ${COPYTREE_SHARE} "idl samples" ${STAGEDIR}${DATADIR} ${MKDIR} ${STAGEDIR}${PREFIX}/include/virtualbox cd ${KMK_BUILDDIR}/bin/sdk/bindings/xpcom/include && \ ${COPYTREE_SHARE} "*" ${STAGEDIR}${PREFIX}/include/virtualbox ${MKDIR} ${STAGEDIR}${VBOX_DIR} cd ${KMK_BUILDDIR}/bin && ${COPYTREE_SHARE} \ "*.fd *.r0 *.rc *.so components" ${STAGEDIR}${VBOX_DIR} .if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE} ${RLN} ${STAGEDIR}${DATADIR}/sdk ${STAGEDIR}${VBOX_DIR} .endif ${INSTALL_SCRIPT} ${WRKSRC}/src/VBox/Installer/freebsd/VBox.sh \ ${STAGEDIR}${VBOX_DIR} .for f in ${VBOX_PROGS} ${VBOX_UTILS} ${INSTALL_PROGRAM} ${KMK_BUILDDIR}/bin/${f} ${STAGEDIR}${VBOX_DIR} .endfor .for f in ${VBOX_PROGS} ${VBOX_LINKS} ${LN} -fs ../${VBOX_DIR_REL}/VBox.sh ${STAGEDIR}${PREFIX}/bin/${f} .endfor .for f in ${VBOX_PROGS} ${LN} -fs ../${VBOX_DIR_REL}/VBox.sh ${STAGEDIR}${PREFIX}/bin/${f:tl} .endfor .if ${PORT_OPTIONS:MGUESTADDITIONS} ${MKDIR} ${STAGEDIR}${VBOX_DIR}/additions ${INSTALL_DATA} ${DISTDIR}/${GUESTADDITIONS} \ ${STAGEDIR}${VBOX_DIR}/additions/ ${RLN} ${STAGEDIR}${VBOX_DIR}/additions/${GUESTADDITIONS} \ ${STAGEDIR}${VBOX_DIR}/additions/VBoxGuestAdditions.iso .endif .if ${PORT_OPTIONS:MMANUAL} ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${KMK_BUILDDIR}/bin/UserManual*.pdf \ ${STAGEDIR}${DOCSDIR} .endif .if ${PORT_OPTIONS:MNLS} cd ${KMK_BUILDDIR}/obj/VirtualBox/qtnls && \ ${COPYTREE_SHARE} "*.qm" ${STAGEDIR}${DATADIR}/nls .endif .if ${PORT_OPTIONS:MPYTHON} cd ${KMK_BUILDDIR}/bin/sdk/installer && \ ${SETENV} VBOX_INSTALL_PATH="${VBOX_DIR}" \ ${PYTHON_CMD} vboxapisetup.py install --root=${STAGEDIR} @${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}/xpcom cd ${KMK_BUILDDIR}/bin/sdk/bindings/xpcom/python/xpcom && \ ${COPYTREE_SHARE} "*" ${STAGEDIR}${PYTHON_SITELIBDIR}/xpcom @${MKDIR} ${STAGEDIR}${DATADIR}/sdk/bindings/xpcom/python ${RLN} ${STAGEDIR}${PYTHON_SITELIBDIR}/xpcom \ ${STAGEDIR}${DATADIR}/sdk/bindings/xpcom/python .endif .if ${PORT_OPTIONS:MQT5} ${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 .if ${PORT_OPTIONS:MVNC} ${MKDIR} ${STAGEDIR}${VBOX_DIR}/ExtensionPacks/VNC/${KMK_ARCH} ${INSTALL_DATA} ${KMK_BUILDDIR}/bin/ExtensionPacks/VNC/ExtPack* \ ${STAGEDIR}${VBOX_DIR}/ExtensionPacks/VNC/ ${INSTALL_LIB} ${KMK_BUILDDIR}/bin/ExtensionPacks/VNC/${KMK_ARCH}/* \ ${STAGEDIR}${VBOX_DIR}/ExtensionPacks/VNC/${KMK_ARCH}/ .endif .if ${PORT_OPTIONS:MWEBSERVICE} ${MKDIR} ${STAGEDIR}${DATADIR}/sdk/bindings/webservice ${INSTALL_DATA} ${KMK_BUILDDIR}/obj/webservice/vboxweb.wsdl \ ${STAGEDIR}${DATADIR}/sdk/bindings/webservice/ .endif + +post-install: + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/virtualbox/*.so \ + ${STAGEDIR}${PREFIX}/lib/virtualbox/components/*.so .include Index: head/emulators/virtualbox-ose/distinfo =================================================================== --- head/emulators/virtualbox-ose/distinfo (revision 542550) +++ head/emulators/virtualbox-ose/distinfo (revision 542551) @@ -1,5 +1,5 @@ -TIMESTAMP = 1571257463 -SHA256 (VirtualBox-5.2.34.tar.bz2) = 9abff37330bba46b97aa836bc886397ba9cfb06cb75be5d60ac31f5ae9c2f2e1 -SIZE (VirtualBox-5.2.34.tar.bz2) = 118268064 -SHA256 (VBoxGuestAdditions_5.2.34.iso) = d1b63891abca37fd78f5c8af1764e10e5754b1eecabd1fcfe7599c29a93ba007 -SIZE (VBoxGuestAdditions_5.2.34.iso) = 49661952 +TIMESTAMP = 1594897148 +SHA256 (VirtualBox-5.2.44.tar.bz2) = ad83b11cfae2734f7d6f619dd2f8bdada7d33492cd7682fab98cb4053122295e +SIZE (VirtualBox-5.2.44.tar.bz2) = 124016934 +SHA256 (VBoxGuestAdditions_5.2.44.iso) = 9883ee443a309f4ffa1d5dee2833f9e35ced598686c36d159f410e5edbac1ca4 +SIZE (VBoxGuestAdditions_5.2.44.iso) = 49829888 Index: head/emulators/virtualbox-ose/files/patch-Config.kmk =================================================================== --- head/emulators/virtualbox-ose/files/patch-Config.kmk (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-Config.kmk (revision 542551) @@ -1,215 +1,223 @@ ---- Config.kmk.orig 2019-10-10 18:06:26 UTC +--- Config.kmk.orig 2020-05-13 19:36:41 UTC +++ Config.kmk @@ -445,11 +445,11 @@ ifn1of ($(KBUILD_TARGET), win darwin) # Enable OSS audio support. VBOX_WITH_AUDIO_OSS = 1 endif -if1of ($(KBUILD_TARGET), linux) +if1of ($(KBUILD_TARGET), freebsd linux) # Enable ALSA audio support. VBOX_WITH_AUDIO_ALSA = 1 endif -if1of ($(KBUILD_TARGET), linux) +if1of ($(KBUILD_TARGET), freebsd linux) # Enable PulseAudio audio support. VBOX_WITH_AUDIO_PULSE = 1 endif @@ -464,11 +464,11 @@ VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT = 1 # Enable PCI passthrough support. VBOX_WITH_PCI_PASSTHROUGH = 1 # Enable statically linked dbus support. -if1of ($(KBUILD_TARGET), linux solaris) +if1of ($(KBUILD_TARGET), freebsd linux solaris) VBOX_WITH_DBUS = 1 endif # Enable building PAM modules. -if1of ($(KBUILD_TARGET), linux solaris) +if1of ($(KBUILD_TARGET), freebsd linux solaris) VBOX_WITH_PAM = 1 endif # Enable internal networking. @@ -664,7 +664,7 @@ VBOX_WITH_TESTCASES = 1 VBOX_WITH_VDITOOL = # Enable this to build vbox-img even if VBOX_WITH_TESTCASES is disabled VBOX_WITH_VBOX_IMG = -if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 linux.x86 linux.amd64 solaris.amd64 win.x86 win.amd64) +if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 freebsd.x86 freebsd.amd64 linux.x86 linux.amd64 solaris.amd64 win.x86 win.amd64) # Enables the video capturing support. VBOX_WITH_VIDEOREC = 1 # Enable VPX (VP8 / VP9 codec), used for video capturing. @@ -992,10 +992,6 @@ ifeq ($(KBUILD_TARGET),darwin) VBOX_WITH_VBOXSDL= endif -ifeq ($(KBUILD_TARGET),freebsd) - VBOX_WITH_DOCS= -endif - ifeq ($(KBUILD_TARGET),haiku) # Don't bother with SDL ttf for now. VBOX_WITH_SECURELABEL= @@ -1155,7 +1151,7 @@ ifdef VBOX_OSE VBOX_WITH_KCHMVIEWER= VBOX_WITH_PLUGIN_CRYPT= VBOX_WITH_DRAG_AND_DROP_PROMISES= - ifn1of ($(KBUILD_TARGET), linux) + ifn1of ($(KBUILD_TARGET), freebsd linux) VBOX_WITH_DOCS= VBOX_WITH_DOCS_PACKING= endif @@ -1176,14 +1172,14 @@ ifdef VBOX_OSE ifn1of ($(KBUILD_TARGET), darwin linux solaris win) VBOX_WITH_INSTALLER= endif - if1of ($(KBUILD_TARGET), win) + # if1of ($(KBUILD_TARGET), win) # Undefine codec libraries which are not needed. VBOX_WITH_LIBVPX= VBOX_WITH_LIBOPUS= # Disable video recording (with audio support). VBOX_WITH_VIDEOREC= VBOX_WITH_AUDIO_VIDEOREC= - endif + # endif # branding VBOX_BRAND_LICENSE_HTML := $(PATH_ROOT)/doc/License-gpl-2.0.html VBOX_BRAND_LICENSE_RTF := $(PATH_ROOT)/doc/License-gpl-2.0.rtf -@@ -2538,6 +2534,10 @@ ifeq ($(KBUILD_HOST),win) ## @todo can drop this now, +@@ -1810,6 +1806,7 @@ ifndef VBOX_BLD_PYTHON + else + VBOX_BLD_PYTHON := $(firstword $(which python2.7$(HOSTSUFF_EXE)) $(which python2.6$(HOSTSUFF_EXE)) \ + $(which python$(HOSTSUFF_EXE)) $(which python3$(HOSTSUFF_EXE)) \ ++ $(which %%PYTHON_VERSION%%) \ + python-not-found) + endif + endif +@@ -2550,6 +2547,10 @@ ifeq ($(KBUILD_HOST),win) ## @todo can drop this now, # This isn't important (yet) on windows, so cook the result until # cygwin is feeling better. VBOX_GCC_VERSION := $(int-add $(int-mul 10000, 3), $(int-mul 100, 3), 3) +else ifeq($(KBUILD_HOST,freebsd)) + # At a minimum, we'll be building with GCC 4.2 on FreeBSD. LLVM will always + # pose as GCC 4.2 anyways, so this seems safe. + VBOX_GCC_VERSION := $(int-add $(int-mul 10000, 4), $(int-mul 100, 2), 0) else # This is kind of bad, the returned string needs to be re-evaluated before use. # The reason for this hack is that the windows kmk_ash cannot deal with $((1+1)). -@@ -4158,6 +4154,7 @@ ifdef VBOX_WITH_RAW_MODE +@@ -4218,6 +4219,7 @@ ifdef VBOX_WITH_RAW_MODE TEMPLATE_VBoxRc_TOOL = $(VBOX_GCC32_TOOL) TEMPLATE_VBoxRc_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK) TEMPLATE_VBoxRc_CFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_IPRT_FMT_CHECK) + TEMPLATE_VBoxRc_CXXFLAGS.freebsd = -fno-builtin ifeq ($(KBUILD_TARGET),solaris) TEMPLATE_VBoxRc_LDFLAGS = -r else -@@ -4299,6 +4296,7 @@ ifeq ($(VBOX_LDR_FMT),elf) +@@ -4359,6 +4361,7 @@ ifeq ($(VBOX_LDR_FMT),elf) TEMPLATE_VBoxR0_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBoxR0_CFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-hidden) -std=gnu99 $(VBOX_GCC_IPRT_FMT_CHECK) TEMPLATE_VBoxR0_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK) +TEMPLATE_VBoxR0_CXXFLAGS.freebsd = -fno-builtin TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables ifeq ($(KBUILD_TARGET),solaris) -@@ -4623,7 +4621,7 @@ TEMPLATE_VBOXR0DRV_CFLAGS = \ +@@ -4683,7 +4686,7 @@ TEMPLATE_VBOXR0DRV_CFLAGS = \ -O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \ $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ -nostdinc -std=c99 -TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 +TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 --param inline-unit-growth=100 --param large-function-growth=1000 \ -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx \ -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -Wundef -@@ -4656,7 +4654,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS +@@ -4716,7 +4719,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS | 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 -@@ -4670,7 +4668,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS +@@ -4730,7 +4733,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS | xargs -J% objcopy % $(outbase).kld # Link the final .ko (a shared object). - ld $(flags) -Bshareable -o $(out) $(outbase).kld + ld $(flags) -Bshareable -znotext -o $(out) $(outbase).kld endef endif # x86 -@@ -4956,10 +4954,18 @@ TEMPLATE_VBOXR3EXE_LIBPATH += \ +@@ -5016,10 +5019,18 @@ TEMPLATE_VBOXR3EXE_LIBPATH += \ TEMPLATE_VBOXR3EXE_CFLAGS += -fno-pic TEMPLATE_VBOXR3EXE_CXXFLAGS += -fno-pic TEMPLATE_VBOXR3EXE_LDFLAGS += -fno-pic - else if1of ($(KBUILD_TARGET), freebsd openbsd) + else ifeq ($(KBUILD_TARGET),freebsd) TEMPLATE_VBOXR3EXE_TOOL = GXX3 TEMPLATE_VBOXR3EXE_LIBS = pthread +TEMPLATE_VBOXR3EXE_LDFLAGS.freebsd.x86 = -Wl,-z,notext TEMPLATE_VBOXR3EXE_INCS += \ + /usr/local/include +TEMPLATE_VBOXR3EXE_LIBPATH += \ + /usr/local/lib + else ifeq ($(KBUILD_TARGET),openbsd) +TEMPLATE_VBOXR3EXE_TOOL = GXX3 +TEMPLATE_VBOXR3EXE_LIBS = pthread +TEMPLATE_VBOXR3EXE_INCS += \ /usr/include \ /usr/X11R6/include \ /usr/local/include -@@ -5250,7 +5256,7 @@ ifeq ($(KBUILD_TARGET),win) # No CRT! +@@ -5310,7 +5321,7 @@ ifeq ($(KBUILD_TARGET),win) # No CRT! TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.win.amd64 = $(TEMPLATE_VBOXR3EXE_LDFLAGS.win.amd64) /entry:suplibHardenedWindowsMain TEMPLATE_VBOXR3HARDENEDEXE_LIBS.x86 = $(NOT_SUCH_VARIABLE) TEMPLATE_VBOXR3HARDENEDEXE_LIBS.amd64 = $(NOT_SUCH_VARIABLE) -else ifn1of ($(KBUILD_TARGET), os2 solaris) +else ifn1of ($(KBUILD_TARGET), freebsd os2 solaris) # We want to keep the RPATH on Solaris to be able to find libgcc_1/libstdc++ within $(VBOX_WITH_RUNPATH) TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS)) TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux)) -@@ -5777,10 +5783,18 @@ TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTI +@@ -5837,10 +5848,18 @@ TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTI else ifeq ($(KBUILD_TARGET),haiku) TEMPLATE_VBOXMAINEXE_TOOL = GXX3 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) network stdc++ supc++ - else if1of ($(KBUILD_TARGET), freebsd openbsd) + else ifeq ($(KBUILD_TARGET),freebsd) TEMPLATE_VBOXMAINEXE_TOOL = GXX3 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) +TEMPLATE_VBOXMAINEXE_LDFLAGS.freebsd.x86 = -Wl,-z,notext TEMPLATE_VBOXMAINEXE_INCS += \ + /usr/local/include +TEMPLATE_VBOXMAINEXE_LIBPATH += \ + /usr/local/lib + else ifeq ($(KBUILD_TARGET),openbsd) +TEMPLATE_VBOXMAINEXE_TOOL = GXX3 +TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) +TEMPLATE_VBOXMAINEXE_INCS += \ /usr/include \ /usr/X11R6/include \ /usr/local/include -@@ -6319,13 +6333,10 @@ ifdef VBOX_WITH_QTGUI +@@ -6382,13 +6401,10 @@ ifdef VBOX_WITH_QTGUI TEMPLATE_VBOXQTGUIEXE_LIBPATH += \ $(VBOX_LIBPATH_X11) ifeq ($(KBUILD_TARGET),freebsd) + TEMPLATE_VBOXQTGUIEXE_LDFLAGS.freebsd.x86 = -Wl,-z,notext TEMPLATE_VBOXQTGUIEXE_INCS += \ - /usr/include \ - /usr/X11R6/include \ /usr/local/include TEMPLATE_VBOXQTGUIEXE_LIBPATH += \ - /usr/lib \ - /usr/X11R6/lib \ /usr/local/lib endif ifeq ($(KBUILD_TARGET),solaris) -@@ -6548,12 +6559,8 @@ TEMPLATE_VBoxBldProg_LIBPATH += \ +@@ -6617,12 +6633,8 @@ TEMPLATE_VBoxBldProg_LIBPATH += \ TEMPLATE_VBoxBldProg_TOOL = GXX3 TEMPLATE_VBoxBldProg_LIBS = pthread TEMPLATE_VBoxBldProg_INCS += \ - /usr/include \ - /usr/X11R6/include \ /usr/local/include TEMPLATE_VBoxBldProg_LIBPATH += \ - /usr/lib \ - /usr/X11R6/lib \ /usr/local/lib else ifeq ($(KBUILD_HOST),netbsd) TEMPLATE_VBoxBldProg_TOOL = GXX3 -@@ -6954,6 +6961,7 @@ TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin += \ +@@ -7023,6 +7035,7 @@ TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin += \ -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.linux = -Wl,--no-as-needed +TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.freebsd = -Wl,--no-as-needed TEMPLATE_VBOXCROGLR3HOSTDLL_BLDDIRS = $(VBOX_PATH_CROGL_GENFILES)/ ifeq ($(KBUILD_TARGET),darwin) TEMPLATE_VBOXCROGLR3HOSTDLL_CFLAGS = $(TEMPLATE_VBOXR3NP_CFLAGS) -Wno-deprecated-declarations Index: head/emulators/virtualbox-ose/files/patch-configure =================================================================== --- head/emulators/virtualbox-ose/files/patch-configure (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-configure (revision 542551) @@ -1,121 +1,121 @@ ---- configure.orig 2018-07-16 14:56:48 UTC +--- configure.orig 2020-05-13 19:36:41 UTC +++ configure @@ -138,10 +138,14 @@ CXX_FLAGS="" if [ "$OS" = "freebsd" ]; then INCCURL="-I/usr/local/include" LIBCURL="-L/usr/local/lib -lcurl" + INCALSA="-I/usr/local/include" + LIBALSA="-L/usr/local/lib" INCPULSE="-I/usr/local/include" LIBPULSE="-L/usr/local/lib" INCPNG="-I/usr/local/include" LIBPNG="-L/usr/local/lib -lpng" + INCVNCSERVER="-I/usr/local/include" + LIBVNCSERVER="-L/usr/local/lib" else INCCURL="" LIBCURL="-lcurl" -@@ -436,6 +440,9 @@ check_gcc() +@@ -441,6 +445,9 @@ check_gcc() elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "$OS" = "darwin" ]; then log_success "found version $cc_ver" # gcc-4.0 is allowed for Darwin only + elif [ $cc_maj -eq 4 -a $cc_min -eq 2 -a "$OS" = "freebsd" ]; then + log_success "found version $cc_ver" + # gcc-4.2 is allowed for FreeBSD only elif [ $cc_maj -lt 4 \ -o \( $cc_maj -eq 4 -a $cc_min -lt 4 -a "$OS" != "darwin" \) \ - -o \( $cc_maj -eq 4 -a $cc_min -lt 2 -a "$OS" = "darwin" \) \ -@@ -1204,7 +1211,7 @@ extern "C" int main(void) + -o \( $cc_maj -eq 4 -a $cc_min -lt 2 -a "$OS" = "darwin" \) ]; then +@@ -1208,7 +1215,7 @@ extern "C" int main(void) #endif } EOF - if test_compile "-lasound" asound asound; then + if test_compile "$INCALSA $LIBALSA -lasound" asound asound; then test_execute fi } -@@ -1504,8 +1511,7 @@ EOF +@@ -1508,8 +1515,7 @@ EOF if [ $? -eq 0 ]; then echo "(Qt5 from pkg-config)" >> $LOG FLGQT5=`pkg-config Qt5Core --cflags` - # gcc 4.8 is able to compile with C++11 (see also VBOX_GCC_std in Config.kmk) - [ $cc_maj -eq 4 -a $cc_min -eq 8 ] && FLGQT5="$FLGQT5 -std=c++11" + FLGQT5="$FLGQT5 -std=c++11" INCQT5=`strip_I "$FLGQT5"` LIBDIR5=`pkg-config Qt5Core --variable=libdir` LIBQT5=`pkg-config Qt5Core --libs` -@@ -1644,7 +1650,7 @@ check_libopus() +@@ -1648,7 +1654,7 @@ check_libopus() fi cat > $ODIR.tmp_src.cc << EOF #include -#include +#include extern "C" int main(void) { OpusEncoder *test; -@@ -1976,8 +1982,8 @@ EOF +@@ -1980,8 +1986,8 @@ EOF echo "compiling the following source file:" >> $LOG cat $ODIR.tmp_src.cc >> $LOG echo "using the following command line:" >> $LOG - echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so" >> $LOG - $CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so >> $LOG 2>&1 + echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so -pthread" >> $LOG + $CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so -pthread >> $LOG 2>&1 if [ $? -eq 0 ]; then found=1 break -@@ -2449,7 +2455,7 @@ for option in "$@"; do +@@ -2453,7 +2459,7 @@ for option in "$@"; do --with-openssl-dir=*) OPENSSLDIR=`echo $option | cut -d'=' -f2` INCCRYPTO="-I${OPENSSLDIR}/include" - LIBCRYPTO="${OPENSSLDIR}/lib/libcrypto.a ${OPENSSLDIR}/lib/libssl.a" + LIBCRYPTO="-L${OPENSSLDIR}/lib -lssl -lcrypto" ;; --with-ow-dir=*) WATCOM=`echo $option | cut -d'=' -f2` -@@ -2763,7 +2769,7 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then +@@ -2767,7 +2773,7 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then check_ssl check_curl [ $WITH_LIBVPX -eq 1 ] && check_vpx - check_libopus + [ $OSE -eq 0 -a "$OS" != "win" ] && check_libopus [ "$OS" != "darwin" ] && check_z [ "$OS" != "darwin" ] && check_png [ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam -@@ -2784,13 +2790,20 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then +@@ -2788,13 +2794,20 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then [ $WITH_PYTHON -eq 1 ] && check_python [ $WITH_JAVA -eq 1 ] && check_java - # PulseAudio if [ "$OS" = "linux" -o "$OS" = "freebsd" -o "$OS" = "netbsd" ]; then + if [ $WITH_ALSA -eq 1 ]; then + check_alsa + else + cnf_append "VBOX_WITH_AUDIO_ALSA" "" + fi if [ $WITH_PULSE -eq 1 ]; then check_pulse elif [ $WITH_PULSE -eq 0 ]; then cnf_append "VBOX_WITH_AUDIO_PULSE" "" fi + if [ $WITH_DBUS -eq 0 ]; then + cnf_append "VBOX_WITH_DBUS" "" + fi fi fi -@@ -2806,14 +2819,6 @@ if [ "$OS" = "linux" ]; then +@@ -2810,14 +2823,6 @@ if [ "$OS" = "linux" ]; then cnf_append "VBOX_WITHOUT_LINUX_TEST_BUILDS" "1" fi if [ $ONLY_ADDITIONS -eq 0 ]; then - if [ $WITH_ALSA -eq 1 ]; then - check_alsa - else - cnf_append "VBOX_WITH_AUDIO_ALSA" "" - fi - if [ $WITH_DBUS -eq 0 ]; then - cnf_append "VBOX_WITH_DBUS" "" - fi if [ $WITH_DEVMAPPER -eq 1 ]; then check_libdevmapper else Index: head/emulators/virtualbox-ose/files/patch-include-VBox-vmm-cpumctx.h =================================================================== --- head/emulators/virtualbox-ose/files/patch-include-VBox-vmm-cpumctx.h (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-include-VBox-vmm-cpumctx.h (revision 542551) @@ -1,11 +1,11 @@ ---- include/VBox/vmm/cpumctx.h.orig 2015-03-12 18:53:45.762704000 -0400 -+++ include/VBox/vmm/cpumctx.h 2015-03-12 18:56:23.765105000 -0400 -@@ -84,7 +84,7 @@ +--- include/VBox/vmm/cpumctx.h.orig 2020-05-13 19:36:46 UTC ++++ include/VBox/vmm/cpumctx.h +@@ -88,7 +88,7 @@ AssertCompileSize(CPUMSELREG, 24); # define CPUMSELREG_ARE_HIDDEN_PARTS_VALID(a_pVCpu, a_pSelReg) \ ( ((a_pSelReg)->fFlags & CPUMSELREG_FLAGS_VALID) \ && ( (a_pSelReg)->ValidSel == (a_pSelReg)->Sel \ - || ( (a_pVCpu) /*!= NULL*/ \ + || ( ((a_pVCpu) != NULL) \ && (a_pSelReg)->ValidSel == ((a_pSelReg)->Sel & X86_SEL_MASK_OFF_RPL) \ && ((a_pSelReg)->Sel & X86_SEL_RPL) == 1 \ && ((a_pSelReg)->ValidSel & X86_SEL_RPL) == 0 \ Index: head/emulators/virtualbox-ose/files/patch-include-iprt-x86.h =================================================================== --- head/emulators/virtualbox-ose/files/patch-include-iprt-x86.h (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-include-iprt-x86.h (revision 542551) @@ -1,19 +1,19 @@ ---- include/iprt/x86.h.orig 2014-02-25 11:59:50.000000000 -0500 -+++ include/iprt/x86.h 2014-03-11 16:46:08.000000000 -0400 +--- include/iprt/x86.h.orig 2020-05-13 19:36:52 UTC ++++ include/iprt/x86.h @@ -35,6 +35,16 @@ # pragma D depends_on library vbox-types.d #endif +/* Workaround for FreeBSD machine/specialreg.h defining MSRs */ +#ifdef RT_OS_FREEBSD +# undef MSR_P5_MC_ADDR +# undef MSR_P5_MC_TYPE +# undef MSR_IA32_PLATFORM_ID +# undef MSR_BBL_CR_CTL3 +# undef MSR_IA32_MISC_ENABLE +# undef MSR_IA32_FEATURE_CONTROL +#endif + /* Workaround for Solaris sys/regset.h defining CS, DS */ #ifdef RT_OS_SOLARIS # undef CS Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c (revision 542551) @@ -1,257 +1,259 @@ ---- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig 2017-10-18 07:06:43 UTC +--- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig 2020-05-13 19:37:01 UTC +++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c -@@ -93,8 +93,6 @@ struct VBoxGuestDeviceState +@@ -102,8 +102,6 @@ struct VBoxGuestDeviceState struct resource *pIrqRes; /** Pointer to the IRQ handler. */ void *pfnIrqHandler; - /** VMMDev version */ - uint32_t u32Version; }; -@@ -104,8 +102,7 @@ struct VBoxGuestDeviceState +@@ -113,8 +111,7 @@ struct VBoxGuestDeviceState /* * Character device file handlers. */ -static d_fdopen_t vgdrvFreeBSDOpen; -static d_close_t vgdrvFreeBSDClose; +static d_open_t vgdrvFreeBSDOpen; static d_ioctl_t vgdrvFreeBSDIOCtl; static int vgdrvFreeBSDIOCtlSlow(PVBOXGUESTSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd); static d_write_t vgdrvFreeBSDWrite; -@@ -136,8 +133,7 @@ static struct cdevsw g_vgdrvFreeBSDCh +@@ -145,8 +142,7 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW = { .d_version = D_VERSION, .d_flags = D_TRACKCLOSE | D_NEEDMINOR, - .d_fdopen = vgdrvFreeBSDOpen, - .d_close = vgdrvFreeBSDClose, + .d_open = vgdrvFreeBSDOpen, .d_ioctl = vgdrvFreeBSDIOCtl, .d_read = vgdrvFreeBSDRead, .d_write = vgdrvFreeBSDWrite, -@@ -145,81 +141,28 @@ static struct cdevsw g_vgdrvFreeBSDCh +@@ -154,81 +150,28 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW = .d_name = "vboxguest" }; +/** 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_pvgdrvFreeBSDClones; -/** The dev_clone event handler tag. */ -static eventhandler_tag g_vgdrvFreeBSDEHTag; /** Reference counter */ static volatile uint32_t cUsers; /** selinfo structure used for polling. */ static struct selinfo g_SelInfo; -/** - * DEVFS event handler. - */ -static void vgdrvFreeBSDClone(void *pvArg, struct ucred *pCred, char *pszName, int cchName, struct cdev **ppDev) +static void vgdrvFreeBSDDtr(void *pSession) { - int iUnit; - int rc; - - Log(("vgdrvFreeBSDClone: pszName=%s ppDev=%p\n", pszName, ppDev)); - - /* - * One device node per user, si_drv1 points to the session. - * /dev/vboxguest 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(("vgdrvFreeBSDClone: iUnit=%d >= 256 - rejected\n", iUnit)); - return; - } - - Log(("vgdrvFreeBSDClone: pszName=%s iUnit=%d\n", pszName, iUnit)); - - rc = clone_create(&g_pvgdrvFreeBSDClones, &g_vgdrvFreeBSDChrDevSW, &iUnit, ppDev, 0); - Log(("vgdrvFreeBSDClone: clone_create -> %d; iUnit=%d\n", rc, iUnit)); - if (rc) - { - *ppDev = make_dev(&g_vgdrvFreeBSDChrDevSW, - iUnit, - UID_ROOT, - GID_WHEEL, - 0664, - "vboxguest%d", iUnit); - if (*ppDev) - { - dev_ref(*ppDev); - (*ppDev)->si_flags |= SI_CHEAPCLONE; - Log(("vgdrvFreeBSDClone: 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(("vgdrvFreeBSDClone: make_dev iUnit=%d failed\n", iUnit)); - } - else - Log(("vgdrvFreeBSDClone: Existing *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n", - *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2)); + VGDrvCommonCloseSession(&g_DevExt, pSession); + ASMAtomicDecU32(&cUsers); } /** * File open handler * */ -#if __FreeBSD_version >= 700000 -static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd, struct file *pFd) -#else -static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd) -#endif +static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, int DevType, struct thread *pTd) { int rc; PVBOXGUESTSESSION pSession; -@@ -227,25 +170,18 @@ static int vgdrvFreeBSDOpen(struct cdev +@@ -236,25 +179,18 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp LogFlow(("vgdrvFreeBSDOpen:\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 = VGDrvCommonCreateUserSession(&g_DevExt, &pSession); if (RT_SUCCESS(rc)) { - if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42)) - { - Log(("vgdrvFreeBSDOpen: success - g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf())); + Log(("vgdrvFreeBSDOpen: success - g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf())); + rc = devfs_set_cdevpriv(pSession, vgdrvFreeBSDDtr); + if (rc) + VGDrvCommonCloseSession(&g_DevExt, pSession); + else ASMAtomicIncU32(&cUsers); - return 0; - } - - VGDrvCommonCloseSession(&g_DevExt, pSession); + return rc; } LogRel(("vgdrvFreeBSDOpen: failed. rc=%d\n", rc)); -@@ -253,33 +189,6 @@ static int vgdrvFreeBSDOpen(struct cdev +@@ -262,33 +198,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp } /** - * File close handler - * - */ -static int vgdrvFreeBSDClose(struct cdev *pDev, int fFile, int DevType, struct thread *pTd) -{ - PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1; - Log(("vgdrvFreeBSDClose: fFile=%#x pSession=%p\n", fFile, pSession)); - - /* - * Close the session if it's still hanging on to the device... - */ - if (VALID_PTR(pSession)) - { - VGDrvCommonCloseSession(&g_DevExt, pSession); - if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, NULL, pSession)) - Log(("vgdrvFreeBSDClose: 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(("vgdrvFreeBSDClose: si_drv1=%p!\n", pSession)); - return 0; -} - - -/** * I/O control request. * * @returns depends... -@@ -292,7 +201,11 @@ static int vgdrvFreeBSDClose(struct cdev +@@ -301,8 +210,12 @@ static int vgdrvFreeBSDClose(struct cdev *pDev, int fF static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd) { PVBOXGUESTSESSION pSession; - devfs_get_cdevpriv((void **)&pSession); + int rc; -+ + + rc = devfs_get_cdevpriv((void **)&pSession); + if (rc) + return rc; - ++ /* * Deal with the fast ioctl path first. -@@ -488,12 +401,14 @@ int VBOXCALL VBoxGuestIDC(void *pvSessio + */ +@@ -497,12 +410,14 @@ int VBOXCALL VBoxGuestIDC(void *pvSession, uintptr_t u static int vgdrvFreeBSDPoll(struct cdev *pDev, int fEvents, struct thread *td) { - int fEventsProcessed; + PVBOXGUESTSESSION pSession; + int fEventsProcessed, rc; LogFlow(("vgdrvFreeBSDPoll: 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(("vgdrvFreeBSDPoll: no state data for %s\n", devtoname(pDev))); return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); } -@@ -534,10 +449,7 @@ static int vgdrvFreeBSDDetach(device_t p +@@ -543,11 +458,8 @@ static int vgdrvFreeBSDDetach(device_t pDevice) /* * Reverse what we did in vgdrvFreeBSDAttach. */ - if (g_vgdrvFreeBSDEHTag != NULL) - EVENTHANDLER_DEREGISTER(dev_clone, g_vgdrvFreeBSDEHTag); -- -- clone_cleanup(&g_pvgdrvFreeBSDClones); + destroy_dev(g_pDev); +- clone_cleanup(&g_pvgdrvFreeBSDClones); +- vgdrvFreeBSDRemoveIRQ(pDevice, pState); -@@ -689,18 +601,21 @@ static int vgdrvFreeBSDAttach(device_t p + if (pState->pVMMDevMemRes) +@@ -698,18 +610,21 @@ static int vgdrvFreeBSDAttach(device_t pDevice) if (RT_SUCCESS(rc)) { /* - * Configure device cloning. + * Configure device. */ - clone_setup(&g_pvgdrvFreeBSDClones); - g_vgdrvFreeBSDEHTag = EVENTHANDLER_REGISTER(dev_clone, vgdrvFreeBSDClone, 0, 1000); - if (g_vgdrvFreeBSDEHTag) + g_pDev = make_dev(&g_vgdrvFreeBSDChrDevSW, + 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_pvgdrvFreeBSDClones); + printf(DEVICE_NAME ": make_dev failed\n"); vgdrvFreeBSDRemoveIRQ(pDevice, pState); } else Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile (revision 542551) @@ -1,18 +1,18 @@ ---- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig 2017-10-18 07:06:43 UTC +--- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig 2020-05-13 19:37:01 UTC +++ src/VBox/Additions/common/VBoxGuest/freebsd/Makefile -@@ -70,6 +70,7 @@ SRCS += \ +@@ -80,6 +80,7 @@ SRCS += \ handletable.c \ handletablectx.c \ once.c \ + term.c \ thread.c .PATH: ${.CURDIR}/common/string -@@ -128,6 +129,7 @@ SRCS += \ +@@ -139,6 +140,7 @@ SRCS += \ .PATH: ${.CURDIR}/r0drv SRCS += \ + alloc-ef-r0drv.c \ alloc-r0drv.c \ initterm-r0drv.c \ memobj-r0drv.c \ Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest (revision 542551) @@ -1,26 +1,26 @@ ---- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig 2017-10-18 07:06:43 UTC +--- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig 2020-05-13 19:37:01 UTC +++ src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest -@@ -99,6 +99,7 @@ FILES_VBOXGUEST_NOBIN=" \ +@@ -109,6 +109,7 @@ FILES_VBOXGUEST_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp=>common/misc/RTAssertMsg1Weak.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \ -@@ -160,6 +161,7 @@ FILES_VBOXGUEST_NOBIN=" \ +@@ -171,6 +172,7 @@ FILES_VBOXGUEST_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/timer-generic.cpp=>generic/timer-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-ef-r0drv.cpp=>r0drv/alloc-ef-r0drv.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \ -@@ -186,6 +188,7 @@ FILES_VBOXGUEST_NOBIN=" \ +@@ -197,6 +199,7 @@ FILES_VBOXGUEST_NOBIN=" \ ${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 \ Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports.py =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports.py (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports.py (revision 542551) @@ -1,98 +1,98 @@ ---- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py.orig 2014-12-19 16:58:04.474417000 -0500 -+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py 2014-11-21 10:16:35.000000000 -0500 +--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py.orig 2020-06-26 09:52:40 UTC ++++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py @@ -0,0 +1,95 @@ +# Copyright (c) 2001, Stanford University +# All rights reserved. +# +# See the file LICENSE.txt for information on redistributing this software. + + +import sys + +import apiutil + + +def GenerateEntrypoints(): + + #apiutil.CopyrightC() + + # Get sorted list of dispatched functions. + # The order is very important - it must match cr_opcodes.h + # and spu_dispatch_table.h + print '%include "iprt/asmdefs.mac"' + print "" + print "%ifdef RT_ARCH_AMD64" + print "extern glim" + print "%else ; X86" + print "extern glim" + print "%endif" + print "" + + keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") + + for index in range(len(keys)): + func_name = keys[index] + if apiutil.Category(func_name) == "Chromium": + continue + if apiutil.Category(func_name) == "VBox": + continue + + print "BEGINPROC_EXPORTED gl%s" % func_name + print "%ifdef RT_ARCH_AMD64" + print "\tmov \trax, qword glim+%d" % (8*index) + print "\tjmp \t[rax]" + print "%else ; X86" + print "\tmov \teax, dword glim+%d" % (4*index) + print "\tjmp \t[eax]" + print "%endif" + print "ENDPROC gl%s" % func_name + print "" + + + print ';' + print '; Aliases' + print ';' + + # Now loop over all the functions and take care of any aliases + allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt") + for func_name in allkeys: + if "omit" in apiutil.ChromiumProps(func_name): + continue + + if func_name in keys: + # we already processed this function earlier + continue + + # alias is the function we're aliasing + alias = apiutil.Alias(func_name) + if alias: + # this dict lookup should never fail (raise an exception)! + index = keys.index(alias) + print "BEGINPROC_EXPORTED gl%s" % func_name + print "%ifdef RT_ARCH_AMD64" + print "\tmov \trax, qword glim+%d" % (8*index) + print "\tjmp \t[rax]" + print "%else ; X86" + print "\tmov \teax, dword glim+%d" % (4*index) + print "\tjmp \t[eax]" + print "%endif" + print "ENDPROC gl%s" % func_name + print "" + + + print ';' + print '; No-op stubs' + print ';' + + # Now generate no-op stub functions + for func_name in allkeys: + if "stub" in apiutil.ChromiumProps(func_name): + print "BEGINPROC_EXPORTED gl%s" % func_name + print "\tleave" + print "\tret" + print "ENDPROC gl%s" % func_name + print "" + + +GenerateEntrypoints() + Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports_dri.py =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports_dri.py (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports_dri.py (revision 542551) @@ -1,98 +1,98 @@ ---- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py.orig 2014-12-19 16:58:04.474417000 -0500 -+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py 2014-11-21 10:16:35.000000000 -0500 +--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py.orig 2020-06-26 09:53:28 UTC ++++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py @@ -0,0 +1,95 @@ +# Copyright (c) 2001, Stanford University +# All rights reserved. +# +# See the file LICENSE.txt for information on redistributing this software. + + +import sys + +import apiutil + + +def GenerateEntrypoints(): + + #apiutil.CopyrightC() + + # Get sorted list of dispatched functions. + # The order is very important - it must match cr_opcodes.h + # and spu_dispatch_table.h + print '%include "iprt/asmdefs.mac"' + print "" + print "%ifdef RT_ARCH_AMD64" + print "extern glim" + print "%else ; X86" + print "extern glim" + print "%endif" + print "" + + keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") + + for index in range(len(keys)): + func_name = keys[index] + if apiutil.Category(func_name) == "Chromium": + continue + if apiutil.Category(func_name) == "VBox": + continue + + print "BEGINPROC_EXPORTED cr_gl%s" % func_name + print "%ifdef RT_ARCH_AMD64" + print "\tmov \trax, qword glim+%d" % (8*index) + print "\tjmp \t[rax]" + print "%else ; X86" + print "\tmov \teax, dword glim+%d" % (4*index) + print "\tjmp \t[eax]" + print "%endif" + print "ENDPROC cr_gl%s" % func_name + print "" + + + print ';' + print '; Aliases' + print ';' + + # Now loop over all the functions and take care of any aliases + allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt") + for func_name in allkeys: + if "omit" in apiutil.ChromiumProps(func_name): + continue + + if func_name in keys: + # we already processed this function earlier + continue + + # alias is the function we're aliasing + alias = apiutil.Alias(func_name) + if alias: + # this dict lookup should never fail (raise an exception)! + index = keys.index(alias) + print "BEGINPROC_EXPORTED cr_gl%s" % func_name + print "%ifdef RT_ARCH_AMD64" + print "\tmov \trax, qword glim+%d" % (8*index) + print "\tjmp \t[rax]" + print "%else ; X86" + print "\tmov \teax, dword glim+%d" % (4*index) + print "\tjmp \t[eax]" + print "%endif" + print "ENDPROC cr_gl%s" % func_name + print "" + + + print ';' + print '; No-op stubs' + print ';' + + # Now generate no-op stub functions + for func_name in allkeys: + if "stub" in apiutil.ChromiumProps(func_name): + print "BEGINPROC_EXPORTED cr_gl%s" % func_name + print "\tleave" + print "\tret" + print "ENDPROC cr_gl%s" % func_name + print "" + + +GenerateEntrypoints() + Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_glxapi_exports.py =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_glxapi_exports.py (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_glxapi_exports.py (revision 542551) @@ -1,107 +1,107 @@ ---- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py.orig 2014-12-19 16:58:04.474417000 -0500 -+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py 2014-11-21 10:16:35.000000000 -0500 +--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py.orig 2020-06-26 09:53:39 UTC ++++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py @@ -0,0 +1,104 @@ +""" +Copyright (C) 2009-2012 Oracle Corporation + +This file is part of VirtualBox Open Source Edition (OSE), as +available from http://www.virtualbox.org. This file is free software; +you can redistribute it and/or modify it under the terms of the GNU +General Public License (GPL) as published by the Free Software +Foundation, in version 2 as it comes in the "COPYING" file of the +VirtualBox OSE distribution. VirtualBox OSE is distributed in the +hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +""" + +import sys + +#Note, this should match the fakedri_glxfuncsList.h order +glx_functions = [ +"CopyContext", +"UseXFont", +#"GetDriverConfig", +"GetProcAddress", +"QueryExtension", +"IsDirect", +"DestroyGLXPbufferSGIX", +"QueryGLXPbufferSGIX", +"CreateGLXPixmap", +"CreateGLXPixmapWithConfigSGIX", +"QueryContext", +"CreateContextWithConfigSGIX", +"SwapBuffers", +"CreateNewContext", +"SelectEventSGIX", +"GetCurrentDrawable", +"ChooseFBConfig", +"WaitGL", +"GetFBConfigs", +"CreatePixmap", +"GetSelectedEventSGIX", +"GetCurrentReadDrawable", +"GetCurrentDisplay", +"QueryServerString", +"CreateWindow", +"SelectEvent", +"GetVisualFromFBConfigSGIX", +"GetFBConfigFromVisualSGIX", +"QueryDrawable", +"CreateContext", +"GetConfig", +"CreateGLXPbufferSGIX", +"CreatePbuffer", +"ChooseFBConfigSGIX", +"WaitX", +"GetVisualFromFBConfig", +#"GetScreenDriver", +"GetFBConfigAttrib", +"GetCurrentContext", +"GetClientString", +"DestroyPixmap", +"MakeCurrent", +"DestroyContext", +"GetProcAddressARB", +"GetSelectedEvent", +"DestroyPbuffer", +"DestroyWindow", +"DestroyGLXPixmap", +"QueryVersion", +"ChooseVisual", +"MakeContextCurrent", +"QueryExtensionsString", +"GetFBConfigAttribSGIX", +"FreeMemoryMESA", +"QueryContextInfoEXT", +"ImportContextEXT", +"GetContextIDEXT", +"MakeCurrentReadSGI", +"AllocateMemoryMESA", +"GetMemoryOffsetMESA", +"CreateGLXPixmapMESA", +"GetCurrentDisplayEXT", +"FreeContextEXT" +]; + +print '%include "iprt/asmdefs.mac"' +print "" +print "%ifdef RT_ARCH_AMD64" +print "extern glxim" +print "%else ; X86" +print "extern glxim" +print "%endif" +print "" + +for index in range(len(glx_functions)): + func_name = glx_functions[index] + + print "BEGINPROC_EXPORTED vbox_glX%s" % func_name + print "%ifdef RT_ARCH_AMD64" + print "\tmov \trax, qword glxim+%d" % (8*index) + print "\tjmp \t[rax]" + print "%else ; X86" + print "\tmov \teax, dword glxim+%d" % (4*index) + print "\tjmp \t[eax]" + print "%endif" + print "ENDPROC vbox_glX%s" % func_name + print "" + Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-Makefile.kmk =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-Makefile.kmk (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-Makefile.kmk (revision 542551) @@ -1,79 +1,79 @@ ---- src/VBox/Additions/common/crOpenGL/Makefile.kmk.orig 2016-07-18 11:50:43 UTC +--- src/VBox/Additions/common/crOpenGL/Makefile.kmk.orig 2020-05-13 19:37:03 UTC +++ src/VBox/Additions/common/crOpenGL/Makefile.kmk -@@ -47,9 +47,7 @@ endif +@@ -50,9 +50,7 @@ endif if1of ($(KBUILD_TARGET), linux solaris freebsd) #VBoxOGL_DRI = 1 DLLS += VBoxEGL - ifn1of ($(KBUILD_TARGET),linux solaris) # No DRI on Solaris yet - VBoxOGL_FAKEDRI = 1 - endif + #VBoxOGL_FAKEDRI = 1 # Only Solaris right now needs C stubs because I can't figure out how to # generate the GOT based relocation ASM yet. -@@ -184,10 +182,12 @@ VBoxOGL_CLEAN.linux += \ +@@ -188,10 +186,12 @@ VBoxOGL_CLEAN.linux += \ $(VBOX_PATH_CROGL_GENFILES)/linux_exports.c VBoxOGL_CLEAN.solaris += \ $(VBOX_PATH_CROGL_GENFILES)/solaris_exports.c +VBoxOGL_CLEAN.freebsd += \ + $(VBOX_PATH_CROGL_GENFILES)/freebsd_exports.c VBoxOGL_CLEAN.win = \ $(VBOX_PATH_CROGL_GENFILES)/windows_exports.asm \ $(VBOX_PATH_CROGL_GENFILES)/cropengl.def -if1of ($(KBUILD_TARGET), linux solaris) +if1of ($(KBUILD_TARGET), linux solaris freebsd) ifdef VBoxOGL_DRI VBoxOGL_CLEAN += \ $(VBOX_PATH_CROGL_GENFILES)/cr_gl.h \ -@@ -200,6 +200,8 @@ if1of ($(KBUILD_TARGET), linux solaris) +@@ -204,6 +204,8 @@ if1of ($(KBUILD_TARGET), linux solaris) $(VBOX_PATH_CROGL_GENFILES)/linux_glxapi_exports.asm VBoxOGL_CLEAN.solaris += \ $(VBOX_PATH_CROGL_GENFILES)/solaris_glxapi_exports.asm + VBoxOGL_CLEAN.freebsd += \ + $(VBOX_PATH_CROGL_GENFILES)/freebsd_glxapi_exports.asm endif endif VBoxOGL_LIBS = \ -@@ -229,6 +231,8 @@ if1of ($(KBUILD_TARGET), linux solaris f +@@ -244,6 +246,8 @@ if1of ($(KBUILD_TARGET), linux solaris freebsd) else VBoxOGL_SONAME.linux = libGL.so.1 VBoxOGL_LDFLAGS.linux += -Wl,-e,LibMain + VBoxOGL_SONAME.freebsd = libGL.so.1 + VBoxOGL_LDFLAGS.freebsd += -Wl,-e,LibMain endif endif ifdef VBOX_WITH_CRHGSMI -@@ -237,7 +241,7 @@ endif +@@ -252,7 +256,7 @@ endif ifdef VBOX_WITH_WDDM VBoxOGL_DEFS.win += VBOX_WITH_WDDM endif -if1of ($(KBUILD_TARGET), linux) +if1of ($(KBUILD_TARGET), linux freebsd) VBoxOGL_LDFLAGS += -Wl,-z,nodelete endif ifdef VBOX_WITH_WDDM -@@ -395,6 +399,16 @@ $(VBOX_PATH_CROGL_GENFILES)/solaris_expo +@@ -418,6 +422,16 @@ $(VBOX_PATH_CROGL_GENFILES)/solaris_exports_dri.asm: \ $(VBOX_PATH_CROGL_GENFILES)/solaris_glxapi_exports.asm: $(PATH_SUB_CURRENT)/SunOS_i386_glxapi_exports.py | $$(dir $$@) $(call MSG_GENERATE,python,$@,$<) $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< + else ifeq ($(KBUILD_TARGET),freebsd) +$(VBOX_PATH_CROGL_GENFILES)/freebsd_exports_dri.asm: \ + $(PATH_SUB_CURRENT)/FreeBSD_i386_exports_dri.py \ + $(VBOX_CROGL_API_FILES) $(PATH_SUB_CURRENT)/entrypoints.py \ + | $$(dir $$@) + $(call MSG_GENERATE,python,$@,$<) + $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) +$(VBOX_PATH_CROGL_GENFILES)/freebsd_glxapi_exports.asm: $(PATH_SUB_CURRENT)/FreeBSD_i386_glxapi_exports.py | $$(dir $$@) + $(call MSG_GENERATE,python,$@,$<) + $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< else $(VBOX_PATH_CROGL_GENFILES)/linux_exports_dri.asm: \ -@@ -712,6 +726,7 @@ VBoxEGL_SOURCES = egl.c - VBoxEGL_INCS = $(VBOX_PATH_X11_ROOT)/mesa-11.0.7 - VBoxEGL_LIBS = $(VBOX_LIB_OGL) $(VBOX_LIB_IPRT_GUEST_R3_SHARED) +@@ -656,6 +670,7 @@ ifndef VBOX_USE_SYSTEM_GL_HEADERS + endif + VBoxEGL_LIBS = $(VBOX_LIB_OGL) # $(VBOX_LIB_IPRT_GUEST_R3_SHARED) VBoxEGL_SONAME.linux = libEGL.so.1 +VBoxEGL_SONAME.freebsd = libEGL.so.1 include $(FILE_KBUILD_SUB_FOOTER) Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient (revision 542551) @@ -1,17 +1,18 @@ ---- src/VBox/Additions/x11/Installer/98vboxadd-xclient.orig 2015-02-12 11:08:13.000000000 -0500 -+++ src/VBox/Additions/x11/Installer/98vboxadd-xclient 2015-02-12 14:38:40.689104000 -0500 -@@ -28,9 +28,9 @@ +--- src/VBox/Additions/x11/Installer/98vboxadd-xclient.orig 2020-05-13 19:37:09 UTC ++++ src/VBox/Additions/x11/Installer/98vboxadd-xclient +@@ -30,10 +30,10 @@ elif test -z "${SSH_CONNECTION}"; then # This script can also be triggered by a connection over SSH, which is not # what we had in mind, so we do not start VBoxClient in that case. We do # not use "exit" here as this script is "source"d, not executed. - /usr/bin/VBoxClient --clipboard - /usr/bin/VBoxClient --checkhostversion - /usr/bin/VBoxClient --display - /usr/bin/VBoxClient --seamless - /usr/bin/VBoxClient --draganddrop + /usr/local/bin/VBoxClient --clipboard + /usr/local/bin/VBoxClient --checkhostversion + /usr/local/bin/VBoxClient --display + /usr/local/bin/VBoxClient --seamless + /usr/local/bin/VBoxClient --draganddrop + /usr/bin/VBoxClient --vmsvga-x11 # In case VMSVGA emulation is enabled fi Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-vboxclient.desktop =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-vboxclient.desktop (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-vboxclient.desktop (revision 542551) @@ -1,10 +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 @@ +--- src/VBox/Additions/x11/Installer/vboxclient.desktop.orig 2020-05-13 19:37:09 UTC ++++ src/VBox/Additions/x11/Installer/vboxclient.desktop +@@ -8,6 +8,6 @@ Comment[C]=VirtualBox User Session Services 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 Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Network-slirp-bsd-sys-mbuf.h =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Network-slirp-bsd-sys-mbuf.h (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Network-slirp-bsd-sys-mbuf.h (revision 542551) @@ -1,12 +1,12 @@ ---- src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h.orig 2015-03-02 10:09:19.000000000 -0500 -+++ src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h 2015-03-02 19:42:56.808020000 -0500 -@@ -241,6 +241,9 @@ +--- src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h.orig 2020-05-13 19:42:23 UTC ++++ src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h +@@ -245,6 +245,9 @@ struct mbuf { #define M_FRAG 0x00000800 /* packet is a fragment of a larger packet */ #define M_FIRSTFRAG 0x00001000 /* packet is first fragment */ #define M_LASTFRAG 0x00002000 /* packet is last fragment */ +#ifdef M_SKIP_FIREWALL +#undef M_SKIP_FIREWALL +#endif #define M_SKIP_FIREWALL 0x00004000 /* skip firewall processing */ #define M_FREELIST 0x00008000 /* mbuf is on the free list */ #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-PC-ipxe-Makefile.kmk =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-PC-ipxe-Makefile.kmk (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-PC-ipxe-Makefile.kmk (revision 542551) @@ -1,11 +1,11 @@ ---- src/VBox/Devices/PC/ipxe/Makefile.kmk.orig 2013-11-29 14:23:32.000000000 -0500 -+++ src/VBox/Devices/PC/ipxe/Makefile.kmk 2013-12-13 15:06:45.000000000 -0500 -@@ -35,7 +35,7 @@ +--- src/VBox/Devices/PC/ipxe/Makefile.kmk.orig 2020-05-13 19:42:27 UTC ++++ src/VBox/Devices/PC/ipxe/Makefile.kmk +@@ -35,7 +35,7 @@ iPxeBiosBin_SOURCES = $(iPxeBiosBin_0_OUTDIR)/iPxeBio iPxeBiosBin_CLEAN = \ $(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c \ -if1of ($(KBUILD_TARGET), darwin os2 solaris win) +if1of ($(KBUILD_TARGET), darwin freebsd os2 solaris win) $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c: $(PATH_SUB_CURRENT)/iPxeBiosBin.rom $(VBOX_BIN2C) | $$(dir $$@) $(call MSG_TOOL,bin2c,iPxeBiosBin,$<,$@) $(QUIET)$(VBOX_BIN2C) -min 32 -max 56 -mask 0x1ff -export NetBiosBinary $< $@ Index: head/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile (revision 542551) @@ -1,27 +1,27 @@ ---- src/VBox/HostDrivers/Support/freebsd/Makefile.orig 2016-07-18 11:56:20 UTC +--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig 2020-05-13 19:43:53 UTC +++ src/VBox/HostDrivers/Support/freebsd/Makefile -@@ -81,6 +81,7 @@ SRCS += \ +@@ -82,6 +82,7 @@ SRCS += \ assert.c \ handletable.c \ handletablectx.c \ + handletablesimple.c \ once.c \ term.c \ thread.c -@@ -92,13 +93,14 @@ SRCS += \ +@@ -94,13 +95,14 @@ SRCS += \ RTStrCopy.c \ RTStrCopyEx.c \ RTStrCopyP.c \ + memchr.c \ strformat.c \ strformatrt.c \ strformattype.c \ + stringalloc.c \ strprintf.c \ strtonum.c \ - memchr.c \ - stringalloc.c + utf-8.c .PATH: ${.CURDIR}/common/rand SRCS += \ Index: head/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-files_vboxdrv =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-files_vboxdrv (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-files_vboxdrv (revision 542551) @@ -1,27 +1,27 @@ ---- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig 2016-07-18 11:56:20 UTC +--- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig 2020-05-13 19:43:53 UTC +++ src/VBox/HostDrivers/Support/freebsd/files_vboxdrv -@@ -116,6 +116,7 @@ FILES_VBOXDRV_NOBIN=" \ +@@ -118,6 +118,7 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.cpp=>common/misc/handletable.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablesimple.cpp=>common/misc/handletablesimple.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ -@@ -124,13 +125,14 @@ FILES_VBOXDRV_NOBIN=" \ +@@ -127,13 +128,14 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopyEx.cpp=>common/string/RTStrCopyEx.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNCmp.cpp=>common/string/RTStrNCmp.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNLen.cpp=>common/string/RTStrNLen.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.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 \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf.cpp=>common/string/strprintf.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strtonum.cpp=>common/string/strtonum.c \ - ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.c \ - ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/utf-8.cpp=>common/string/utf-8.c \ ${PATH_ROOT}/src/VBox/Runtime/common/rand/rand.cpp=>common/rand/rand.c \ ${PATH_ROOT}/src/VBox/Runtime/common/rand/randadv.cpp=>common/rand/randadv.c \ ${PATH_ROOT}/src/VBox/Runtime/common/rand/randparkmiller.cpp=>common/rand/randparkmiller.c \ Index: head/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk (revision 542551) @@ -1,25 +1,25 @@ Fix kmod panic when VIMAGE is disabled in the kernel and port Submitted by: Gleb Kurtsou ---- 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 @@ +--- src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk.orig 2020-05-13 19:43:54 UTC ++++ src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk +@@ -203,12 +203,15 @@ $$(VBoxNetAdp-src_0_OUTDIR)/Makefile: \ $$(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 + endif +- + ifndef VBOX_WITH_NETFLT_VIMAGE + $(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output $@.tmp $@ + ${QUIET}$(MV) -f $@.tmp $@ - endif -- ++ endif endif # freebsd include $(FILE_KBUILD_SUB_FOOTER) Index: head/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c (revision 542551) @@ -1,14 +1,14 @@ ---- src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c.orig 2014-09-09 15:54:30.000000000 -0400 -+++ src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c 2014-09-30 15:36:06.000000000 -0400 -@@ -234,7 +234,11 @@ +--- src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c.orig 2020-05-13 19:43:54 UTC ++++ src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c +@@ -235,7 +235,11 @@ static void VBoxNetAdpFreeBSDNetstart(struct ifnet *if ifp->if_drv_flags |= IFF_DRV_OACTIVE; while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { +#if __FreeBSD_version >= 1100036 + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); +#else ifp->if_opackets++; +#endif IFQ_DRV_DEQUEUE(&ifp->if_snd, m); BPF_MTAP(ifp, m); m_freem(m); Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Installer-Makefile.kmk =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Installer-Makefile.kmk (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Installer-Makefile.kmk (revision 542551) @@ -1,15 +1,14 @@ ---- src/VBox/Installer/Makefile.kmk.orig 2009-10-05 14:31:40.000000000 +0200 -+++ src/VBox/Installer/Makefile.kmk 2009-10-05 14:32:09.000000000 +0200 -@@ -38,10 +38,12 @@ +--- src/VBox/Installer/Makefile.kmk.orig 2020-05-13 19:44:01 UTC ++++ src/VBox/Installer/Makefile.kmk +@@ -41,9 +41,11 @@ ifndef VBOX_ONLY_SDK if "$(KBUILD_TARGET)" == "win" && "$(KBUILD_HOST)" == "win" include $(PATH_SUB_CURRENT)/win/Makefile.kmk endif +if 0 if "$(KBUILD_TARGET)" == "freebsd" && "$(KBUILD_HOST)" == "freebsd" include $(PATH_SUB_CURRENT)/freebsd/Makefile.kmk endif - endif +endif + endif include $(PATH_SUB_CURRENT)/common/Makefile.kmk - Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-virtualbox.desktop =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-virtualbox.desktop (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-virtualbox.desktop (revision 542551) @@ -1,10 +1,10 @@ ---- 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 @@ +--- src/VBox/Installer/freebsd/virtualbox.desktop.orig 2020-05-13 19:44:01 UTC ++++ src/VBox/Installer/freebsd/virtualbox.desktop +@@ -7,7 +7,6 @@ GenericName=Virtual Machine Type=Application Exec=VirtualBox TryExec=VirtualBox -DocPath=file://$VBOX_DOC_PATH/UserManual.pdf Icon=VBox Categories=Emulator;System; Comment=Run several virtual systems on a single host computer Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp (revision 542551) @@ -1,11 +1,11 @@ ---- src/VBox/Main/src-server/VirtualBoxImpl.cpp.orig 2015-04-01 12:15:14.000000000 -0400 -+++ src/VBox/Main/src-server/VirtualBoxImpl.cpp 2015-04-07 12:25:59.226583000 -0400 -@@ -2172,7 +2172,7 @@ +--- src/VBox/Main/src-server/VirtualBoxImpl.cpp.orig 2020-05-13 19:44:10 UTC ++++ src/VBox/Main/src-server/VirtualBoxImpl.cpp +@@ -2251,7 +2251,7 @@ int VirtualBox::i_encryptSettingBytes(const uint8_t *a if (aCiphertextSize < 32) return VERR_INVALID_PARAMETER; - AssertCompile(sizeof(m->SettingsCipherKey) >= 32); + // AssertCompile(sizeof(m->SettingsCipherKey) >= 32); /* store the first 8 bytes of the cipherkey for verification */ for (i = 0, j = 0; i < 8; i++, j++) Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-HostHardwareFreeBSD.cpp =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-HostHardwareFreeBSD.cpp (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-HostHardwareFreeBSD.cpp (revision 542551) @@ -1,14 +1,14 @@ ---- src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp.orig 2015-04-14 15:41:25.000000000 -0400 -+++ src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp 2015-04-14 18:25:23.156536000 -0400 -@@ -251,8 +251,9 @@ +--- src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp.orig 2020-05-13 19:44:10 UTC ++++ src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp +@@ -253,8 +253,9 @@ static int getDVDInfoFromCAM(DriveInfoList *pList, boo PeriphMatchPattern.pattern.periph_pattern.path_id = paMatches[i].result.device_result.path_id; PeriphMatchPattern.pattern.periph_pattern.target_id = paMatches[i].result.device_result.target_id; PeriphMatchPattern.pattern.periph_pattern.target_lun = paMatches[i].result.device_result.target_lun; - PeriphMatchPattern.pattern.periph_pattern.flags = PERIPH_MATCH_PATH | PERIPH_MATCH_TARGET | - PERIPH_MATCH_LUN; + PeriphMatchPattern.pattern.periph_pattern.flags = static_cast + (PERIPH_MATCH_PATH | PERIPH_MATCH_TARGET | + PERIPH_MATCH_LUN); PeriphCCB.cdm.num_patterns = 1; PeriphCCB.cdm.pattern_buf_len = sizeof(struct dev_match_result); PeriphCCB.cdm.patterns = &PeriphMatchPattern; Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Main-webservice-Makefile.kmk =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Main-webservice-Makefile.kmk (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Main-webservice-Makefile.kmk (revision 542551) @@ -1,39 +1,39 @@ ---- src/VBox/Main/webservice/Makefile.kmk.orig 2015-10-15 13:59:24 UTC +--- src/VBox/Main/webservice/Makefile.kmk.orig 2020-05-13 19:44:11 UTC +++ src/VBox/Main/webservice/Makefile.kmk -@@ -159,7 +159,6 @@ VBOX_PATH_IDL := $(abspa +@@ -158,7 +158,6 @@ VBOX_PATH_IDL := $(abspath $(PATH_SUB_ RECOMPILE_ON_MAKEFILE_CURRENT := $(MAKEFILE_CURRENT) PATH_TARGET_SOAPDEMOXML := $(VBOXWEB_OUT_DIR)/demo_soapxml -PATH_TARGET_SOAPDEMOHEADERS := $(VBOXWEB_OUT_DIR)/demo_headers PATH_TARGET_SOAPDEMONSMAPS := $(VBOXWEB_OUT_DIR)/demo_namespacemaps PATH_TARGET_WEBTEST := $(VBOXWEB_OUT_DIR)/webtest -@@ -515,8 +514,6 @@ $$(VBOX_JWSSRC_JAR): $$(VBOX_JWS_JAR) | +@@ -553,8 +552,6 @@ $$(VBOX_JWSSRC_JAR): $$(VBOX_JWS_JAR) | $$(dir $$@) $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts \ $(wildcard $(PATH_TARGET_SOAPDEMOXML)/*) \ $(PATH_TARGET_SOAPDEMOXML)/dummy_file \ - $(wildcard $(PATH_TARGET_SOAPDEMOHEADERS)/*) \ - $(PATH_TARGET_SOAPDEMOHEADERS)/dummy_file \ $(wildcard $(PATH_TARGET_SOAPDEMONSMAPS)/*) \ $(PATH_TARGET_SOAPDEMONSMAPS)/dummy_file -@@ -695,17 +692,14 @@ $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts +@@ -774,17 +771,14 @@ endif # any more. Ignoring the exit code is the simple solution, accepting the error. $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts: $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts | $$(dir $$@) $(RM) -f $@ - $(MKDIR) -p $(PATH_TARGET_SOAPDEMOXML) $(PATH_TARGET_SOAPDEMOHEADERS) $(PATH_TARGET_SOAPDEMONSMAPS) + $(MKDIR) -p $(PATH_TARGET_SOAPDEMOXML) $(PATH_TARGET_SOAPDEMONSMAPS) ifdef VBOX_GSOAP_VERBOSE $(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/*.req.xml $(VBOXWEB_OUT_DIR)/*.res.xml $(PATH_TARGET_SOAPDEMOXML)/ endif - -$(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/soapvbox*.h $(PATH_TARGET_SOAPDEMOHEADERS)/ $(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/vboxBinding.nsmap $(PATH_TARGET_SOAPDEMONSMAPS)/ $(APPEND) $@ done -$(PATH_TARGET_SOAPDEMONSMAPS) \ -$(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingProxy.h \ -$(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingObject.h: $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts +$(PATH_TARGET_SOAPDEMONSMAPS): $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts # soapcpp2 -2: generate SOAP 1.2 calls # soapcpp2 -S: server-side code only Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk (revision 542551) @@ -1,14 +1,14 @@ ---- src/VBox/Runtime/Makefile.kmk.orig 2014-07-15 13:25:15.000000000 -0400 -+++ src/VBox/Runtime/Makefile.kmk 2014-07-16 17:15:58.000000000 -0400 -@@ -146,6 +146,11 @@ - IPRT_BLDCFG_TYPE=\"$(KBUILD_TYPE)\" +--- src/VBox/Runtime/Makefile.kmk.orig 2020-05-13 19:44:16 UTC ++++ src/VBox/Runtime/Makefile.kmk +@@ -173,6 +173,11 @@ $(IPRT_OUT_DIR)/oiddb.h.ts +| $(IPRT_OUT_DIR)/oiddb.h: + # +# Set the defines that utf8-posix.cpp needs. It's used by several targets. +# +r3/posix/utf8-posix.cpp_DEFS.freebsd = $(VBOX_ICONV_DEFS) + +# # Unicode Specification reader used to regenerate unidata-*.cpp. # uniread_TEMPLATE = VBoxBldProg Index: head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h (revision 542551) @@ -1,20 +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 ---- 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 @@ +--- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig 2020-05-13 19:44:32 UTC ++++ src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h +@@ -82,6 +82,8 @@ DECLINLINE(uint32_t) rtR0SemBsdWaitUpdateTimeout(PRTR0 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 Index: head/emulators/virtualbox-ose/files/patch-src-recompiler-Makefile.kmk =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-recompiler-Makefile.kmk (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-recompiler-Makefile.kmk (revision 542551) @@ -1,10 +1,10 @@ ---- src/recompiler/Makefile.kmk.orig 2013-11-29 14:25:09.000000000 -0500 -+++ src/recompiler/Makefile.kmk 2013-12-13 14:23:11.000000000 -0500 -@@ -41,6 +41,7 @@ +--- src/recompiler/Makefile.kmk.orig 2020-05-13 19:46:49 UTC ++++ src/recompiler/Makefile.kmk +@@ -41,6 +41,7 @@ endif # ifneq ($(KBUILD_TARGET),win) VBoxRemPrimary_TEMPLATE = VBOXR3NP + VBoxRemPrimary_TOOL.freebsd = VBoxGccFreeBSD # workaround the regparm bug in gcc <= 3.3 VBoxRemPrimary_DEFS = $(if $(VBOX_GCC_BUGGY_REGPARM),GCC_WITH_BUGGY_REGPARM,) else Index: head/emulators/virtualbox-ose/files/patch-src-recompiler-Sun-testmath.c =================================================================== --- head/emulators/virtualbox-ose/files/patch-src-recompiler-Sun-testmath.c (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src-recompiler-Sun-testmath.c (revision 542551) @@ -1,22 +1,22 @@ ---- src/recompiler/Sun/testmath.c.orig 2011-01-14 21:15:07.000000000 +0100 -+++ src/recompiler/Sun/testmath.c 2011-08-05 13:54:49.000000000 +0200 -@@ -261,8 +261,6 @@ +--- src/recompiler/Sun/testmath.c.orig 2020-05-13 19:46:49 UTC ++++ src/recompiler/Sun/testmath.c +@@ -273,8 +273,6 @@ extern int testmath(void) #endif set_cw(0x27f); - CHECK(logl(2.7182818284590452353602874713526625L), 1.0); - CHECK(remainderl(1.0L, 1.0L), 0.0); CHECK(remainderl(1.0L, 1.5L), -0.5); CHECK(remainderl(42.0L, 34.25L), 7.75); -@@ -315,10 +313,6 @@ +@@ -341,10 +339,6 @@ extern int testmath(void) + CHECK(tanl(0.0L), 0.0); CHECK(tanl(0.7853981633974483096156608458198757L), 1.0); - +- - CHECK(powl(0.0, 0.0), 1.0); - CHECK(powl(2.0, 2.0), 4.0); - CHECK(powl(3.0, 3.0), 27.0); -- + return cErrors; } - Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp (revision 542551) @@ -1,20 +1,20 @@ ---- src/VBox/Additions/common/pam/pam_vbox.cpp.orig 2016-07-18 11:50:44 UTC +--- src/VBox/Additions/common/pam/pam_vbox.cpp.orig 2020-05-13 19:37:05 UTC +++ src/VBox/Additions/common/pam/pam_vbox.cpp -@@ -105,7 +105,7 @@ static void pam_vbox_writesyslog(char *p +@@ -105,7 +105,7 @@ static void pam_vbox_writesyslog(char *pszBuf) openlog("pam_vbox", LOG_PID, LOG_AUTHPRIV); syslog(LOG_ERR, "%s", pszBuf); closelog(); -#elif defined(RT_OS_SOLARIS) +#elif defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) syslog(LOG_ERR, "pam_vbox: %s\n", pszBuf); #endif } -@@ -180,7 +180,7 @@ static int vbox_set_msg(pam_handle_t *hP +@@ -184,7 +184,7 @@ static int vbox_set_msg(pam_handle_t *hPAM, int iStyle pam_message msg; msg.msg_style = iStyle; -#ifdef RT_OS_SOLARIS +#if defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) msg.msg = (char*)pszText; #else msg.msg = pszText; Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_Makefile =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_Makefile (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_Makefile (revision 542551) @@ -1,38 +1,38 @@ ---- src/VBox/Additions/freebsd/Makefile.orig 2017-04-28 16:59:22.000000000 +0200 -+++ src/VBox/Additions/freebsd/Makefile 2017-07-13 00:04:11.766870597 +0200 -@@ -31,6 +31,14 @@ +--- src/VBox/Additions/freebsd/Makefile.orig 2020-05-13 19:37:06 UTC ++++ src/VBox/Additions/freebsd/Makefile +@@ -30,6 +30,14 @@ all: cp vboxvfs/vboxvfs.ko .; \ fi; \ fi + @echo + @if [ -d mount_vboxvfs ]; then \ + echo "=== Building mount_vboxvfs binary ==="; \ + $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C mount_vboxvfs clean obj depend all; \ + if [ -f mount_vboxvfs ]; then \ + cp mount_vboxvfs/mount_vboxvfs .; \ + fi; \ + fi install: -@@ -38,13 +46,19 @@ +@@ -37,13 +45,19 @@ install: @if [ -d vboxvfs ]; then \ $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvfs install; \ fi + @if [ -d mount_vboxvfs ]; then \ + $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C mount_vboxvfs install; \ + fi clean: @$(MAKE) -C vboxguest clean @if [ -d vboxvfs ]; then \ $(MAKE) -C vboxvfs clean; \ fi - rm -f vboxguest.*o vboxvfs.*o + @if [ -d mount_vboxvfs ]; then \ + $(MAKE) -C mount_vboxvfs clean; \ + fi + rm -f vboxguest.*o vboxvfs.*o mount_vboxvfs load: @/sbin/kldunload vboxvfs || true Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk (revision 542551) @@ -1,49 +1,49 @@ ---- src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk.orig 2017-04-28 16:59:22.000000000 +0200 -+++ src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk 2017-07-13 00:52:49.020669620 +0200 -@@ -33,32 +33,36 @@ +--- src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk.orig 2020-05-13 19:37:06 UTC ++++ src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk +@@ -33,32 +33,36 @@ vboxvfs_INCS = \ $(vboxvfs_0_OUTDIR) vboxvfs_SOURCES = \ vboxvfs_vfsops.c \ - vboxvfs_vnops.c + vboxvfs_vnops.c \ + vboxvfs_prov.c vboxvfs_LIBS = \ $(VBOX_LIB_VBGL_R0) \ $(VBOX_LIB_IPRT_GUEST_R0) vboxvfs_DEPS = \ - $$(vboxvfs_0_OUTDIR)/vnode_if.h \ - $$(vboxvfs_0_OUTDIR)/vnode_if_newproto.h \ - $$(vboxvfs_0_OUTDIR)/vnode_if_typedef.h + $(vboxvfs_0_OUTDIR)/vnode_if.h \ + $(vboxvfs_0_OUTDIR)/vnode_if_newproto.h \ + $(vboxvfs_0_OUTDIR)/vnode_if_typedef.h vboxvfs_CLEAN += $(vboxvfs_DEPS) VBOX_AWK := /usr/bin/awk -$$(vboxvfs_0_OUTDIR)/vnode_if.h: $(VBOX_FREEBSD_SRC)/kern/vnode_if.src +$$(vboxvfs_0_OUTDIR): + $(QUIET)$(MKDIR) -p $(vboxvfs_0_OUTDIR) + +$$(vboxvfs_0_OUTDIR)/vnode_if.h: $$(vboxvfs_0_OUTDIR) $(VBOX_FREEBSD_SRC)/kern/vnode_if.src $(call MSG_TOOL,awk,VBoxGuest,$<,$@) $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/vnode_if.awk $(VBOX_FREEBSD_SRC)/kern/vnode_if.src -h - $(QUIET)$(MV) $(vboxvfs_0_OUTDIR)/vnode_if.h $(vboxvfs_0_OUTDIR)/vnode_if.h + $(QUIET)$(MV) vnode_if.h $(vboxvfs_0_OUTDIR)/vnode_if.h -$$(vboxvfs_0_OUTDIR)/vnode_if_newproto.h: $(VBOX_FREEBSD_SRC)/kern/vnode_if.src +$$(vboxvfs_0_OUTDIR)/vnode_if_newproto.h: $$(vboxvfs_0_OUTDIR) $(VBOX_FREEBSD_SRC)/kern/vnode_if.src $(call MSG_TOOL,awk,VBoxGuest,$<,$@) $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/vnode_if.awk $(VBOX_FREEBSD_SRC)/kern/vnode_if.src -p - $(QUIET)$(MV) $(vboxvfs_0_OUTDIR)/vnode_if_newproto.h $(vboxvfs_0_OUTDIR)/vnode_if_newproto.h + $(QUIET)$(MV) vnode_if_newproto.h $(vboxvfs_0_OUTDIR)/vnode_if_newproto.h -$$(vboxvfs_0_OUTDIR)/vnode_if_typedef.h: $(VBOX_FREEBSD_SRC)/kern/vnode_if.src +$$(vboxvfs_0_OUTDIR)/vnode_if_typedef.h: $$(vboxvfs_0_OUTDIR) $(VBOX_FREEBSD_SRC)/kern/vnode_if.src $(call MSG_TOOL,awk,VBoxGuest,$<,$@) $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/vnode_if.awk $(VBOX_FREEBSD_SRC)/kern/vnode_if.src -q - $(QUIET)$(MV) $(vboxvfs_0_OUTDIR)/vnode_if_typedef.h $(vboxvfs_0_OUTDIR)/vnode_if_typedef.h + $(QUIET)$(MV) vnode_if_typedef.h $(vboxvfs_0_OUTDIR)/vnode_if_typedef.h include $(FILE_KBUILD_SUB_FOOTER) Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__prov.c =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__prov.c (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__prov.c (revision 542551) @@ -1,1023 +1,1023 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c.orig 1970-01-01 01:00:00.000000000 +0100 -+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c 2017-07-12 19:24:26.109029000 +0200 +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c.orig 2020-06-26 09:59:35 UTC ++++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c @@ -0,0 +1,1020 @@ +/* + * Copyright (C) 2008-2016 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +/* + * Provider interfaces for shared folder file system. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "vboxvfs.h" + +#define DIRENT_RECLEN(namelen) \ + ((offsetof(struct dirent, d_name[0]) + 1 + (namelen) + 7) & ~ 7) +#define DIRENT_NAMELEN(reclen) \ + ((reclen) - (offsetof(struct dirent, d_name[0]))) + +static VBGLSFCLIENT vbox_client; + +extern u_int vboxvfs_debug; + +static int +sfprov_vbox2errno(int rc) +{ + if (rc == VERR_ACCESS_DENIED) + return (EACCES); + if (rc == VERR_INVALID_NAME) + return (ENOENT); + return (RTErrConvertToErrno(rc)); +} + +/* + * utility to create strings + */ +static SHFLSTRING * +sfprov_string(char *path, int *sz) +{ + SHFLSTRING *str; + int len = strlen(path); + + *sz = len + 1 + sizeof (*str) - sizeof (str->String); + str = malloc(*sz, M_VBOXVFS, M_WAITOK | M_ZERO); + str->u16Size = len + 1; + str->u16Length = len; + strcpy(str->String.utf8, path); + return (str); +} + +sfp_connection_t * +sfprov_connect(int version) +{ + /* only one version for now, so must match */ + int error = -1; + + if (version != SFPROV_VERSION) { + printf("%s: version mismatch (%d, expected %d)\n", __func__, + version, SFPROV_VERSION); + return (NULL); + } + + if (RT_FAILURE(VbglR0SfInit())) + return (NULL); + + if (RT_FAILURE(VbglR0SfConnect(&vbox_client))) { + VbglR0SfTerm(); + return (NULL); + } + + if (RT_FAILURE(VbglR0SfSetUtf8(&vbox_client))) { + VbglR0SfDisconnect(&vbox_client); + VbglR0SfTerm(); + return (NULL); + } + return ((sfp_connection_t *)&vbox_client); +} + +void +sfprov_disconnect() +{ + VbglR0SfDisconnect(&vbox_client); + VbglR0SfTerm(); +} + +int +sfprov_mount(char *path, sfp_mount_t **mnt) +{ + sfp_mount_t *m; + SHFLSTRING *str; + int size; + int rc; + + VBOXVFS_DEBUG(1, "%s: Enter", __FUNCTION__); + VBOXVFS_DEBUG(1, "%s: path: [%s]", __FUNCTION__, path); + + m = malloc(sizeof (*m), M_VBOXVFS, M_WAITOK | M_ZERO); + str = sfprov_string(path, &size); + + int error; + rc = VbglR0SfMapFolder(&vbox_client, str, &m->map); + if (RT_FAILURE(rc)) { + free(m, M_VBOXVFS); + *mnt = NULL; + error = sfprov_vbox2errno(rc); + } else { + *mnt = m; + error = 0; + } + free(str, M_VBOXVFS); + printf("%s(%s): error=%d rc=%d\n", __func__, path, error, rc); + return (error); +} + +int +sfprov_unmount(sfp_mount_t *mnt) +{ + int rc; + + rc = VbglR0SfUnmapFolder(&vbox_client, &mnt->map); + if (RT_FAILURE(rc)) { + printf("sfprov_unmount: VbglR0SfUnmapFolder() failed rc=%d\n", rc); + rc = sfprov_vbox2errno(rc); + } else { + rc = 0; + } + + free(mnt, M_VBOXVFS); + return (rc); +} + +/* + * query information about a mounted file system + */ +int +sfprov_get_fsinfo(sfp_mount_t *mnt, sffs_fsinfo_t *fsinfo) +{ + int rc; + SHFLVOLINFO info; + uint32_t bytes = sizeof(SHFLVOLINFO); + size_t bytesused; + + rc = VbglR0SfFsInfo(&vbox_client, &mnt->map, 0, + (SHFL_INFO_GET | SHFL_INFO_VOLUME), &bytes, (SHFLDIRINFO *)&info); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + + fsinfo->blksize = info.ulBytesPerAllocationUnit; + bytesused = + info.ullTotalAllocationBytes - info.ullAvailableAllocationBytes; + fsinfo->blksused = bytesused / info.ulBytesPerAllocationUnit; + fsinfo->blksavail = info.ullAvailableAllocationBytes / + info.ulBytesPerAllocationUnit; + fsinfo->maxnamesize = info.fsProperties.cbMaxComponent; + fsinfo->readonly = info.fsProperties.fReadOnly; + fsinfo->serial = info.ulSerial; + return (0); +} + +/* + * file/directory information conversions. + */ +static void +sfprov_fmode_from_mode(RTFMODE *fMode, mode_t mode) +{ + RTFMODE m = 0; + +#define mode_set(r) ((mode & (S_##r)) ? RTFS_UNIX_##r : 0) + m = mode_set (ISUID); + m |= mode_set (ISGID); + m |= (mode & S_ISVTX) ? RTFS_UNIX_ISTXT : 0; + m |= mode_set (IRUSR); + m |= mode_set (IWUSR); + m |= mode_set (IXUSR); + m |= mode_set (IRGRP); + m |= mode_set (IWGRP); + m |= mode_set (IXGRP); + m |= mode_set (IROTH); + m |= mode_set (IWOTH); + m |= mode_set (IXOTH); + + if (S_ISDIR(mode)) + m |= RTFS_TYPE_DIRECTORY; + else if (S_ISREG(mode)) + m |= RTFS_TYPE_FILE; + else if (S_ISFIFO(mode)) + m |= RTFS_TYPE_FIFO; + else if (S_ISCHR(mode)) + m |= RTFS_TYPE_DEV_CHAR; + else if (S_ISBLK(mode)) + m |= RTFS_TYPE_DEV_BLOCK; + else if (S_ISLNK(mode)) + m |= RTFS_TYPE_SYMLINK; + else if (S_ISSOCK(mode)) + m |= RTFS_TYPE_SOCKET; + else + m |= RTFS_TYPE_FILE; + + *fMode = m; +} + +static void +sfprov_mode_from_fmode(mode_t *mode, RTFMODE fMode) +{ + mode_t m = 0; + + if (RTFS_IS_DIRECTORY(fMode)) + m |= S_IFDIR; + else if (RTFS_IS_FILE(fMode)) + m |= S_IFREG; + else if (RTFS_IS_FIFO(fMode)) + m |= S_IFIFO; + else if (RTFS_IS_DEV_CHAR(fMode)) + m |= S_IFCHR; + else if (RTFS_IS_DEV_BLOCK(fMode)) + m |= S_IFBLK; + else if (RTFS_IS_SYMLINK(fMode)) + m |= S_IFLNK; + else if (RTFS_IS_SOCKET(fMode)) + m |= S_IFSOCK; + + if (fMode & RTFS_UNIX_IRUSR) + m |= S_IRUSR; + if (fMode & RTFS_UNIX_IWUSR) + m |= S_IWUSR; + if (fMode & RTFS_UNIX_IXUSR) + m |= S_IXUSR; + if (fMode & RTFS_UNIX_IRGRP) + m |= S_IRGRP; + if (fMode & RTFS_UNIX_IWGRP) + m |= S_IWGRP; + if (fMode & RTFS_UNIX_IXGRP) + m |= S_IXGRP; + if (fMode & RTFS_UNIX_IROTH) + m |= S_IROTH; + if (fMode & RTFS_UNIX_IWOTH) + m |= S_IWOTH; + if (fMode & RTFS_UNIX_IXOTH) + m |= S_IXOTH; + if (fMode & RTFS_UNIX_ISUID) + m |= S_ISUID; + if (fMode & RTFS_UNIX_ISGID) + m |= S_ISGID; + if (fMode & RTFS_UNIX_ISTXT) + m |= S_ISVTX; + *mode = m; +} + +static void +sfprov_ftime_from_timespec(struct timespec *time, RTTIMESPEC *ts) +{ + uint64_t nanosec = RTTimeSpecGetNano(ts); + time->tv_sec = nanosec / UINT64_C(1000000000); + time->tv_nsec = nanosec % UINT64_C(1000000000); +} + +static void +sfprov_stat_from_info(sffs_stat_t *stat, SHFLFSOBJINFO *info) +{ + sfprov_mode_from_fmode(&stat->sf_mode, info->Attr.fMode); + stat->sf_size = info->cbObject; + stat->sf_alloc = info->cbAllocated; + sfprov_ftime_from_timespec(&stat->sf_atime, &info->AccessTime); + sfprov_ftime_from_timespec(&stat->sf_mtime, &info->ModificationTime); + sfprov_ftime_from_timespec(&stat->sf_ctime, &info->ChangeTime); +} + +/* + * File operations: open/close/read/write/etc. + * + * open/create can return any relevant errno, however ENOENT + * generally means that the host file didn't exist. + */ +int +sfprov_create( + sfp_mount_t *mnt, + char *path, + mode_t mode, + sfp_file_t **fp, + sffs_stat_t *stat) +{ + int rc; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + int size; + sfp_file_t *newfp; + + str = sfprov_string(path, &size); + parms.Handle = SHFL_HANDLE_NIL; + parms.Info.cbObject = 0; + sfprov_fmode_from_mode(&parms.Info.Attr.fMode, mode); + parms.CreateFlags = SHFL_CF_ACT_CREATE_IF_NEW | + SHFL_CF_ACT_REPLACE_IF_EXISTS | SHFL_CF_ACCESS_READWRITE; + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + free(str, M_VBOXVFS); + + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + if (parms.Handle == SHFL_HANDLE_NIL) { + if (parms.Result == SHFL_FILE_EXISTS) + return (EEXIST); + return (ENOENT); + } + newfp = malloc(sizeof(sfp_file_t), M_VBOXVFS, M_WAITOK | M_ZERO); + newfp->handle = parms.Handle; + newfp->map = mnt->map; + *fp = newfp; + sfprov_stat_from_info(stat, &parms.Info); + return (0); +} + +int +sfprov_open(sfp_mount_t *mnt, char *path, sfp_file_t **fp) +{ + int rc; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + int size; + sfp_file_t *newfp; + + /* + * First we attempt to open it read/write. If that fails we + * try read only. + */ + bzero(&parms, sizeof(parms)); + str = sfprov_string(path, &size); + parms.Handle = SHFL_HANDLE_NIL; + parms.Info.cbObject = 0; + parms.CreateFlags = SHFL_CF_ACT_FAIL_IF_NEW | SHFL_CF_ACCESS_READWRITE; + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + if (RT_FAILURE(rc) && rc != VERR_ACCESS_DENIED) { + free(str, M_VBOXVFS); + return (sfprov_vbox2errno(rc)); + } + if (parms.Handle == SHFL_HANDLE_NIL) { + if (parms.Result == SHFL_PATH_NOT_FOUND || + parms.Result == SHFL_FILE_NOT_FOUND) { + free(str, M_VBOXVFS); + return (ENOENT); + } + parms.CreateFlags = + SHFL_CF_ACT_FAIL_IF_NEW | SHFL_CF_ACCESS_READ; + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + if (RT_FAILURE(rc)) { + free(str, M_VBOXVFS); + return (sfprov_vbox2errno(rc)); + } + if (parms.Handle == SHFL_HANDLE_NIL) { + free(str, M_VBOXVFS); + return (ENOENT); + } + } + else + free(str, M_VBOXVFS); + newfp = malloc(sizeof(sfp_file_t), M_VBOXVFS, M_WAITOK | M_ZERO); + newfp->handle = parms.Handle; + newfp->map = mnt->map; + *fp = newfp; + return (0); +} + +int +sfprov_trunc(sfp_mount_t *mnt, char *path) +{ + int rc; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + int size; + + /* + * open it read/write. + */ + str = sfprov_string(path, &size); + parms.Handle = 0; + parms.Info.cbObject = 0; + parms.CreateFlags = SHFL_CF_ACT_FAIL_IF_NEW | SHFL_CF_ACCESS_READWRITE | + SHFL_CF_ACT_OVERWRITE_IF_EXISTS; + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + free(str, M_VBOXVFS); + + if (RT_FAILURE(rc)) { + return (sfprov_vbox2errno(rc)); + } + (void)VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); + return (0); +} + +int +sfprov_close(sfp_file_t *fp) +{ + int rc; + + rc = VbglR0SfClose(&vbox_client, &fp->map, fp->handle); + free(fp, M_VBOXVFS); + return (0); +} + +int +sfprov_read(sfp_file_t *fp, char *buffer, uint64_t offset, uint32_t *numbytes, + int buflocked) +{ + int rc; + + rc = VbglR0SfRead(&vbox_client, &fp->map, fp->handle, offset, + numbytes, (uint8_t *)buffer, buflocked); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + return (0); +} + +int +sfprov_write(sfp_file_t *fp, char *buffer, uint64_t offset, uint32_t *numbytes, + int buflocked) +{ + int rc; + + rc = VbglR0SfWrite(&vbox_client, &fp->map, fp->handle, offset, + numbytes, (uint8_t *)buffer, buflocked); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + return (0); +} + +int +sfprov_fsync(sfp_file_t *fp) +{ + int rc; + + rc = VbglR0SfFlush(&vbox_client, &fp->map, fp->handle); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + return (0); +} + + +static int +sfprov_getinfo(sfp_mount_t *mnt, char *path, PSHFLFSOBJINFO info) +{ + int rc; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + int size; + + str = sfprov_string(path, &size); + parms.Handle = 0; + parms.Info.cbObject = 0; + parms.CreateFlags = SHFL_CF_LOOKUP | SHFL_CF_ACT_FAIL_IF_NEW; + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + free(str, M_VBOXVFS); + + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + if (parms.Result != SHFL_FILE_EXISTS) + return (ENOENT); + *info = parms.Info; + return (0); +} + +/* + * get information about a file (or directory) + */ +int +sfprov_get_mode(sfp_mount_t *mnt, char *path, mode_t *mode) +{ + int rc; + SHFLFSOBJINFO info; + + rc = sfprov_getinfo(mnt, path, &info); + if (rc) + return (rc); + sfprov_mode_from_fmode(mode, info.Attr.fMode); + return (0); +} + +int +sfprov_get_size(sfp_mount_t *mnt, char *path, uint64_t *size) +{ + int rc; + SHFLFSOBJINFO info; + + rc = sfprov_getinfo(mnt, path, &info); + if (rc) + return (rc); + *size = info.cbObject; + return (0); +} + + +int +sfprov_get_atime(sfp_mount_t *mnt, char *path, struct timespec *time) +{ + int rc; + SHFLFSOBJINFO info; + + rc = sfprov_getinfo(mnt, path, &info); + if (rc) + return (rc); + sfprov_ftime_from_timespec(time, &info.AccessTime); + return (0); +} + +int +sfprov_get_mtime(sfp_mount_t *mnt, char *path, struct timespec *time) +{ + int rc; + SHFLFSOBJINFO info; + + rc = sfprov_getinfo(mnt, path, &info); + if (rc) + return (rc); + sfprov_ftime_from_timespec(time, &info.ModificationTime); + return (0); +} + +int +sfprov_get_ctime(sfp_mount_t *mnt, char *path, struct timespec *time) +{ + int rc; + SHFLFSOBJINFO info; + + rc = sfprov_getinfo(mnt, path, &info); + if (rc) + return (rc); + sfprov_ftime_from_timespec(time, &info.ChangeTime); + return (0); +} + +int +sfprov_get_attr(sfp_mount_t *mnt, char *path, sffs_stat_t *attr) +{ + int rc; + SHFLFSOBJINFO info; + + rc = sfprov_getinfo(mnt, path, &info); + if (rc) + return (rc); + sfprov_stat_from_info(attr, &info); + return (0); +} + +static void +sfprov_timespec_from_ftime(RTTIMESPEC *ts, struct timespec time) +{ + uint64_t nanosec = UINT64_C(1000000000) * time.tv_sec + time.tv_nsec; + RTTimeSpecSetNano(ts, nanosec); +} + +int +sfprov_set_attr( + sfp_mount_t *mnt, + char *path, + mode_t mode, + struct timespec atime, + struct timespec mtime, + struct timespec ctime) +{ + int rc, err; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + SHFLFSOBJINFO info; + uint32_t bytes; + int str_size; + + str = sfprov_string(path, &str_size); + parms.Handle = 0; + parms.Info.cbObject = 0; + parms.CreateFlags = SHFL_CF_ACT_OPEN_IF_EXISTS + | SHFL_CF_ACT_FAIL_IF_NEW + | SHFL_CF_ACCESS_ATTR_WRITE; + + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + + if (RT_FAILURE(rc)) { + printf("sfprov_set_attr: VbglR0SfCreate(%s) failed rc=%d\n", + path, rc); + err = sfprov_vbox2errno(rc); + goto fail2; + } + if (parms.Result != SHFL_FILE_EXISTS) { + err = ENOENT; + goto fail1; + } + + RT_ZERO(info); +#if 0 + if (mask & AT_MODE) + sfprov_fmode_from_mode(&info.Attr.fMode, mode); + if (mask & AT_ATIME) + sfprov_timespec_from_ftime(&info.AccessTime, atime); + if (mask & AT_MTIME) + sfprov_timespec_from_ftime(&info.ModificationTime, mtime); + if (mask & AT_CTIME) + sfprov_timespec_from_ftime(&info.ChangeTime, ctime); +#endif + bytes = sizeof(info); + rc = VbglR0SfFsInfo(&vbox_client, &mnt->map, parms.Handle, + (SHFL_INFO_SET | SHFL_INFO_FILE), &bytes, (SHFLDIRINFO *)&info); + if (RT_FAILURE(rc)) { + if (rc != VERR_ACCESS_DENIED && rc != VERR_WRITE_PROTECT) + { + printf("sfprov_set_attr: VbglR0SfFsInfo(%s, FILE) failed rc=%d\n", + path, rc); + } + err = sfprov_vbox2errno(rc); + goto fail1; + } + + err = 0; + +fail1: + rc = VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); + if (RT_FAILURE(rc)) { + printf("sfprov_set_attr: VbglR0SfClose(%s) failed rc=%d\n", + path, rc); + } +fail2: + free(str, M_VBOXVFS); + return err; +} + +int +sfprov_set_size(sfp_mount_t *mnt, char *path, uint64_t size) +{ + int rc, err; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + SHFLFSOBJINFO info; + uint32_t bytes; + int str_size; + + str = sfprov_string(path, &str_size); + parms.Handle = 0; + parms.Info.cbObject = 0; + parms.CreateFlags = SHFL_CF_ACT_OPEN_IF_EXISTS + | SHFL_CF_ACT_FAIL_IF_NEW + | SHFL_CF_ACCESS_WRITE; + + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + + if (RT_FAILURE(rc)) { + printf("sfprov_set_size: VbglR0SfCreate(%s) failed rc=%d\n", + path, rc); + err = sfprov_vbox2errno(rc); + goto fail2; + } + if (parms.Result != SHFL_FILE_EXISTS) { + err = ENOENT; + goto fail1; + } + + RT_ZERO(info); + info.cbObject = size; + bytes = sizeof(info); + rc = VbglR0SfFsInfo(&vbox_client, &mnt->map, parms.Handle, + (SHFL_INFO_SET | SHFL_INFO_SIZE), &bytes, (SHFLDIRINFO *)&info); + if (RT_FAILURE(rc)) { + printf("sfprov_set_size: VbglR0SfFsInfo(%s, SIZE) failed rc=%d\n", + path, rc); + err = sfprov_vbox2errno(rc); + goto fail1; + } + + err = 0; + +fail1: + rc = VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); + if (RT_FAILURE(rc)) { + printf("sfprov_set_size: VbglR0SfClose(%s) failed rc=%d\n", + path, rc); + } +fail2: + free(str, M_VBOXVFS); + return err; +} + +/* + * Directory operations + */ +int +sfprov_mkdir( + sfp_mount_t *mnt, + char *path, + mode_t mode, + sfp_file_t **fp, + sffs_stat_t *stat) +{ + int rc; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + int size; + sfp_file_t *newfp; + + str = sfprov_string(path, &size); + parms.Handle = SHFL_HANDLE_NIL; + parms.Info.cbObject = 0; + sfprov_fmode_from_mode(&parms.Info.Attr.fMode, mode); + parms.CreateFlags = SHFL_CF_DIRECTORY | SHFL_CF_ACT_CREATE_IF_NEW | + SHFL_CF_ACT_FAIL_IF_EXISTS | SHFL_CF_ACCESS_READ; + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + free(str, M_VBOXVFS); + + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + if (parms.Handle == SHFL_HANDLE_NIL) { + if (parms.Result == SHFL_FILE_EXISTS) + return (EEXIST); + return (ENOENT); + } + newfp = malloc(sizeof(sfp_file_t), M_VBOXVFS, M_WAITOK | M_ZERO); + newfp->handle = parms.Handle; + newfp->map = mnt->map; + *fp = newfp; + sfprov_stat_from_info(stat, &parms.Info); + return (0); +} + +int +sfprov_set_show_symlinks(void) +{ + int rc; + + rc = VbglR0SfSetSymlinks(&vbox_client); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + + return (0); +} + +int +sfprov_remove(sfp_mount_t *mnt, char *path, u_int is_link) +{ + int rc; + SHFLSTRING *str; + int size; + + str = sfprov_string(path, &size); + rc = VbglR0SfRemove(&vbox_client, &mnt->map, str, + SHFL_REMOVE_FILE | (is_link ? SHFL_REMOVE_SYMLINK : 0)); + free(str, M_VBOXVFS); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + return (0); +} + +int +sfprov_readlink( + sfp_mount_t *mnt, + char *path, + char *target, + size_t tgt_size) +{ + int rc; + SHFLSTRING *str; + int size; + + str = sfprov_string(path, &size); + + rc = VbglR0SfReadLink(&vbox_client, &mnt->map, str, (uint32_t) tgt_size, + target); + if (RT_FAILURE(rc)) + rc = sfprov_vbox2errno(rc); + + free(str, M_VBOXVFS); + return (rc); +} + +int +sfprov_symlink( + sfp_mount_t *mnt, + char *linkname, + char *target, + sffs_stat_t *stat) +{ + int rc; + SHFLSTRING *lnk, *tgt; + int lnk_size, tgt_size; + SHFLFSOBJINFO info; + + lnk = sfprov_string(linkname, &lnk_size); + tgt = sfprov_string(target, &tgt_size); + + rc = VbglR0SfSymlink(&vbox_client, &mnt->map, lnk, tgt, &info); + if (RT_FAILURE(rc)) { + rc = sfprov_vbox2errno(rc); + goto done; + } + + if (stat != NULL) + sfprov_stat_from_info(stat, &info); + +done: + free(lnk, M_VBOXVFS); + free(tgt, M_VBOXVFS); + + return (rc); +} + +int +sfprov_rmdir(sfp_mount_t *mnt, char *path) +{ + int rc; + SHFLSTRING *str; + int size; + + str = sfprov_string(path, &size); + rc = VbglR0SfRemove(&vbox_client, &mnt->map, str, SHFL_REMOVE_DIR); + free(str, M_VBOXVFS); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + return (0); +} + +int +sfprov_rename(sfp_mount_t *mnt, char *from, char *to, u_int is_dir) +{ + int rc; + SHFLSTRING *old, *new; + int old_size, new_size; + + old = sfprov_string(from, &old_size); + new = sfprov_string(to, &new_size); + rc = VbglR0SfRename(&vbox_client, &mnt->map, old, new, + (is_dir ? SHFL_RENAME_DIR : SHFL_RENAME_FILE) | + SHFL_RENAME_REPLACE_IF_EXISTS); + free(old, M_VBOXVFS); + free(new, M_VBOXVFS); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + return (0); +} + +/* + * Read all filenames in a directory. + * + * - success - all entries read and returned + * - ENOENT - Couldn't open the directory for reading + * - EINVAL - Internal error of some kind + * + * On successful return, *dirents points to a list of sffs_dirents_t; + * for each dirent, all fields except the d_ino will be set appropriately. + * The caller is responsible for freeing the dirents buffer. + */ +int +sfprov_readdir( + sfp_mount_t *mnt, + char *path, + sffs_dirents_t **dirents) +{ + int error; + char *cp; + int len; + SHFLSTRING *mask_str = NULL; /* must be path with "/" appended */ + int mask_size; + sfp_file_t *fp; + uint32_t infobuff_alloc = 16384; + SHFLDIRINFO *infobuff = NULL, *info; + uint32_t numbytes; + uint32_t nents; + uint32_t size; + off_t offset; + sffs_dirents_t *cur_buf; + struct sffs_dirent *dirent; + unsigned short reclen; + unsigned short entlen; + + *dirents = NULL; + + error = sfprov_open(mnt, path, &fp); + if (error != 0) + return (ENOENT); + + /* + * Allocate the first dirents buffers. + */ + *dirents = malloc(SFFS_DIRENTS_SIZE, M_VBOXVFS, M_WAITOK | M_ZERO); + if (*dirents == NULL) { + error = (ENOSPC); + goto done; + } + cur_buf = *dirents; + cur_buf->sf_next = NULL; + cur_buf->sf_len = 0; + + /* + * Create mask that VBox expects. This needs to be the directory path, + * plus a "*" wildcard to get all files. + */ + len = strlen(path) + 3; + cp = malloc(len, M_VBOXVFS, M_WAITOK | M_ZERO); + if (cp == NULL) { + error = (ENOSPC); + goto done; + } + strcpy(cp, path); + strcat(cp, "/*"); + mask_str = sfprov_string(cp, &mask_size); + free(cp, M_VBOXVFS); + + /* + * Now loop using VbglR0SfDirInfo + */ + infobuff = malloc(infobuff_alloc, M_VBOXVFS, M_WAITOK | M_ZERO); + if (infobuff == NULL) { + error = (ENOSPC); + goto done; + } + + offset = 0; + for (;;) { + numbytes = infobuff_alloc; + error = VbglR0SfDirInfo(&vbox_client, &fp->map, fp->handle, + mask_str, 0, 0, &numbytes, infobuff, &nents); + + switch (error) { + case VINF_SUCCESS: + /* fallthrough */ + case VERR_NO_MORE_FILES: + break; + case VERR_NO_TRANSLATION: + /* XXX ??? */ + break; + default: + error = sfprov_vbox2errno(error); + goto done; + } + + /* + * Create the dirent_t's and save the stats for each name + */ + for (info = infobuff; (char *) info < (char *) infobuff + numbytes; nents--) { + size_t buflen; + + /* expand buffers if we need more space */ + reclen = DIRENT_RECLEN(strlen(info->name.String.utf8)); + entlen = sizeof(struct sffs_dirent) + reclen; + buflen = SFFS_DIRENTS_OFF + cur_buf->sf_len + entlen; + if (buflen > SFFS_DIRENTS_SIZE) { + cur_buf->sf_next = malloc(SFFS_DIRENTS_SIZE, + M_VBOXVFS, M_WAITOK | M_ZERO); + if (cur_buf->sf_next == NULL) { + error = ENOSPC; + goto done; + } + cur_buf = cur_buf->sf_next; + cur_buf->sf_next = NULL; + cur_buf->sf_len = 0; + } + + /* create the dirent with the name, offset, and len */ + dirent = (struct sffs_dirent *) + (((char *) &cur_buf->sf_entries[0]) + cur_buf->sf_len); + strncpy(&dirent->sf_entry.d_name[0], + info->name.String.utf8, DIRENT_NAMELEN(reclen)); + dirent->sf_entry.d_reclen = reclen; + dirent->sf_entry.d_namlen = strlen(info->name.String.utf8); + dirent->sf_entry.d_name[dirent->sf_entry.d_namlen] = 0; + offset += entlen; + dirent->sf_off = offset; + + /* save the stats */ + sfprov_stat_from_info(&dirent->sf_stat, &info->Info); + + /* next info */ + cur_buf->sf_len += entlen; + size = offsetof (SHFLDIRINFO, name.String) + info->name.u16Size; + info = (SHFLDIRINFO *) ((uintptr_t) info + size); + } + KASSERT(nents == 0, ("nents != 0")); + KASSERT((char *) info == (char *) infobuff + numbytes, "(char *) info != (char *) infobuff + numbytes"); + + if (error == VERR_NO_MORE_FILES) + break; + } + error = 0; + +done: + if (error != 0) { + while (*dirents) { + cur_buf = (*dirents)->sf_next; + free(*dirents, M_VBOXVFS); + *dirents = cur_buf; + } + } + if (infobuff != NULL) + free(infobuff, M_VBOXVFS); + if (mask_str != NULL) + free(mask_str, M_VBOXVFS); + sfprov_close(fp); + + return (error); +} Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c (revision 542551) @@ -1,664 +1,645 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig 2017-04-28 16:59:22.000000000 +0200 -+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c 2017-07-12 19:24:26.109029000 +0200 -@@ -1,10 +1,5 @@ +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig 2020-05-13 19:37:06 UTC ++++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c +@@ -1,8 +1,3 @@ -/* $Id: vboxvfs_vfsops.c $ */ -/** @file - * Description. - */ - /* * Copyright (C) 2008-2017 Oracle Corporation * - * This file is part of VirtualBox Open Source Edition (OSE), as - * available from http://www.virtualbox.org. This file is free software; @@ -14,245 +9,479 @@ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ - -#include "vboxvfs.h" +#include #include #include #include #include #include +#include +#include #include #include #include #include +#include +#include +#include #include #include #include +#include -#include -- --#define VFSMP2SFGLOBINFO(mp) ((struct sf_glob_info *)mp->mnt_data) -- --static int vboxvfs_version = VBOXVFS_VERSION; +#include +#include ++#include "vboxvfs.h" ++ + #define VFSMP2SFGLOBINFO(mp) ((struct sf_glob_info *)mp->mnt_data) + +-static int vboxvfs_version = VBOXVFS_VERSION; ++#ifdef MALLOC_DECLARE ++MALLOC_DEFINE(M_VBOXVFS, "vboxvfs", "VBOX VFS"); ++#endif + -SYSCTL_NODE(_vfs, OID_AUTO, vboxvfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem"); -SYSCTL_INT(_vfs_vboxvfs, OID_AUTO, version, CTLFLAG_RD, &vboxvfs_version, 0, ""); -+#include "vboxvfs.h" ++static sfp_connection_t *sfprov = NULL; -/* global connection to the host service. */ -static VBGLSFCLIENT g_vboxSFClient; -+#define VFSMP2SFGLOBINFO(mp) ((struct sf_glob_info *)mp->mnt_data) ++static int vboxfs_version = VBOXVFS_VERSION; ++u_int vboxvfs_debug = 1; -static vfs_init_t vboxvfs_init; -static vfs_uninit_t vboxvfs_uninit; -static vfs_cmount_t vboxvfs_cmount; -static vfs_mount_t vboxvfs_mount; -static vfs_root_t vboxvfs_root; -static vfs_quotactl_t vboxvfs_quotactl; -static vfs_statfs_t vboxvfs_statfs; -static vfs_unmount_t vboxvfs_unmount; -- ++SYSCTL_NODE(_vfs, OID_AUTO, vboxfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem"); ++SYSCTL_INT(_vfs_vboxfs, OID_AUTO, version, CTLFLAG_RD, &vboxfs_version, 0, ""); ++SYSCTL_UINT(_vfs_vboxfs, OID_AUTO, debug, CTLFLAG_RW, &vboxvfs_debug, 0, "Debug level"); + -static struct vfsops vboxvfs_vfsops = { - .vfs_init = vboxvfs_init, - .vfs_cmount = vboxvfs_cmount, - .vfs_mount = vboxvfs_mount, - .vfs_quotactl = vboxvfs_quotactl, - .vfs_root = vboxvfs_root, - .vfs_statfs = vboxvfs_statfs, - .vfs_sync = vfs_stdsync, - .vfs_uninit = vboxvfs_uninit, - .vfs_unmount = vboxvfs_unmount, -+#ifdef MALLOC_DECLARE -+MALLOC_DEFINE(M_VBOXVFS, "vboxvfs", "VBOX VFS"); -+#endif -+ -+static sfp_connection_t *sfprov = NULL; -+ -+static int vboxfs_version = VBOXVFS_VERSION; -+u_int vboxvfs_debug = 1; -+ -+SYSCTL_NODE(_vfs, OID_AUTO, vboxfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem"); -+SYSCTL_INT(_vfs_vboxfs, OID_AUTO, version, CTLFLAG_RD, &vboxfs_version, 0, ""); -+SYSCTL_UINT(_vfs_vboxfs, OID_AUTO, debug, CTLFLAG_RW, &vboxvfs_debug, 0, "Debug level"); -+ +static vfs_init_t vboxfs_init; +static vfs_uninit_t vboxfs_uninit; +static vfs_cmount_t vboxfs_cmount; +static vfs_mount_t vboxfs_mount; +static vfs_root_t vboxfs_root; +static vfs_quotactl_t vboxfs_quotactl; +static vfs_statfs_t vboxfs_statfs; +static vfs_unmount_t vboxfs_unmount; + +static struct vfsops vboxfs_vfsops = { + .vfs_init = vboxfs_init, + .vfs_cmount = vboxfs_cmount, + .vfs_mount = vboxfs_mount, + .vfs_quotactl = vboxfs_quotactl, + .vfs_root = vboxfs_root, + .vfs_statfs = vboxfs_statfs, + .vfs_sync = vfs_stdsync, + .vfs_uninit = vboxfs_uninit, + .vfs_unmount = vboxfs_unmount }; -VFS_SET(vboxvfs_vfsops, vboxvfs, VFCF_NETWORK); +VFS_SET(vboxfs_vfsops, vboxvfs, VFCF_NETWORK); MODULE_DEPEND(vboxvfs, vboxguest, 1, 1, 1); -static int vboxvfs_cmount(struct mntarg *ma, void * data, int flags, struct thread *td) +/* + * Allocates a new node of type 'type' inside the 'tmp' mount point, with + * its owner set to 'uid', its group to 'gid' and its mode set to 'mode', + * using the credentials of the process 'p'. + * + * If the node type is set to 'VDIR', then the parent parameter must point + * to the parent directory of the node being created. It may only be NULL + * while allocating the root node. + * + * If the node type is set to 'VBLK' or 'VCHR', then the rdev parameter + * specifies the device the node represents. + * + * If the node type is set to 'VLNK', then the parameter target specifies + * the file name of the target file for the symbolic link that is being + * created. + * + * Note that new nodes are retrieved from the available list if it has + * items or, if it is empty, from the node pool as long as there is enough + * space to create them. + * + * Returns zero on success or an appropriate error code on failure. + */ +int +vboxfs_alloc_node(struct mount *mp, struct vboxfs_mnt *vsfmp, const char *fullpath, + enum vtype type, uid_t uid, gid_t gid, mode_t mode, struct vboxfs_node *parent, + struct vboxfs_node **node) { - struct vboxvfs_mount_info args; - int rc = 0; -- -- printf("%s: Enter\n", __FUNCTION__); -- -- rc = copyin(data, &args, sizeof(struct vboxvfs_mount_info)); -- if (rc) -- return rc; + struct vboxfs_node *nnode; -- ma = mount_argf(ma, "uid", "%d", args.uid); -- ma = mount_argf(ma, "gid", "%d", args.gid); -- ma = mount_arg(ma, "from", args.name, -1); +- printf("%s: Enter\n", __FUNCTION__); + if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { + /* + * When a new tmpfs node is created for fully + * constructed mount point, there must be a parent + * node, which vnode is locked exclusively. As + * consequence, if the unmount is executing in + * parallel, vflush() cannot reclaim the parent vnode. + * Due to this, the check for MNTK_UNMOUNT flag is not + * racy: if we did not see MNTK_UNMOUNT flag, then tmp + * cannot be destroyed until node construction is + * finished and the parent vnode unlocked. + * + * Tmpfs does not need to instantiate new nodes during + * unmount. + */ + return (EBUSY); + } -+ + +- rc = copyin(data, &args, sizeof(struct vboxvfs_mount_info)); +- if (rc) +- return rc; + nnode = (struct vboxfs_node *)uma_zalloc_arg( + vsfmp->sf_node_pool, vsfmp, M_WAITOK); -+ + +- ma = mount_argf(ma, "uid", "%d", args.uid); +- ma = mount_argf(ma, "gid", "%d", args.gid); +- ma = mount_arg(ma, "from", args.name, -1); + /* Generic initialization. */ + nnode->sf_type = type; + nnode->sf_ino = vsfmp->sf_ino++; + nnode->sf_path = strdup(fullpath, M_VBOXVFS); + nnode->sf_parent = parent; + nnode->vboxfsmp = vsfmp; -+ + +- rc = kernel_mount(ma, flags); + /* Type-specific initialization. */ + switch (nnode->sf_type) { + case VBLK: + case VCHR: + case VDIR: + case VFIFO: + case VSOCK: + case VLNK: + case VREG: + break; -+ + +- printf("%s: Leave rc=%d\n", __FUNCTION__, rc); + default: + panic("vboxfs_alloc_node: type %p %d", nnode, (int)nnode->sf_type); + } -- rc = kernel_mount(ma, flags); -- -- printf("%s: Leave rc=%d\n", __FUNCTION__, rc); -- - return rc; + *node = nnode; + return 0; } -static const char *vboxvfs_opts[] = { - "uid", "gid", "from", "fstype", "fspath", "errmsg", NULL -}; - -static int vboxvfs_mount(struct mount *mp, struct thread *td) +void +vboxfs_free_node(struct vboxfs_mnt *vboxfs, struct vboxfs_node *node) { - int rc; - char *pszShare; - int cbShare, cbOption; - int uid = 0, gid = 0; - struct sf_glob_info *pShFlGlobalInfo; - SHFLSTRING *pShFlShareName = NULL; - int cbShFlShareName; -- -- printf("%s: Enter\n", __FUNCTION__); -- -- if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) -- return EOPNOTSUPP; -- -- if (vfs_filteropt(mp->mnt_optnew, vboxvfs_opts)) -- { -- vfs_mount_error(mp, "%s", "Invalid option"); -- return EINVAL; -- } -- -- rc = vfs_getopt(mp->mnt_optnew, "from", (void **)&pszShare, &cbShare); -- if (rc || pszShare[cbShare-1] != '\0' || cbShare > 0xfffe) -- return EINVAL; -- -- rc = vfs_getopt(mp->mnt_optnew, "gid", (void **)&gid, &cbOption); -- if ((rc != ENOENT) && (rc || cbOption != sizeof(gid))) -- return EINVAL; -- -- rc = vfs_getopt(mp->mnt_optnew, "uid", (void **)&uid, &cbOption); -- if ((rc != ENOENT) && (rc || cbOption != sizeof(uid))) -- return EINVAL; -- pShFlGlobalInfo = RTMemAllocZ(sizeof(struct sf_glob_info)); -- if (!pShFlGlobalInfo) -- return ENOMEM; +- printf("%s: Enter\n", __FUNCTION__); +#ifdef INVARIANTS + TMPFS_NODE_LOCK(node); + MPASS(node->sf_vnode == NULL); + MPASS((node->sf_vpstate & TMPFS_VNODE_ALLOCATING) == 0); + TMPFS_NODE_UNLOCK(node); +#endif + if (node->sf_path) + free(node->sf_path, M_VBOXVFS); -- cbShFlShareName = offsetof (SHFLSTRING, String.utf8) + cbShare + 1; -- pShFlShareName = RTMemAllocZ(cbShFlShareName); -- if (!pShFlShareName) -- return VERR_NO_MEMORY; +- if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) +- return EOPNOTSUPP; + uma_zfree(vboxfs->sf_node_pool, node); +} -- pShFlShareName->u16Length = cbShare; -- pShFlShareName->u16Size = cbShare + 1; -- memcpy (pShFlShareName->String.utf8, pszShare, cbShare + 1); +- if (vfs_filteropt(mp->mnt_optnew, vboxvfs_opts)) +- { +- vfs_mount_error(mp, "%s", "Invalid option"); +- return EINVAL; +- } +static int +vboxfs_cmount(struct mntarg *ma, void *data, uint64_t flags) +{ + struct vboxfs_mount_info args; + int error = 0; -- rc = VbglR0SfMapFolder (&g_vboxSFClient, pShFlShareName, &pShFlGlobalInfo->map); -- RTMemFree(pShFlShareName); +- rc = vfs_getopt(mp->mnt_optnew, "from", (void **)&pszShare, &cbShare); +- if (rc || pszShare[cbShare-1] != '\0' || cbShare > 0xfffe) +- return EINVAL; + if (data == NULL) + return (EINVAL); + error = copyin(data, &args, sizeof(struct vboxfs_mount_info)); + if (error) + return (error); -+ + +- rc = vfs_getopt(mp->mnt_optnew, "gid", (void **)&gid, &cbOption); +- if ((rc != ENOENT) && (rc || cbOption != sizeof(gid))) +- return EINVAL; + ma = mount_argf(ma, "uid", "%d", args.uid); + ma = mount_argf(ma, "gid", "%d", args.gid); + ma = mount_argf(ma, "file_mode", "%d", args.fmode); + ma = mount_argf(ma, "dir_mode", "%d", args.dmode); + ma = mount_arg(ma, "from", args.name, -1); -- if (RT_FAILURE (rc)) -- { -- RTMemFree(pShFlGlobalInfo); -- printf("VbglR0SfMapFolder failed rc=%d\n", rc); -- return EPROTO; -- } +- rc = vfs_getopt(mp->mnt_optnew, "uid", (void **)&uid, &cbOption); +- if ((rc != ENOENT) && (rc || cbOption != sizeof(uid))) +- return EINVAL; + return (kernel_mount(ma, flags)); +} -- pShFlGlobalInfo->uid = uid; -- pShFlGlobalInfo->gid = gid; +- pShFlGlobalInfo = RTMemAllocZ(sizeof(struct sf_glob_info)); +- if (!pShFlGlobalInfo) +- return ENOMEM; +static const char *vboxfs_opts[] = { + "fstype", + "fspath", + "from", + "uid", + "gid", + "file_mode", + "dir_mode", + "errmsg", + NULL +}; -- mp->mnt_data = pShFlGlobalInfo; +- cbShFlShareName = offsetof (SHFLSTRING, String.utf8) + cbShare + 1; +- pShFlShareName = RTMemAllocZ(cbShFlShareName); +- if (!pShFlShareName) +- return VERR_NO_MEMORY; +#define VBOX_INTOPT(optname, val, base) do { \ + char *ep, *optarg = NULL; \ + if (vfs_getopt(opts, optname, (void **)&optarg, NULL) == 0) { \ + if (optarg != NULL && *optarg == '\0') \ + optarg = NULL; \ + if (optarg != NULL) \ + val = strtoul(optarg, &ep, base); \ + if (optarg == NULL || *ep != '\0') { \ + struct sbuf *sb = sbuf_new_auto(); \ + sbuf_printf(sb, "Invalid %s: \"%s\"", optname, \ + optarg); \ + sbuf_finish(sb); \ + vfs_mount_error(mp, sbuf_data(sb)); \ + sbuf_delete(sb); \ + return (EINVAL); \ + } \ + } \ +} while (0) -- /** @todo root vnode. */ +- pShFlShareName->u16Length = cbShare; +- pShFlShareName->u16Size = cbShare + 1; +- memcpy (pShFlShareName->String.utf8, pszShare, cbShare + 1); +static int +vboxfs_node_ctor(void *mem, int size, void *arg, int flags) +{ + struct vboxfs_node *node = (struct vboxfs_node *)mem; -- vfs_getnewfsid(mp); -- vfs_mountedfrom(mp, pszShare); +- rc = VbglR0SfMapFolder (&g_vboxSFClient, pShFlShareName, &pShFlGlobalInfo->map); +- RTMemFree(pShFlShareName); + node->sf_vnode = NULL; + node->sf_vpstate = 0; -- printf("%s: Leave rc=0\n", __FUNCTION__); +- if (RT_FAILURE (rc)) +- { +- RTMemFree(pShFlGlobalInfo); +- printf("VbglR0SfMapFolder failed rc=%d\n", rc); +- return EPROTO; +- } + return (0); +} -- return 0; +- pShFlGlobalInfo->uid = uid; +- pShFlGlobalInfo->gid = gid; +static void +vboxfs_node_dtor(void *mem, int size, void *arg) +{ + struct vboxfs_node *node = (struct vboxfs_node *)mem; + node->sf_type = VNON; - } ++} --static int vboxvfs_unmount(struct mount *mp, int mntflags, struct thread *td) +- mp->mnt_data = pShFlGlobalInfo; +static int +vboxfs_node_init(void *mem, int size, int flags) - { -- struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp); -- int rc; -- int flags = 0; ++{ + struct vboxfs_node *node = (struct vboxfs_node *)mem; + node->sf_ino = 0; -- rc = VbglR0SfUnmapFolder(&g_vboxSFClient, &pShFlGlobalInfo->map); -- if (RT_FAILURE(rc)) -- printf("Failed to unmap shared folder\n"); +- /** @todo root vnode. */ + mtx_init(&node->sf_interlock, "tmpfs node interlock", NULL, MTX_DEF); -- if (mntflags & MNT_FORCE) -- flags |= FORCECLOSE; +- vfs_getnewfsid(mp); +- vfs_mountedfrom(mp, pszShare); + return (0); +} -- /* There is 1 extra root vnode reference (vnode_root). */ -- rc = vflush(mp, 1, flags, td); -- if (rc) -- return rc; +- printf("%s: Leave rc=0\n", __FUNCTION__); +static void +vboxfs_node_fini(void *mem, int size) +{ + struct vboxfs_node *node = (struct vboxfs_node *)mem; +- return 0; + mtx_destroy(&node->sf_interlock); -+} + } -- RTMemFree(pShFlGlobalInfo); -- mp->mnt_data = NULL; +-static int vboxvfs_unmount(struct mount *mp, int mntflags, struct thread *td) +static int +vboxfs_mount(struct mount *mp) -+{ + { +- struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp); +- int rc; +- int flags = 0; + struct vboxfs_mnt *vboxfsmp = NULL; + struct vfsoptlist *opts = mp->mnt_optnew; + sfp_mount_t *handle = NULL; + int readonly = 0; + sffs_fsinfo_t fsinfo; + int error, share_len; + char *share_name; + mode_t file_mode = 0, dir_mode = 0; + uid_t uid = 0; + gid_t gid = 0; + struct vboxfs_node *root; -+ + +- rc = VbglR0SfUnmapFolder(&g_vboxSFClient, &pShFlGlobalInfo->map); +- if (RT_FAILURE(rc)) +- printf("Failed to unmap shared folder\n"); + if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) + return (EOPNOTSUPP); -+ + +- if (mntflags & MNT_FORCE) +- flags |= FORCECLOSE; + if (vfs_filteropt(opts, vboxfs_opts)) { + vfs_mount_error(mp, "%s", "Invalid option"); + return (EINVAL); + } -+ + +- /* There is 1 extra root vnode reference (vnode_root). */ +- rc = vflush(mp, 1, flags, td); +- if (rc) +- return rc; + VBOX_INTOPT("uid", uid, 10); + VBOX_INTOPT("gid", gid, 10); + VBOX_INTOPT("file_mode", file_mode, 8); + VBOX_INTOPT("dir_mode", dir_mode, 8); + VBOX_INTOPT("ro", readonly, 10); -+ + + error = vfs_getopt(opts, "from", (void **)&share_name, &share_len); + if (error != 0 || share_len == 0) { + vfs_mount_error(mp, "Invalid from"); + return (EINVAL); + } -+ + +- RTMemFree(pShFlGlobalInfo); +- mp->mnt_data = NULL; + vboxfsmp = malloc(sizeof(struct vboxfs_mnt), M_VBOXVFS, M_WAITOK | M_ZERO); + vboxfsmp->sf_uid = uid; + vboxfsmp->sf_gid = gid; + vboxfsmp->sf_fmode = file_mode & (S_IRWXU | S_IRWXG | S_IRWXO); + vboxfsmp->sf_dmode = dir_mode & (S_IRWXU | S_IRWXG | S_IRWXO); + vboxfsmp->sf_ino = 3; + vboxfsmp->sf_stat_ttl = 200; -+ + +- return 0; + /* Invoke Hypervisor mount interface before proceeding */ + error = sfprov_mount(share_name, &handle); + if (error) + return (error); + + /* Determine whether the filesystem must be read-only. */ + error = sfprov_get_fsinfo(handle, &fsinfo); + if (error != 0) { + sfprov_unmount(handle); + return (error); + } + if (readonly == 0) + readonly = (fsinfo.readonly != 0); + + vboxfsmp->sf_handle = handle; + vboxfsmp->sf_vfsp = mp; + + vboxfsmp->sf_node_pool = uma_zcreate("VBOXFS node", + sizeof(struct vboxfs_node), + vboxfs_node_ctor, vboxfs_node_dtor, + vboxfs_node_init, vboxfs_node_fini, + UMA_ALIGN_PTR, 0); + + /* Allocate the root node. */ + error = vboxfs_alloc_node(mp, vboxfsmp, "", VDIR, 0, + 0, 0755, NULL, &root); + + if (error != 0 || root == NULL) { + uma_zdestroy(vboxfsmp->sf_node_pool); + free(vboxfsmp, M_VBOXVFS); + return error; + } + + root->sf_parent = root; + vboxfsmp->sf_root = root; + + MNT_ILOCK(mp); + mp->mnt_data = vboxfsmp; + bzero(&mp->mnt_stat.f_fsid, sizeof(&mp->mnt_stat.f_fsid)); + /* f_fsid is int32_t but serial is uint32_t, convert */ + memcpy(&mp->mnt_stat.f_fsid, &fsinfo.serial, sizeof(mp->mnt_stat.f_fsid)); + mp->mnt_flag |= MNT_LOCAL; + if (readonly != 0) + mp->mnt_flag |= MNT_RDONLY; +#if __FreeBSD_version >= 1000021 + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; +#else + mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | + MNTK_EXTENDED_SHARED; +#endif + MNT_IUNLOCK(mp); + vfs_mountedfrom(mp, share_name); - -- return 0; ++ + return (0); } -static int vboxvfs_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td) +/* + * Unmount a shared folder. + * + * vboxfs_unmount umounts the mounted file system. It return 0 + * on sucess and any relevant errno on failure. + */ +static int +vboxfs_unmount(struct mount *mp, int mntflags) { - int rc = 0; - struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp); - struct vnode *vp; + struct vboxfs_mnt *vboxfsmp; + struct thread *td; + int error; + int flags; -+ + +- printf("%s: Enter\n", __FUNCTION__); + vboxfsmp = VFSTOVBOXFS(mp); + td = curthread; + flags = 0; + if (mntflags & MNT_FORCE) + flags |= FORCECLOSE; -+ + +- vp = pShFlGlobalInfo->vnode_root; +- VREF(vp); + error = vflush(mp, 0, flags, td); + if (error) + return (error); -+ + +- vn_lock(vp, flags | LK_RETRY, td); +- *vpp = vp; + /* Invoke Hypervisor unmount interface before proceeding */ + error = sfprov_unmount(vboxfsmp->sf_handle); + if (error != 0) { + /* TBD anything here? */ + } -+ + +- printf("%s: Leave\n", __FUNCTION__); + uma_zdestroy(vboxfsmp->sf_node_pool); -+ + +- return rc; + free(vboxfsmp, M_VBOXVFS); + MNT_ILOCK(mp); + mp->mnt_data = NULL; + mp->mnt_flag &= ~MNT_LOCAL; + MNT_IUNLOCK(mp); - -- printf("%s: Enter\n", __FUNCTION__); -- -- vp = pShFlGlobalInfo->vnode_root; -- VREF(vp); ++ + return (0); -+} + } -- vn_lock(vp, flags | LK_RETRY, td); -- *vpp = vp; +-static int vboxvfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, struct thread *td) +static int +vboxfs_root(struct mount *mp, int flags, struct vnode **vpp) -+{ + { +- return EOPNOTSUPP; + int error; + error = vboxfs_alloc_vp(mp, VFSTOVBOXFS(mp)->sf_root, flags, vpp); - -- printf("%s: Leave\n", __FUNCTION__); ++ + if (!error) + (*vpp)->v_vflag |= VV_ROOT; - -- return rc; ++ + return error; } --static int vboxvfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, struct thread *td) +-int vboxvfs_init(struct vfsconf *vfsp) +/* + * Do operation associated with quotas, not supported + */ +static int +vboxfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg) { -- return EOPNOTSUPP; +- int rc; + return (EOPNOTSUPP); - } ++} --int vboxvfs_init(struct vfsconf *vfsp) +- /* Initialize the R0 guest library. */ +- rc = VbglR0SfInit(); +- if (RT_FAILURE(rc)) +- return ENXIO; +/* + * Initialize the filesystem globals. + */ +static int +vboxfs_init(struct vfsconf *vfsp) - { -- int rc; ++{ + int error; -- /* Initialize the R0 guest library. */ -- rc = VbglR0SfInit(); -- if (RT_FAILURE(rc)) -- return ENXIO; -+ DROP_GIANT(); - - /* Connect to the host service. */ - rc = VbglR0SfConnect(&g_vboxSFClient); - if (RT_FAILURE(rc)) - { - printf("Failed to get connection to host! rc=%d\n", rc); - VbglR0SfTerm(); - return ENXIO; - } -+ sfprov = sfprov_connect(SFPROV_VERSION); -+ if (sfprov == NULL) { -+ printf("%s: couldn't connect to sf provider", __func__); -+ return (ENODEV); -+ } -+ -+ error = sfprov_set_show_symlinks(); -+ if (error != 0) -+ printf("%s: host unable to show symlinks, error=%d\n", -+ __func__, error); ++ DROP_GIANT(); - rc = VbglR0SfSetUtf8(&g_vboxSFClient); - if (RT_FAILURE (rc)) - { - printf("VbglR0SfSetUtf8 failed, rc=%d\n", rc); - VbglR0SfDisconnect(&g_vboxSFClient); - VbglR0SfTerm(); - return EPROTO; - } -- ++ sfprov = sfprov_connect(SFPROV_VERSION); ++ if (sfprov == NULL) { ++ printf("%s: couldn't connect to sf provider", __func__); ++ return (ENODEV); ++ } + - printf("Successfully loaded shared folder module\n"); -- ++ error = sfprov_set_show_symlinks(); ++ if (error != 0) ++ printf("%s: host unable to show symlinks, error=%d\n", ++ __func__, error); + - return 0; + PICKUP_GIANT(); + return (0); } -int vboxvfs_uninit(struct vfsconf *vfsp) +/* + * Undo the work of vboxfs_init(). + */ +static int +vboxfs_uninit(struct vfsconf *vfsp) { - VbglR0SfDisconnect(&g_vboxSFClient); - VbglR0SfTerm(); - return 0; + DROP_GIANT(); + sfprov_disconnect(); + PICKUP_GIANT(); + return (0); } -int vboxvfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) +/* + * Get filesystem statistics. + */ +static int +vboxfs_statfs(struct mount *mp, struct statfs *sbp) { - return 0; + struct vboxfs_mnt *vboxfsmp; + sffs_fsinfo_t fsinfo; + int error; + + vboxfsmp = VFSTOVBOXFS(mp); + + error = sfprov_get_fsinfo(vboxfsmp->sf_handle, &fsinfo); + if (error != 0) + return (error); + + sbp->f_iosize = fsinfo.blksize; + sbp->f_bsize = fsinfo.blksize; + + sbp->f_bfree = fsinfo.blksavail; + sbp->f_bavail = fsinfo.blksavail; + sbp->f_files = fsinfo.blksavail / 4; /* some kind of reasonable value */ + sbp->f_ffree = fsinfo.blksavail / 4; + + sbp->f_blocks = fsinfo.blksused + sbp->f_bavail; + sbp->f_fsid.val[0] = mp->mnt_stat.f_fsid.val[0]; + sbp->f_fsid.val[1] = mp->mnt_stat.f_fsid.val[1]; + sbp->f_namemax = fsinfo.maxnamesize; + + return (0); } Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Debugger_Makefile.kmk =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Debugger_Makefile.kmk (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Debugger_Makefile.kmk (revision 542551) @@ -1,10 +1,10 @@ ---- src/VBox/Debugger/Makefile.kmk.orig 2017-10-18 07:09:03 UTC +--- src/VBox/Debugger/Makefile.kmk.orig 2020-05-13 19:39:41 UTC +++ src/VBox/Debugger/Makefile.kmk -@@ -109,6 +109,7 @@ VBoxDbg_SOURCES = \ +@@ -113,6 +113,7 @@ VBoxDbg_SOURCES = \ VBoxDbgBase.cpp \ VBoxDbgConsole.cpp \ VBoxDbgStatsQt.cpp +VBoxDbg_CXXFLAGS.freebsd += -std=c++11 VBoxDbg_LIBS = \ $(VBOX_LIB_VMM_LAZY) VBoxDbg_LDFLAGS.darwin = \ Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostALSAAudio.cpp =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostALSAAudio.cpp (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostALSAAudio.cpp (revision 542551) @@ -1,18 +1,18 @@ ---- src/VBox/Devices/Audio/DrvHostALSAAudio.cpp.orig 2017-10-18 07:09:04 UTC +--- src/VBox/Devices/Audio/DrvHostALSAAudio.cpp.orig 2020-05-13 19:39:41 UTC +++ src/VBox/Devices/Audio/DrvHostALSAAudio.cpp -@@ -1231,6 +1231,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP +@@ -819,6 +819,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP continue; } +#if EPIPE != ESTRPIPE case -ESTRPIPE: { /* Stream was suspended and waiting for a recovery. */ -@@ -1244,6 +1245,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP +@@ -832,6 +833,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP LogFlowFunc(("Resumed suspended output stream\n")); continue; } +#endif default: LogFlowFunc(("Failed to write %RU32 bytes, error unknown\n", cbToWrite)); Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Devices_PC_vbox-cpuhotplug.dsl =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Devices_PC_vbox-cpuhotplug.dsl (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Devices_PC_vbox-cpuhotplug.dsl (revision 542551) @@ -1,96 +1,11 @@ ---- src/VBox/Devices/PC/vbox-cpuhotplug.dsl.orig 2019-10-10 18:34:15 UTC +--- src/VBox/Devices/PC/vbox-cpuhotplug.dsl.orig 2020-07-09 16:55:56 UTC +++ src/VBox/Devices/PC/vbox-cpuhotplug.dsl -@@ -44,11 +44,11 @@ DefinitionBlock ("SSDT-cpuhotplug.aml", "SSDT", 1, "VB - Scope (\_SB) - { - --#define GENERATE_CPU_OBJECT(id, sck, sckuid, cpu, cpuuid) \ -+#define GENERATE_CPU_OBJECT(id, sck, cpu) \ +@@ -48,7 +48,7 @@ DefinitionBlock ("SSDT-cpuhotplug.aml", "SSDT", 1, "VB Device (sck) \ { \ Name (_HID, "ACPI0004") \ - Name (_UID, sckuid) \ + Name (_UID, id) \ \ \ Processor (cpu, /* Name */ \ -@@ -58,7 +58,7 @@ DefinitionBlock ("SSDT-cpuhotplug.aml", "SSDT", 1, "VB - ) \ - { \ - Name (_HID, "ACPI0007") \ -- Name (_UID, cpuuid) \ -+ Name (_UID, id) \ - Name (_PXM, 0x00) \ - \ - Method(_MAT, 0, Serialized) \ -@@ -95,38 +95,38 @@ DefinitionBlock ("SSDT-cpuhotplug.aml", "SSDT", 1, "VB - } \ - } \ - -- GENERATE_CPU_OBJECT(0x00, SCK0, "SCKCPU0", CPU0, "SCK0-CPU0") -- GENERATE_CPU_OBJECT(0x01, SCK1, "SCKCPU1", CPU1, "SCK1-CPU0") -- GENERATE_CPU_OBJECT(0x02, SCK2, "SCKCPU2", CPU2, "SCK2-CPU0") -- GENERATE_CPU_OBJECT(0x03, SCK3, "SCKCPU3", CPU3, "SCK3-CPU0") -- GENERATE_CPU_OBJECT(0x04, SCK4, "SCKCPU4", CPU4, "SCK4-CPU0") -- GENERATE_CPU_OBJECT(0x05, SCK5, "SCKCPU5", CPU5, "SCK5-CPU0") -- GENERATE_CPU_OBJECT(0x06, SCK6, "SCKCPU6", CPU6, "SCK6-CPU0") -- GENERATE_CPU_OBJECT(0x07, SCK7, "SCKCPU7", CPU7, "SCK7-CPU0") -- GENERATE_CPU_OBJECT(0x08, SCK8, "SCKCPU8", CPU8, "SCK8-CPU0") -- GENERATE_CPU_OBJECT(0x09, SCK9, "SCKCPU9", CPU9, "SCK9-CPU0") -- GENERATE_CPU_OBJECT(0x0a, SCKA, "SCKCPUA", CPUA, "SCKA-CPU0") -- GENERATE_CPU_OBJECT(0x0b, SCKB, "SCKCPUB", CPUB, "SCKB-CPU0") -- GENERATE_CPU_OBJECT(0x0c, SCKC, "SCKCPUC", CPUC, "SCKC-CPU0") -- GENERATE_CPU_OBJECT(0x0d, SCKD, "SCKCPUD", CPUD, "SCKD-CPU0") -- GENERATE_CPU_OBJECT(0x0e, SCKE, "SCKCPUE", CPUE, "SCKE-CPU0") -- GENERATE_CPU_OBJECT(0x0f, SCKF, "SCKCPUF", CPUF, "SCKF-CPU0") -- GENERATE_CPU_OBJECT(0x10, SCKG, "SCKCPUG", CPUG, "SCKG-CPU0") -- GENERATE_CPU_OBJECT(0x11, SCKH, "SCKCPUH", CPUH, "SCKH-CPU0") -- GENERATE_CPU_OBJECT(0x12, SCKI, "SCKCPUI", CPUI, "SCKI-CPU0") -- GENERATE_CPU_OBJECT(0x13, SCKJ, "SCKCPUJ", CPUJ, "SCKJ-CPU0") -- GENERATE_CPU_OBJECT(0x14, SCKK, "SCKCPUK", CPUK, "SCKK-CPU0") -- GENERATE_CPU_OBJECT(0x15, SCKL, "SCKCPUL", CPUL, "SCKL-CPU0") -- GENERATE_CPU_OBJECT(0x16, SCKM, "SCKCPUM", CPUM, "SCKM-CPU0") -- GENERATE_CPU_OBJECT(0x17, SCKN, "SCKCPUN", CPUN, "SCKN-CPU0") -- GENERATE_CPU_OBJECT(0x18, SCKO, "SCKCPUO", CPUO, "SCKO-CPU0") -- GENERATE_CPU_OBJECT(0x19, SCKP, "SCKCPUP", CPUP, "SCKP-CPU0") -- GENERATE_CPU_OBJECT(0x1a, SCKQ, "SCKCPUQ", CPUQ, "SCKQ-CPU0") -- GENERATE_CPU_OBJECT(0x1b, SCKR, "SCKCPUR", CPUR, "SCKR-CPU0") -- GENERATE_CPU_OBJECT(0x1c, SCKS, "SCKCPUS", CPUS, "SCKS-CPU0") -- GENERATE_CPU_OBJECT(0x1d, SCKT, "SCKCPUT", CPUT, "SCKT-CPU0") -- GENERATE_CPU_OBJECT(0x1e, SCKU, "SCKCPUU", CPUU, "SCKU-CPU0") -- GENERATE_CPU_OBJECT(0x1f, SCKV, "SCKCPUV", CPUV, "SCKV-CPU0") -+ GENERATE_CPU_OBJECT(0x00, SCK0, CPU0) -+ GENERATE_CPU_OBJECT(0x01, SCK1, CPU1) -+ GENERATE_CPU_OBJECT(0x02, SCK2, CPU2) -+ GENERATE_CPU_OBJECT(0x03, SCK3, CPU3) -+ GENERATE_CPU_OBJECT(0x04, SCK4, CPU4) -+ GENERATE_CPU_OBJECT(0x05, SCK5, CPU5) -+ GENERATE_CPU_OBJECT(0x06, SCK6, CPU6) -+ GENERATE_CPU_OBJECT(0x07, SCK7, CPU7) -+ GENERATE_CPU_OBJECT(0x08, SCK8, CPU8) -+ GENERATE_CPU_OBJECT(0x09, SCK9, CPU9) -+ GENERATE_CPU_OBJECT(0x0a, SCKA, CPUA) -+ GENERATE_CPU_OBJECT(0x0b, SCKB, CPUB) -+ GENERATE_CPU_OBJECT(0x0c, SCKC, CPUC) -+ GENERATE_CPU_OBJECT(0x0d, SCKD, CPUD) -+ GENERATE_CPU_OBJECT(0x0e, SCKE, CPUE) -+ GENERATE_CPU_OBJECT(0x0f, SCKF, CPUF) -+ GENERATE_CPU_OBJECT(0x10, SCKG, CPUG) -+ GENERATE_CPU_OBJECT(0x11, SCKH, CPUH) -+ GENERATE_CPU_OBJECT(0x12, SCKI, CPUI) -+ GENERATE_CPU_OBJECT(0x13, SCKJ, CPUJ) -+ GENERATE_CPU_OBJECT(0x14, SCKK, CPUK) -+ GENERATE_CPU_OBJECT(0x15, SCKL, CPUL) -+ GENERATE_CPU_OBJECT(0x16, SCKM, CPUM) -+ GENERATE_CPU_OBJECT(0x17, SCKN, CPUN) -+ GENERATE_CPU_OBJECT(0x18, SCKO, CPUO) -+ GENERATE_CPU_OBJECT(0x19, SCKP, CPUP) -+ GENERATE_CPU_OBJECT(0x1a, SCKQ, CPUQ) -+ GENERATE_CPU_OBJECT(0x1b, SCKR, CPUR) -+ GENERATE_CPU_OBJECT(0x1c, SCKS, CPUS) -+ GENERATE_CPU_OBJECT(0x1d, SCKT, CPUT) -+ GENERATE_CPU_OBJECT(0x1e, SCKU, CPUU) -+ GENERATE_CPU_OBJECT(0x1f, SCKV, CPUV) - - #undef GENERATE_CPU_OBJECT - } Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageHelp.cpp =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageHelp.cpp (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageHelp.cpp (revision 542551) @@ -1,34 +1,34 @@ ---- src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp.orig 2016-08-16 19:59:52 UTC +--- src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp.orig 2020-05-13 19:43:27 UTC +++ src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp -@@ -797,7 +797,7 @@ void printUsage(USAGECATEGORY fCategory, +@@ -622,7 +622,7 @@ void printUsage(USAGECATEGORY fCategory, uint32_t fSub RTStrmPrintf(pStrm, "|dsound"); #endif } - if (fLinux || fSolaris) + if (fLinux || fFreeBSD || fSolaris) { RTStrmPrintf(pStrm, "" #ifdef VBOX_WITH_AUDIO_OSS -@@ -811,22 +811,6 @@ void printUsage(USAGECATEGORY fCategory, +@@ -635,22 +635,6 @@ void printUsage(USAGECATEGORY fCategory, uint32_t fSub + "|pulse" #endif ); - } +- } - if (fFreeBSD) - { -#ifdef VBOX_WITH_AUDIO_OSS - /* Get the line break sorted when dumping all option variants. */ - if (fDumpOpts) - { - RTStrmPrintf(pStrm, "|\n" - " oss"); - } - else - RTStrmPrintf(pStrm, "|oss"); -#endif -#ifdef VBOX_WITH_AUDIO_PULSE - RTStrmPrintf(pStrm, "|pulse"); -#endif -- } + } if (fDarwin) { - RTStrmPrintf(pStrm, "|coreaudio"); Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_Makefile.kmk =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_Makefile.kmk (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_Makefile.kmk (revision 542551) @@ -1,18 +1,18 @@ ---- src/VBox/Frontends/VirtualBox/Makefile.kmk.orig 2017-10-18 07:12:20 UTC +--- src/VBox/Frontends/VirtualBox/Makefile.kmk.orig 2020-05-13 19:43:28 UTC +++ src/VBox/Frontends/VirtualBox/Makefile.kmk -@@ -895,6 +895,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI +@@ -897,6 +897,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI VirtualBox_SOURCES += \ src/VBoxFBOverlay.cpp \ src/VBoxGLSupportInfo.cpp + VirtualBox_CXXFLAGS.freebsd += -std=c++11 endif # -@@ -1217,6 +1218,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL) +@@ -1220,6 +1221,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL) VBoxOGL2D_SOURCES = \ src/VBoxGLSupportInfo.cpp VBoxOGL2D_INCS = include + VBoxOGL2D_CXXFLAGS.freebsd += -std=c++11 endif endif Index: head/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h (revision 542551) @@ -1,11 +1,11 @@ ---- src/VBox/HostDrivers/Support/SUPDrvInternal.h.orig 2016-07-18 11:56:19 UTC +--- src/VBox/HostDrivers/Support/SUPDrvInternal.h.orig 2020-05-13 19:43:52 UTC +++ src/VBox/HostDrivers/Support/SUPDrvInternal.h -@@ -235,7 +235,7 @@ +@@ -208,7 +208,7 @@ # define SUPDRV_WITHOUT_MSR_PROBER #endif -#if 1 +#if 0 /** @def SUPDRV_USE_TSC_DELTA_THREAD * Use a dedicated kernel thread to service TSC-delta measurement requests. * @todo Test on servers with many CPUs and sockets. */ Index: head/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c (revision 542551) @@ -1,220 +1,220 @@ ---- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2018-10-15 14:30:57 UTC +--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2020-05-13 19:43:53 UTC +++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c @@ -46,6 +46,7 @@ #include #include "../SUPDrvInternal.h" +#include "freebsd/the-freebsd-kernel.h" #include #include #include @@ -57,7 +58,14 @@ #include #include #include +#include +#ifdef VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV +# include +# include +# include +#endif + #ifdef VBOX_WITH_HARDENING # define VBOXDRV_PERM 0600 #else @@ -76,7 +84,9 @@ static d_open_t VBoxDrvFreeBSDOpenUsr; static d_open_t VBoxDrvFreeBSDOpenSys; static void vboxdrvFreeBSDDtr(void *pvData); static d_ioctl_t VBoxDrvFreeBSDIOCtl; +static d_ioctl_t VBoxDrvFreeBSDIOCtlSMAP; static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd); +static bool VBoxDrvFreeBSDCpuHasSMAP(void); /********************************************************************************************************************************* @@ -182,6 +192,13 @@ static int VBoxDrvFreeBSDLoad(void) rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt, sizeof(SUPDRVSESSION)); if (RT_SUCCESS(rc)) { + if (VBoxDrvFreeBSDCpuHasSMAP()) + { + LogRel(("disabling SMAP for VBoxDrvFreeBSDIOCtl\n")); + g_VBoxDrvFreeBSDChrDevSwSys.d_ioctl = VBoxDrvFreeBSDIOCtlSMAP; + g_VBoxDrvFreeBSDChrDevSwUsr.d_ioctl = VBoxDrvFreeBSDIOCtlSMAP; + } + /* * Configure character devices. Add symbolic links for compatibility. */ @@ -311,7 +328,21 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo PSUPDRVSESSION pSession; devfs_get_cdevpriv((void **)&pSession); +#ifdef VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV /* + * Refuse all I/O control calls if we've ever detected EFLAGS.AC being cleared. + * + * This isn't a problem, as there is absolutely nothing in the kernel context that + * depend on user context triggering cleanups. That would be pretty wild, right? + */ + if (RT_UNLIKELY(g_VBoxDrvFreeBSDDevExt.cBadContextCalls > 0)) + { + SUPR0Printf("VBoxDrvFreBSDIOCtl: EFLAGS.AC=0 detected %u times, refusing all I/O controls!\n", g_VBoxDrvFreeBSDDevExt.cBadContextCalls); + return ESPIPE; + } +#endif + + /* * Deal with the fast ioctl path first. */ if ( ( ulCmd == SUP_IOCTL_FAST_DO_RAW_RUN @@ -325,6 +356,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo /** + * Alternative Device I/O Control entry point on hosts with SMAP support. + * + * @returns depends... + * @param pDev The device. + * @param ulCmd The command. + * @param pvData Pointer to the data. + * @param fFile The file descriptor flags. + * @param pTd The calling thread. + */ +static int VBoxDrvFreeBSDIOCtlSMAP(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd) +{ + /* + * Allow VBox R0 code to touch R3 memory. Setting the AC bit disables the + * SMAP check. + */ + RTCCUINTREG fSavedEfl = ASMAddFlags(X86_EFL_AC); + + int rc = VBoxDrvFreeBSDIOCtl(pDev, ulCmd, pvData, fFile, pTd); + +#ifdef VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV + /* + * Before we restore AC and the rest of EFLAGS, check if the IOCtl handler code + * accidentially modified it or some other important flag. + */ + if (RT_UNLIKELY( (ASMGetFlags() & (X86_EFL_AC | X86_EFL_IF | X86_EFL_DF | X86_EFL_IOPL)) + != ((fSavedEfl & (X86_EFL_AC | X86_EFL_IF | X86_EFL_DF | X86_EFL_IOPL)) | X86_EFL_AC) )) + { + char szTmp[48]; + RTStrPrintf(szTmp, sizeof(szTmp), "ulCmd=%#x: %#x->%#x!", ulCmd, (uint32_t)fSavedEfl, (uint32_t)ASMGetFlags()); + supdrvBadContext(&g_VBoxDrvFreeBSDDevExt, "SUPDrv-freebsd.c", __LINE__, szTmp); + } +#endif + + ASMSetFlags(fSavedEfl); + return rc; +} + + +/** * Deal with the 'slow' I/O control requests. * * @returns 0 on success, appropriate errno on failure. @@ -373,11 +443,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes */ SUPREQHDR Hdr; pvUser = *(void **)pvData; - int rc = copyin(pvUser, &Hdr, sizeof(Hdr)); - if (RT_UNLIKELY(rc)) + if (RT_FAILURE(RTR0MemUserCopyFrom(&Hdr, pvUser, sizeof(Hdr)))) { - OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyin(%p,Hdr,) -> %#x; ulCmd=%#lx\n", pvUser, rc, ulCmd)); - return rc; + OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyin(%p,Hdr,); ulCmd=%#lx\n", pvUser, ulCmd)); + return EFAULT; } if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC)) { @@ -402,13 +471,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd)); return ENOMEM; } - rc = copyin(pvUser, pHdr, Hdr.cbIn); - if (RT_UNLIKELY(rc)) + if (RT_FAILURE(RTR0MemUserCopyFrom(pHdr, pvUser, Hdr.cbIn))) { - OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyin(%p,%p,%#x) -> %#x; ulCmd=%#lx\n", - pvUser, pHdr, Hdr.cbIn, rc, ulCmd)); + OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyin(%p,%p,%#x); ulCmd=%#lx\n", + pvUser, pHdr, Hdr.cbIn, ulCmd)); RTMemTmpFree(pHdr); - return rc; + return EFAULT; } if (Hdr.cbIn < cbReq) RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn); @@ -436,9 +504,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd)); cbOut = cbReq; } - rc = copyout(pHdr, pvUser, cbOut); - if (RT_UNLIKELY(rc)) - OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyout(%p,%p,%#x) -> %d; uCmd=%#lx!\n", pHdr, pvUser, cbOut, rc, ulCmd)); + if (RT_FAILURE(RTR0MemUserCopyTo(pvUser, pHdr, cbOut))) + OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyout(%p,%p,%#x); uCmd=%#lx!\n", pHdr, pvUser, cbOut, ulCmd)); Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd)); @@ -541,8 +608,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE bool VBOXCALL supdrvOSAreCpusOfflinedOnSuspend(void) { - /** @todo verify this. */ - return false; + return true; } -@@ -616,11 +682,25 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, +@@ -625,11 +691,25 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, #endif /* SUPDRV_WITH_MSR_PROBER */ +/** + * Check if the CPU has SMAP support. + */ +static bool VBoxDrvFreeBSDCpuHasSMAP(void) +{ +#ifdef VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV + if ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0) + return true; +#endif + return false; +} + + SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...) { va_list va; char szMsg[256]; int cch; + IPRT_FREEBSD_SAVE_EFL_AC(); va_start(va, pszFormat); cch = RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, va); -@@ -628,12 +708,19 @@ SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...) +@@ -637,12 +717,19 @@ SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...) printf("%s", szMsg); + IPRT_FREEBSD_RESTORE_EFL_AC(); return cch; } SUPR0DECL(uint32_t) SUPR0GetKernelFeatures(void) { - return 0; + uint32_t fFlags = 0; +#ifdef VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV + if (g_VBoxDrvFreeBSDChrDevSwSys.d_ioctl == VBoxDrvFreeBSDIOCtlSMAP) + fFlags |= SUPKERNELFEATURES_SMAP; + else + Assert(!(ASMGetCR4() & X86_CR4_SMAP)); +#endif + return fFlags; } - Index: head/emulators/virtualbox-ose/files/patch-src_VBox_HostServices_SharedOpenGL_Makefile.kmk =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_HostServices_SharedOpenGL_Makefile.kmk (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_HostServices_SharedOpenGL_Makefile.kmk (revision 542551) @@ -1,10 +1,10 @@ ---- src/VBox/HostServices/SharedOpenGL/Makefile.kmk.orig 2017-10-18 07:12:48 UTC +--- src/VBox/HostServices/SharedOpenGL/Makefile.kmk.orig 2020-05-13 19:43:59 UTC +++ src/VBox/HostServices/SharedOpenGL/Makefile.kmk -@@ -436,6 +436,7 @@ if ( defined(VBOX_WITH_QTGUI) \ +@@ -335,6 +335,7 @@ if ( defined(VBOX_WITH_QTGUI) \ $(if $(VBOX_WITH_CROGL), VBOX_WITH_CROGL,) \ $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL,) ifdef VBOX_WITH_VIDEOHWACCEL + VBoxTestOGL_CXXFLAGS.freebsd += -std=c++11 VBoxTestOGL_QT_MODULES += Core Gui OpenGL Widgets VBoxTestOGL_LIBS.linux += xcb VBoxTestOGL_LIBS.solaris += xcb Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Main_Makefile.kmk =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Main_Makefile.kmk (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Main_Makefile.kmk (revision 542551) @@ -1,10 +1,10 @@ ---- src/VBox/Main/Makefile.kmk.orig 2017-03-08 17:20:11 UTC +--- src/VBox/Main/Makefile.kmk.orig 2020-05-13 19:44:04 UTC +++ src/VBox/Main/Makefile.kmk -@@ -445,6 +445,7 @@ VBoxSVC_SOURCES.os2 = \ +@@ -526,6 +526,7 @@ VBoxSVC_SOURCES.os2 = \ VBoxSVC_SOURCES.freebsd = \ src-server/freebsd/HostHardwareFreeBSD.cpp \ + $(if $(VBOX_WITH_DBUS),src-server/linux/HostPowerLinux.cpp) \ src-server/HostDnsServiceResolvConf.cpp Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Main_include_USBProxyBackend.h =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Main_include_USBProxyBackend.h (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Main_include_USBProxyBackend.h (revision 542551) @@ -1,17 +1,17 @@ ---- src/VBox/Main/include/USBProxyBackend.h.orig 2017-01-17 07:27:19 UTC +--- src/VBox/Main/include/USBProxyBackend.h.orig 2020-05-13 19:44:06 UTC +++ src/VBox/Main/include/USBProxyBackend.h -@@ -359,13 +359,10 @@ public: +@@ -365,13 +365,10 @@ class USBProxyBackendFreeBSD : public USBProxyBackend virtual int releaseDevice(HostUSBDevice *aDevice); protected: - int initUsbfs(void); - int initSysfs(void); virtual int wait(RTMSINTERVAL aMillies); virtual int interruptWait(void); virtual PUSBDEVICE getDevices(void); - int addDeviceToChain(PUSBDEVICE pDev, PUSBDEVICE *ppFirst, PUSBDEVICE **pppNext, int rc); - virtual void deviceAdded(ComObjPtr &aDevice, SessionMachinesList &llOpenedMachines, PUSBDEVICE aUSBDevice); + virtual bool isFakeUpdateRequired(); private: RTSEMEVENT mNotifyEventSem; Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Main_src-client_ConsoleImpl2.cpp =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Main_src-client_ConsoleImpl2.cpp (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Main_src-client_ConsoleImpl2.cpp (revision 542551) @@ -1,20 +1,20 @@ ---- src/VBox/Main/src-client/ConsoleImpl2.cpp.orig 2017-10-18 07:12:56 UTC +--- src/VBox/Main/src-client/ConsoleImpl2.cpp.orig 2020-05-13 19:44:07 UTC +++ src/VBox/Main/src-client/ConsoleImpl2.cpp -@@ -5206,7 +5206,7 @@ int Console::i_configNetwork(const char *pszDevice, +@@ -5265,7 +5265,7 @@ int Console::i_configNetwork(const char *pszDevice, { switch (hrc) { - case VERR_ACCESS_DENIED: + case (HRESULT)VERR_ACCESS_DENIED: return VMSetError(VMR3GetVM(mpUVM), VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( "Failed to open '/dev/net/tun' for read/write access. Please check the " "permissions of that node. Either run 'chmod 0666 /dev/net/tun' or " -@@ -5408,7 +5408,7 @@ int Console::i_configNetwork(const char *pszDevice, +@@ -5467,7 +5467,7 @@ int Console::i_configNetwork(const char *pszDevice, { switch (hrc) { - case VERR_ACCESS_DENIED: + case (HRESULT)VERR_ACCESS_DENIED: return VMSetError(VMR3GetVM(mpUVM), VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( "Failed to open '/dev/%s' for read/write access. Please check the " "permissions of that node, and that the net.link.tap.user_open " Index: head/emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_HostImpl.cpp =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_HostImpl.cpp (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_HostImpl.cpp (revision 542551) @@ -1,11 +1,11 @@ ---- src/VBox/Main/src-server/HostImpl.cpp.orig 2017-03-08 17:20:14 UTC +--- src/VBox/Main/src-server/HostImpl.cpp.orig 2020-05-13 19:44:09 UTC +++ src/VBox/Main/src-server/HostImpl.cpp -@@ -293,7 +293,7 @@ HRESULT Host::init(VirtualBox *aParent) +@@ -284,7 +284,7 @@ HRESULT Host::init(VirtualBox *aParent) #if defined(RT_OS_WINDOWS) m->pHostPowerService = new HostPowerServiceWin(m->pParent); -#elif defined(RT_OS_LINUX) && defined(VBOX_WITH_DBUS) +#elif (defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)) && defined(VBOX_WITH_DBUS) m->pHostPowerService = new HostPowerServiceLinux(m->pParent); #elif defined(RT_OS_DARWIN) m->pHostPowerService = new HostPowerServiceDarwin(m->pParent); Index: head/emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR0_GVMMR0.cpp =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR0_GVMMR0.cpp (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR0_GVMMR0.cpp (revision 542551) @@ -1,11 +1,11 @@ ---- src/VBox/VMM/VMMR0/GVMMR0.cpp.orig 2018-01-15 14:56:33.000000000 +0000 -+++ src/VBox/VMM/VMMR0/GVMMR0.cpp 2018-01-17 01:13:24.832105000 +0000 +--- src/VBox/VMM/VMMR0/GVMMR0.cpp.orig 2020-05-13 19:44:47 UTC ++++ src/VBox/VMM/VMMR0/GVMMR0.cpp @@ -1243,7 +1243,7 @@ static void gvmmR0CleanupVM(PGVM pGVM) GMMR0CleanupVM(pGVM); - AssertCompile((uintptr_t)NIL_RTTHREADCTXHOOK == 0); /* Depends on zero initialized memory working for NIL at the moment. */ + AssertCompile(NIL_RTTHREADCTXHOOK == (RTTHREADCTXHOOK)0); /* Depends on zero initialized memory working for NIL at the moment. */ for (VMCPUID idCpu = 0; idCpu < pGVM->cCpus; idCpu++) { /** @todo Can we busy wait here for all thread-context hooks to be Index: head/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c (revision 542551) @@ -1,22 +1,22 @@ ---- src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c.orig +--- src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c.orig 2020-05-13 19:46:23 UTC +++ src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c @@ -49,6 +49,9 @@ #include #include #include +#ifdef FREEBSD +#include +#endif static pthread_mutexattr_t _pt_mattr; static pthread_condattr_t _pt_cvar_attr; -@@ -798,7 +801,8 @@ +@@ -798,7 +801,8 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphore(const char * * From the semctl(2) man page in glibc 2.0 */ #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \ - || defined(FREEBSD) || defined(OPENBSD) || defined(BSDI) + || (defined(FREEBSD) && __FreeBSD_version < 1200059) \ + || defined(OPENBSD) || defined(BSDI) /* union semun is defined by including */ #else /* according to X/OPEN we have to define it ourselves */ Index: head/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_xpcom_io_nsLocalFileUnix.h =================================================================== --- head/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_xpcom_io_nsLocalFileUnix.h (revision 542550) +++ head/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_xpcom_io_nsLocalFileUnix.h (revision 542551) @@ -1,17 +1,17 @@ ---- src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h.orig 2017-03-08 17:21:24.000000000 +0000 -+++ src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h 2017-03-08 22:53:39.572250000 +0000 +--- src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h.orig 2020-05-13 19:46:34 UTC ++++ src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h @@ -72,14 +72,6 @@ #define STATFS statfs #endif -// so we can statfs on freebsd -#if defined(__FreeBSD__) - #define HAVE_SYS_STATFS_H - #define STATFS statfs - #include - #include -#endif - class NS_COM nsLocalFile : public nsILocalFile { public: Index: head/emulators/virtualbox-ose-additions/Makefile =================================================================== --- head/emulators/virtualbox-ose-additions/Makefile (revision 542550) +++ head/emulators/virtualbox-ose-additions/Makefile (revision 542551) @@ -1,193 +1,192 @@ # Created by: Bernhard Froehlich # $FreeBSD$ PORTNAME= virtualbox-ose -PORTVERSION= 5.2.34 -PORTREVISION= 2 +PORTVERSION= 5.2.44 CATEGORIES= emulators MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ PKGNAMESUFFIX?= -additions DISTNAME= VirtualBox-${PORTVERSION} MAINTAINER= vbox@FreeBSD.org COMMENT= VirtualBox additions for FreeBSD guests LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING ONLY_FOR_ARCHS= amd64 i386 USES= compiler:c++11-lang cpe iconv kmod tar:bzip2 USE_RC_SUBR= vboxguest vboxservice BUILD_DEPENDS= yasm:devel/yasm \ kmk:devel/kBuild \ xsltproc:textproc/libxslt CPE_VENDOR= oracle CPE_PRODUCT= vm_virtualbox PATCHDIR= ${.CURDIR}/../${PORTNAME}/files WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} MAKE_JOBS_UNSAFE= yes HAS_CONFIGURE= yes CONFIGURE_ARGS+= --disable-alsa \ --disable-docs \ --disable-libvpx \ --disable-pulse \ --disable-python \ --disable-sdl-ttf \ --disable-xpcom CONFIGURE_ARGS+= --nofatal --with-gcc="${CC}" --with-g++="${CXX}" CONFLICTS_INSTALL= virtualbox-ose-[0-9]* \ virtualbox-ose-additions-devel-[0-9]* \ virtualbox-ose-devel-[0-9]* \ virtualbox-ose-legacy-[0-9]* \ virtualbox-ose-lite-[0-9]* \ virtualbox-ose-nox11-[0-9]* OPTIONS_DEFINE= DBUS DEBUG OPENGL X11 OPTIONS_DEFAULT= DBUS X11 OPTIONS_SUB= yes OPENGL_DESC= 3D pass-through support (requires X11) DBUS_CONFIGURE_OFF= --disable-dbus DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus DEBUG_CONFIGURE_ON= --build-debug DEBUG_VARS= KMK_BUILDTYPE=debug DEBUG_VARS_OFF= KMK_BUILDTYPE=release OPENGL_CONFIGURE_OFF= --disable-opengl OPENGL_IMPLIES= X11 OPENGL_USE= GL=gl,glu XORG=xcomposite,xdamage,xfixes OPENGL_USES= gl python:2.7,build xorg X11_BUILD_DEPENDS= ${LOCALBASE}/include/xorg/compiler.h:x11-servers/xorg-server X11_RUN_DEPENDS= xrandr:x11/xrandr X11_USE= XORG=x11,xcursor,xext,xorgproto,xmu,xrandr,xt X11_USES= pkgconfig xorg X11_VARS= VBOX_WITH_X11=1 .include .if ${SLAVE_PORT} == no CONFLICTS_INSTALL+= virtualbox-ose-additions-nox11-[0-9]* .else CONFLICTS_INSTALL+= virtualbox-ose-additions-[0-9]* .endif VIDEODIR= ${PREFIX}/lib/xorg/modules/drivers INPUTDIR= ${PREFIX}/lib/xorg/modules/input VBOX_BIN= ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/additions VBOX_SBINS= VBoxControl \ VBoxService \ mount_vboxvfs BUILD_WRKSRC= ${VBOX_BIN}/src KMK_ARCH= freebsd.${ARCH:S/i386/x86/} KMK_CONFIG+= VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys .if ${PORT_OPTIONS:MOPENGL} VBOX_LIBS= VBoxEGL.so \ VBoxOGL.so .endif .if ${PORT_OPTIONS:MX11} .else VBOX_WITH_X11= .endif .include .if ${COMPILER_TYPE} == clang .if ${COMPILER_FEATURES:Mlibc++} EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src-VBox-Additions-x11-VBoxClient-Makefile.kmk .endif .endif post-patch: @${ECHO_CMD} 'VBOX_ONLY_ADDITIONS = 1' > ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP = ${VBOX_WITH_X11}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP_GH = ${VBOX_WITH_X11}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_X11_ADDITIONS = ${VBOX_WITH_X11}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_GCC_std = -std=c++11' >> ${WRKSRC}/LocalConfig.kmk .if ${COMPILER_TYPE} == clang @${REINPLACE_CMD} -e 's| -finline-limit=8000||' \ -e 's| -fno-merge-constants||' \ -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk .endif @${REINPLACE_CMD} -e 's|/usr/X11|${LOCALBASE}|g' \ ${WRKSRC}/src/VBox/Additions/x11/VBoxClient/display.cpp @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Config.kmk ${WRKSRC}/configure \ ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \ ${WRKSRC}/kBuild/units/qt5.kmk ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \ ${WRKSRC}/src/VBox/Additions/common/crOpenGL/load.c \ ${WRKSRC}/src/VBox/Additions/x11/Installer/98vboxadd-xclient \ ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \ ${WRKSRC}/src/VBox/Additions/x11/vboxmouse/Makefile.kmk \ ${WRKSRC}/src/VBox/Additions/x11/vboxvideo/Makefile.kmk @${REINPLACE_CMD} \ -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \ ${WRKSRC}/configure .if empty(ICONV_LIB) @${REINPLACE_CMD} -e 's|iconv||' ${WRKSRC}/Config.kmk \ ${WRKSRC}/src/VBox/Runtime/Makefile.kmk \ ${WRKSRC}/src/VBox/Additions/x11/VBoxClient/Makefile.kmk @${ECHO_CMD} 'VBOX_ICONV_DEFS = LIBICONV_PLUG' >> ${WRKSRC}/LocalConfig.kmk .endif post-patch-OPENGL-on: @${ECHO_CMD} 'VBOX_USE_SYSTEM_GL_HEADERS = 1' >> ${WRKSRC}/LocalConfig.kmk post-patch-X11-on: @${ECHO_CMD} 'VBOX_USE_SYSTEM_XORG_HEADERS = 1' >> \ ${WRKSRC}/LocalConfig.kmk pre-build: cd ${WRKSRC} && ${SH} -c \ ". env.sh && ${KMK_CONFIG} ${LOCALBASE}/bin/kmk" do-install: ${MKDIR} ${STAGEDIR}${KMODDIR} ${INSTALL_KLD} ${VBOX_BIN}/src/vboxguest/vboxguest.ko \ ${STAGEDIR}${KMODDIR} ${INSTALL_KLD} ${VBOX_BIN}/vboxvfs.ko ${STAGEDIR}${KMODDIR} ${INSTALL_LIB} ${VBOX_BIN}/pam_vbox.so ${STAGEDIR}${PREFIX}/lib ${INSTALL_PROGRAM} ${VBOX_SBINS:S|^|${VBOX_BIN}/|} \ ${STAGEDIR}${PREFIX}/sbin/ do-install-X11-on: ${INSTALL_PROGRAM} ${VBOX_BIN}/VBoxClient ${STAGEDIR}${PREFIX}/bin/ ${INSTALL_SCRIPT} \ ${WRKSRC}/src/VBox/Additions/x11/Installer/98vboxadd-xclient \ ${STAGEDIR}${PREFIX}/bin/VBoxClient-all # X11 autostart ${MKDIR} ${STAGEDIR}${PREFIX}/etc/xdg/autostart/ ${INSTALL_DATA} \ ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \ ${STAGEDIR}${PREFIX}/etc/xdg/autostart/ # KDE autostart ${MKDIR} ${STAGEDIR}${PREFIX}/share/autostart/ ${INSTALL_DATA} \ ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \ ${STAGEDIR}${PREFIX}/share/autostart/ ${MKDIR} ${STAGEDIR}${VIDEODIR} ${INSTALL_DATA} ${VBOX_BIN}/vboxvideo_drv_system.so \ ${STAGEDIR}${VIDEODIR}/vboxvideo_drv.so ${MKDIR} ${STAGEDIR}${INPUTDIR} ${INSTALL_DATA} ${VBOX_BIN}/vboxmouse_drv_system.so \ ${STAGEDIR}${INPUTDIR}/vboxmouse_drv.so do-install-OPENGL-on: ${INSTALL_DATA} ${FILESDIR}/vboxvideo.conf \ ${STAGEDIR}${PREFIX}/etc/libmap.d/ ${INSTALL_DATA} ${VBOX_LIBS:S|^|${VBOX_BIN}/|} \ ${STAGEDIR}${PREFIX}/lib/ .include Index: head/emulators/virtualbox-ose-additions/distinfo =================================================================== --- head/emulators/virtualbox-ose-additions/distinfo (revision 542550) +++ head/emulators/virtualbox-ose-additions/distinfo (revision 542551) @@ -1,3 +1,3 @@ -TIMESTAMP = 1571257463 -SHA256 (VirtualBox-5.2.34.tar.bz2) = 9abff37330bba46b97aa836bc886397ba9cfb06cb75be5d60ac31f5ae9c2f2e1 -SIZE (VirtualBox-5.2.34.tar.bz2) = 118268064 +TIMESTAMP = 1594821235 +SHA256 (VirtualBox-5.2.44.tar.bz2) = ad83b11cfae2734f7d6f619dd2f8bdada7d33492cd7682fab98cb4053122295e +SIZE (VirtualBox-5.2.44.tar.bz2) = 124016934 Index: head/emulators/virtualbox-ose-kmod/Makefile =================================================================== --- head/emulators/virtualbox-ose-kmod/Makefile (revision 542550) +++ head/emulators/virtualbox-ose-kmod/Makefile (revision 542551) @@ -1,107 +1,107 @@ # Created by: Bernhard Froehlich # $FreeBSD$ PORTNAME= virtualbox-ose -PORTVERSION= 5.2.34 +PORTVERSION= 5.2.44 CATEGORIES= emulators MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ PKGNAMESUFFIX= -kmod DISTNAME= VirtualBox-${PORTVERSION} MAINTAINER= vbox@FreeBSD.org COMMENT= VirtualBox kernel module for FreeBSD LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING BUILD_DEPENDS= kmk:devel/kBuild CPE_VENDOR= oracle CPE_PRODUCT= vm_virtualbox USES= cpe kmod tar:bzip2 PATCHDIR= ${.CURDIR}/../${PORTNAME}/files WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} USE_RC_SUBR= vboxnet ONLY_FOR_ARCHS= i386 amd64 HAS_CONFIGURE= yes CONFIGURE_ARGS+= --build-headless CONFIGURE_ARGS+= --disable-alsa \ --disable-dbus \ --disable-docs \ --disable-libvpx \ --disable-pulse \ --disable-python \ --disable-sdl-ttf \ --disable-xpcom CONFIGURE_ARGS+= --nofatal --with-gcc="${CC}" --with-g++="${CXX}" CONFLICTS_INSTALL= virtualbox-ose-kmod-devel-* \ virtualbox-ose-kmod-legacy-* OPTIONS_DEFINE= DEBUG VIMAGE OPTIONS_DEFAULT=VIMAGE OPTIONS_SUB= yes DEBUG_DESC= Debug symbols, additional logs and assertions VIMAGE_DESC= VIMAGE virtual networking support .include VBOX_BIN= ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/src VBOX_KMODS= vboxdrv \ vboxnetadp \ vboxnetflt BUILD_WRKSRC= ${VBOX_BIN} KMK_BUILDTYPE= release KMK_CONFIG= VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys KMK_FLAGS= HostDrivers-scripts vboxdrv-src VBoxNetFlt-src VBoxNetAdp-src .if ${PORT_OPTIONS:MDEBUG} KMK_FLAGS+= BUILD_TYPE=debug KMK_BUILDTYPE= debug EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile MAKE_ARGS+= DEBUG_FLAGS="-O1 -g" .endif .if ${ARCH} == i386 KMK_ARCH= freebsd.x86 .else KMK_ARCH= freebsd.${ARCH} .endif .include SYMBOLSUFFIX= debug PLIST_SUB+= SYMBOLSUFFIX=${SYMBOLSUFFIX} post-patch: @${ECHO_CMD} 'VBOX_WITH_VBOXDRV = 1' > ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_NETFLT = 1' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_NETADP = 1' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_ADDITIONS =' >> ${WRKSRC}/LocalConfig.kmk .if ${PORT_OPTIONS:MVIMAGE} @${ECHO_CMD} 'VBOX_WITH_NETFLT_VIMAGE = 1' >> ${WRKSRC}/LocalConfig.kmk .endif @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Config.kmk ${WRKSRC}/configure @${REINPLACE_CMD} \ -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \ ${WRKSRC}/configure pre-build: cd ${WRKSRC}/src/VBox/HostDrivers && ${SH} -c \ '. ${WRKSRC}/env.sh && ${KMK_CONFIG} ${LOCALBASE}/bin/kmk ${KMK_FLAGS}' do-install: ${MKDIR} ${STAGEDIR}${KMODDIR} .for i in ${VBOX_KMODS} ${INSTALL_KLD} ${VBOX_BIN}/${i}/${i}.ko ${STAGEDIR}${KMODDIR} .if ${PORT_OPTIONS:MDEBUG} ${INSTALL_KLD} ${VBOX_BIN}/${i}/${i}.ko.${SYMBOLSUFFIX} ${STAGEDIR}${KMODDIR} .endif .endfor .include Index: head/emulators/virtualbox-ose-kmod/distinfo =================================================================== --- head/emulators/virtualbox-ose-kmod/distinfo (revision 542550) +++ head/emulators/virtualbox-ose-kmod/distinfo (revision 542551) @@ -1,3 +1,3 @@ -TIMESTAMP = 1571257293 -SHA256 (VirtualBox-5.2.34.tar.bz2) = 9abff37330bba46b97aa836bc886397ba9cfb06cb75be5d60ac31f5ae9c2f2e1 -SIZE (VirtualBox-5.2.34.tar.bz2) = 118268064 +TIMESTAMP = 1594821147 +SHA256 (VirtualBox-5.2.44.tar.bz2) = ad83b11cfae2734f7d6f619dd2f8bdada7d33492cd7682fab98cb4053122295e +SIZE (VirtualBox-5.2.44.tar.bz2) = 124016934