Index: emulators/virtualbox-ose-kmod-legacy/Makefile =================================================================== --- emulators/virtualbox-ose-kmod-legacy/Makefile +++ emulators/virtualbox-ose-kmod-legacy/Makefile @@ -2,7 +2,7 @@ PORTNAME= virtualbox-ose PORTVERSION= 5.2.44 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= emulators MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ PKGNAMESUFFIX= -kmod-legacy @@ -19,6 +19,9 @@ CPE_VENDOR= oracle CPE_PRODUCT= vm_virtualbox +SUB_FILES= pkg-message +SUB_LIST= OPSYS=${OPSYS} OSREL=${OSREL} + USES= cpe kmod tar:bzip2 PATCHDIR= ${.CURDIR}/../${PORTNAME}-legacy/files WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} Index: emulators/virtualbox-ose-kmod-legacy/files/pkg-message.in =================================================================== --- /dev/null +++ emulators/virtualbox-ose-kmod-legacy/files/pkg-message.in @@ -0,0 +1,9 @@ +[ +{ type: install + message: < @@ -33,7 +33,17 @@ /********************************************************************************************************************************* -@@ -182,6 +192,13 @@ static int VBoxDrvFreeBSDLoad(void) +@@ -93,7 +103,8 @@ static moduledata_t g_VBoxDrvFreeBSDModule = + }; + + /** Declare the module as a pseudo device. */ +-DECLARE_MODULE(vboxdrv, g_VBoxDrvFreeBSDModule, SI_SUB_PSEUDO, SI_ORDER_ANY); ++#define KERNEL_RELBRANCHEND (roundup(__FreeBSD_version, 500) - 1) ++DECLARE_MODULE_WITH_MAXVER(vboxdrv, g_VBoxDrvFreeBSDModule, SI_SUB_PSEUDO, SI_ORDER_ANY, KERNEL_RELBRANCHEND); + MODULE_VERSION(vboxdrv, 1); + + /** +@@ -182,6 +193,13 @@ static int VBoxDrvFreeBSDLoad(void) rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt, sizeof(SUPDRVSESSION)); if (RT_SUCCESS(rc)) { @@ -47,7 +57,7 @@ /* * Configure character devices. Add symbolic links for compatibility. */ -@@ -311,7 +328,21 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo +@@ -311,7 +329,21 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo PSUPDRVSESSION pSession; devfs_get_cdevpriv((void **)&pSession); @@ -69,7 +79,7 @@ * 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 +@@ -325,6 +357,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo /** @@ -115,7 +125,7 @@ * 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 +@@ -373,11 +444,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes */ SUPREQHDR Hdr; pvUser = *(void **)pvData; @@ -130,7 +140,7 @@ } if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC)) { -@@ -402,13 +471,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -402,13 +472,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd)); return ENOMEM; } @@ -148,7 +158,7 @@ } if (Hdr.cbIn < cbReq) RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn); -@@ -436,9 +504,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -436,9 +505,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd)); cbOut = cbReq; } @@ -160,7 +170,7 @@ Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd)); -@@ -541,8 +608,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE +@@ -541,8 +609,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE bool VBOXCALL supdrvOSAreCpusOfflinedOnSuspend(void) { @@ -170,7 +180,7 @@ } -@@ -625,11 +691,25 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, +@@ -625,11 +692,25 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, #endif /* SUPDRV_WITH_MSR_PROBER */ @@ -196,7 +206,7 @@ va_start(va, pszFormat); cch = RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, va); -@@ -637,12 +717,19 @@ SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...) +@@ -637,12 +718,19 @@ SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...) printf("%s", szMsg); Index: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c +++ emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c @@ -1,5 +1,5 @@ ---- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2021-10-18 17:58:03 UTC -+++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c +--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2021-10-18 10:58:03.000000000 -0700 ++++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c 2021-11-19 15:31:33.152269000 -0800 @@ -44,8 +44,10 @@ #include #include @@ -36,7 +36,17 @@ /********************************************************************************************************************************* -@@ -182,6 +193,13 @@ static int VBoxDrvFreeBSDLoad(void) +@@ -93,7 +104,8 @@ static moduledata_t g_VBoxDrvFreeBSDModule = + }; + + /** Declare the module as a pseudo device. */ +-DECLARE_MODULE(vboxdrv, g_VBoxDrvFreeBSDModule, SI_SUB_PSEUDO, SI_ORDER_ANY); ++#define KERNEL_RELBRANCHEND (roundup(__FreeBSD_version, 500) - 1) ++DECLARE_MODULE_WITH_MAXVER(vboxdrv, g_VBoxDrvFreeBSDModule, SI_SUB_PSEUDO, SI_ORDER_ANY, KERNEL_RELBRANCHEND); + MODULE_VERSION(vboxdrv, 1); + + /** +@@ -182,6 +194,13 @@ static int VBoxDrvFreeBSDLoad(void) rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt, sizeof(SUPDRVSESSION)); if (RT_SUCCESS(rc)) { @@ -50,7 +60,7 @@ /* * Configure character devices. Add symbolic links for compatibility. */ -@@ -324,6 +342,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo +@@ -324,6 +343,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo /** @@ -96,7 +106,7 @@ * Deal with the 'slow' I/O control requests. * * @returns 0 on success, appropriate errno on failure. -@@ -372,11 +429,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -372,11 +430,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes */ SUPREQHDR Hdr; pvUser = *(void **)pvData; @@ -111,7 +121,7 @@ } if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC)) { -@@ -401,13 +457,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -401,13 +458,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd)); return ENOMEM; } @@ -129,7 +139,7 @@ } if (Hdr.cbIn < cbReq) RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn); -@@ -435,9 +490,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -435,9 +491,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd)); cbOut = cbReq; } @@ -141,7 +151,7 @@ Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd)); -@@ -540,8 +594,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE +@@ -540,8 +595,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE bool VBOXCALL supdrvOSAreCpusOfflinedOnSuspend(void) { @@ -151,7 +161,7 @@ } -@@ -624,19 +677,43 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, +@@ -624,19 +678,43 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, #endif /* SUPDRV_WITH_MSR_PROBER */