Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102037755
D16119.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
10 KB
Referenced Files
None
Subscribers
None
D16119.diff
View Options
diff --git a/emulators/virtualbox-ose-kmod-legacy/Makefile b/emulators/virtualbox-ose-kmod-legacy/Makefile
--- a/emulators/virtualbox-ose-kmod-legacy/Makefile
+++ b/emulators/virtualbox-ose-kmod-legacy/Makefile
@@ -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}
diff --git a/emulators/virtualbox-ose-kmod-legacy/files/pkg-message.in b/emulators/virtualbox-ose-kmod-legacy/files/pkg-message.in
new file mode 100644
--- /dev/null
+++ b/emulators/virtualbox-ose-kmod-legacy/files/pkg-message.in
@@ -0,0 +1,10 @@
+[
+{ type: install
+ message: <<EOM
+The vboxdrv kernel module uses internal kernel APIs.
+
+To avoid crashes due to kernel incompatibility, this module will only
+load on %%OPSYS%% %%OSREL%% kernels.
+EOM
+}
+]
diff --git a/emulators/virtualbox-ose-kmod/Makefile b/emulators/virtualbox-ose-kmod/Makefile
--- a/emulators/virtualbox-ose-kmod/Makefile
+++ b/emulators/virtualbox-ose-kmod/Makefile
@@ -2,6 +2,7 @@
PORTNAME= virtualbox-ose
PORTVERSION= 6.1.34
+PORTREVISION= 1
CATEGORIES= emulators
MASTER_SITES= https://download.virtualbox.org/virtualbox/${PORTVERSION}/
PKGNAMESUFFIX= -kmod
@@ -18,6 +19,9 @@
CPE_VENDOR= oracle
CPE_PRODUCT= vm_virtualbox
+SUB_FILES= pkg-message
+SUB_LIST= OPSYS=${OPSYS} OSREL=${OSREL}
+
USES= cpe compiler:c++14-lang kmod tar:bzip2
PATCHDIR= ${.CURDIR}/../${PORTNAME}/files
WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION}
diff --git a/emulators/virtualbox-ose-kmod/files/pkg-message.in b/emulators/virtualbox-ose-kmod/files/pkg-message.in
new file mode 100644
--- /dev/null
+++ b/emulators/virtualbox-ose-kmod/files/pkg-message.in
@@ -0,0 +1,10 @@
+[
+{ type: install
+ message: <<EOM
+The vboxdrv kernel module uses internal kernel APIs.
+
+To avoid crashes due to kernel incompatibility, this module will only
+load on %%OPSYS%% %%OSREL%% kernels.
+EOM
+}
+]
diff --git a/emulators/virtualbox-ose-legacy/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c b/emulators/virtualbox-ose-legacy/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c
--- a/emulators/virtualbox-ose-legacy/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c
+++ b/emulators/virtualbox-ose-legacy/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c
@@ -1,5 +1,5 @@
---- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2020-05-13 19:43:53 UTC
-+++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
+--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2020-07-09 09:57:00.000000000 -0700
++++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c 2021-11-19 15:10:40.470972000 -0800
@@ -46,6 +46,7 @@
#include <sys/uio.h>
@@ -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);
diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c b/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c
--- a/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c
+++ b/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 <sys/fcntl.h>
#include <sys/conf.h>
@@ -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 */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 8:06 PM (5 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14519854
Default Alt Text
D16119.diff (10 KB)
Attached To
Mode
D16119: emulators/virtualbox-ose-kmod*: Tie to a specific release branch.
Attached
Detach File
Event Timeline
Log In to Comment