summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Bermond2020-04-05 16:38:11 +0000
committerDaniel Bermond2020-04-05 16:39:08 +0000
commit64c7664c47ff8846067432af536ddad9b2f6563e (patch)
tree6a15c95851fd72a5458cdc6691a0846ab819eb5b
parentcc4eefae555abc141d8aef71d8447f5bf97c7752 (diff)
downloadaur-64c7664c47ff8846067432af536ddad9b2f6563e.tar.gz
Add patch for linux 5.6. General improvements.
-rw-r--r--.SRCINFO6
-rw-r--r--015-linux-5.6.patch263
-rw-r--r--PKGBUILD22
3 files changed, 284 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 73f7158c4d4e..3fbadd4dc958 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = virtualbox-bin
pkgdesc = Oracle VM VirtualBox Binary Edition (Oracle branded non-OSE version)
pkgver = 6.1.4
- pkgrel = 1
+ pkgrel = 2
url = https://www.virtualbox.org/
install = virtualbox-bin.install
arch = x86_64
@@ -20,7 +20,7 @@ pkgbase = virtualbox-bin
depends = python
depends = sdl
optdepends = virtualbox-ext-oracle: for Oracle extensions
- optdepends = java-runtime: for webservice java bindings
+ optdepends = java-runtime: for webservice sdk java bindings
optdepends = linux-headers: build the module for Arch kernel
optdepends = linux-lts-headers: build the module for LTS Arch kernel
provides = virtualbox=6.1.4
@@ -51,6 +51,7 @@ pkgbase = virtualbox-bin
source = do_dkms
source = dkms.conf
source = 013-Makefile.patch
+ source = 015-linux-5.6.patch
sha256sums = 02e609e7404afa448c4a789136326e4dbacd28bbd1b3f7a4d59f644aea0fb98c
sha256sums = 755d07a510574940ad6b664fa63fb7fa4b752d121f7decb76cc8e7fa77ba9718
sha256sums = 584f02a2a1e83b9cabd7b7e3b00a0515b118e040160eb46c014ea6fd3a16586e
@@ -63,6 +64,7 @@ pkgbase = virtualbox-bin
sha256sums = cc1c0500ab07bc13563d99037f776bf64bdc90bb521e31e2e0b04e42ea5bb36a
sha256sums = 63f1e9eabedec2170bd0589aaa2bf5025ff8f8ec1764cc4823cbe446e9ce1388
sha256sums = 268e794de9d66a2751006b2ca3810fc6a05da4af2ffa8b58c56c94b292f1f424
+ sha256sums = 09ae0e211f1f35e231a00f55704b5339a79080def896d650cd54fb5a5af60700
pkgname = virtualbox-bin
diff --git a/015-linux-5.6.patch b/015-linux-5.6.patch
new file mode 100644
index 000000000000..95c0e957b6a4
--- /dev/null
+++ b/015-linux-5.6.patch
@@ -0,0 +1,263 @@
+diff -Naurp a/src/vboxhost/vboxdrv/include/iprt/time.h b/src/vboxhost/vboxdrv/include/iprt/time.h
+--- a/src/vboxhost/vboxdrv/include/iprt/time.h 2020-02-04 10:54:52.000000000 +0000
++++ b/src/vboxhost/vboxdrv/include/iprt/time.h 2020-04-05 16:18:14.000000000 +0000
+@@ -357,8 +357,18 @@ DECLINLINE(void) RTTimeSpecGetSecondsAnd
+
+
+ /* PORTME: Add struct timeval guard macro here. */
+-#if defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
+- || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
++/*
++ * Starting with Linux kernel version 5.6-rc3, the struct timeval is no longer
++ * available to kernel code and must not be used in kernel code.
++ * Only 64-bit time-interfaces are allowed into the kernel.
++ */
++#if defined(RT_OS_LINUX) && (defined(__KERNEL__) || defined(_LINUX_TIME64_H))
++#define RTTIME_NO_TIMEVAL
++#endif
++#if !defined(RTTIME_NO_TIMEVAL) \
++ && (defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) \
++ || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
++ || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_)))
+ /**
+ * Gets the time as POSIX timeval.
+ *
+@@ -396,8 +406,20 @@ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTim
+
+
+ /* PORTME: Add struct timespec guard macro here. */
+-#if defined(RTTIME_INCL_TIMESPEC) || defined(_STRUCT_TIMESPEC) || defined(_SYS__TIMESPEC_H_) || defined(TIMEVAL_TO_TIMESPEC) || defined(_TIMESPEC) \
+- || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
++/*
++ * Starting with Linux kernel version 5.6-rc3, the _STRUCT_TIMESPEC is only defined
++ * under !__KERNEL__ guard and _LINUX_TIME64_H does not define a corresponding
++ * _STRUCT_TIMESPEC64. Only 64-bit time-interfaces are now allowed into the kernel.
++ * We have to keep it for __KERNEL__ though to support older guest kernels (2.6.X)
++ * without _LINUX_TIME64_H.
++ */
++#if defined(RT_OS_LINUX) && defined(_LINUX_TIME64_H)
++#define RTTIME_NO_TIMESPEC
++#endif
++#if !defined(RTTIME_NO_TIMESPEC) \
++ && (defined(RTTIME_INCL_TIMESPEC) || defined(_STRUCT_TIMESPEC) || defined(_SYS__TIMESPEC_H_) \
++ || defined(TIMEVAL_TO_TIMESPEC) || defined(_TIMESPEC) \
++ || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_)))
+ /**
+ * Gets the time as POSIX timespec.
+ *
+@@ -431,15 +453,14 @@ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTim
+ {
+ return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimespec->tv_sec), pTimespec->tv_nsec);
+ }
++#endif /* various ways of detecting struct timespec */
+
+-
+-# ifdef _LINUX_TIME64_H
++#if defined(RTTIME_NO_TIMESPEC)
+ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval)
+ {
+ return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_nsec);
+ }
+-# endif
+-#endif /* various ways of detecting struct timespec */
++#endif /* RT_OS_LINUX && _LINUX_TIME64_H */
+
+
+
+diff -Naurp a/src/vboxhost/vboxdrv/r0drv/linux/memobj-r0drv-linux.c b/src/vboxhost/vboxdrv/r0drv/linux/memobj-r0drv-linux.c
+--- a/src/vboxhost/vboxdrv/r0drv/linux/memobj-r0drv-linux.c 2020-02-04 10:55:49.000000000 +0000
++++ b/src/vboxhost/vboxdrv/r0drv/linux/memobj-r0drv-linux.c 2020-04-05 16:18:14.000000000 +0000
+@@ -1461,9 +1461,19 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKerne
+ * MMIO / physical memory.
+ */
+ Assert(pMemLnxToMap->Core.enmType == RTR0MEMOBJTYPE_PHYS && !pMemLnxToMap->Core.u.Phys.fAllocated);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
++ /*
++ * ioremap() defaults to no caching since the 2.6 kernels.
++ * ioremap_nocache() has been removed finally in 5.6-rc1.
++ */
++ pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO
++ ? ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub)
++ : ioremap_cache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub);
++#else /* KERNEL_VERSION < 2.6.25 */
+ pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO
+ ? ioremap_nocache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub)
+ : ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub);
++#endif /* KERNEL_VERSION < 2.6.25 */
+ if (pMemLnx->Core.pv)
+ {
+ /** @todo fix protection. */
+diff -Naurp a/src/vboxhost/vboxdrv/r0drv/linux/time-r0drv-linux.c b/src/vboxhost/vboxdrv/r0drv/linux/time-r0drv-linux.c
+--- a/src/vboxhost/vboxdrv/r0drv/linux/time-r0drv-linux.c 2020-02-04 10:55:49.000000000 +0000
++++ b/src/vboxhost/vboxdrv/r0drv/linux/time-r0drv-linux.c 2020-04-05 16:18:14.000000000 +0000
+@@ -38,12 +38,24 @@
+
+ DECLINLINE(uint64_t) rtTimeGetSystemNanoTS(void)
+ {
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) /* This must match timer-r0drv-linux.c! */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
++ /*
++ * Starting with kernel version 5.6-rc3 only 64-bit time interfaces
++ * are allowed in the kernel.
++ */
++ uint64_t u64;
++ struct timespec64 Ts = { 0, 0 };
++
++ ktime_get_ts64(&Ts);
++ u64 = Ts.tv_sec * RT_NS_1SEC_64 + Ts.tv_nsec;
++ return u64;
++
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) /* This must match timer-r0drv-linux.c! */
+ /*
+ * Use ktime_get_ts, this is also what clock_gettime(CLOCK_MONOTONIC,) is using.
+ */
+ uint64_t u64;
+- struct timespec Ts;
++ struct timespec Ts = { 0, 0 };
+ ktime_get_ts(&Ts);
+ u64 = Ts.tv_sec * RT_NS_1SEC_64 + Ts.tv_nsec;
+ return u64;
+@@ -182,9 +194,9 @@ RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPE
+ IPRT_LINUX_RESTORE_EFL_AC();
+ # ifdef _LINUX_TIME64_H
+ return RTTimeSpecSetTimespec64(pTime, &Ts);
+-#else
++# else
+ return RTTimeSpecSetTimespec(pTime, &Ts);
+-#endif
++# endif
+ #else /* < 2.6.16 */
+ struct timeval Tv;
+ do_gettimeofday(&Tv);
+diff -Naurp a/src/vboxhost/vboxnetadp/include/iprt/time.h b/src/vboxhost/vboxnetadp/include/iprt/time.h
+--- a/src/vboxhost/vboxnetadp/include/iprt/time.h 2020-02-04 10:54:52.000000000 +0000
++++ b/src/vboxhost/vboxnetadp/include/iprt/time.h 2020-04-05 16:18:14.000000000 +0000
+@@ -357,8 +357,18 @@ DECLINLINE(void) RTTimeSpecGetSecondsAnd
+
+
+ /* PORTME: Add struct timeval guard macro here. */
+-#if defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
+- || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
++/*
++ * Starting with Linux kernel version 5.6-rc3, the struct timeval is no longer
++ * available to kernel code and must not be used in kernel code.
++ * Only 64-bit time-interfaces are allowed into the kernel.
++ */
++#if defined(RT_OS_LINUX) && (defined(__KERNEL__) || defined(_LINUX_TIME64_H))
++#define RTTIME_NO_TIMEVAL
++#endif
++#if !defined(RTTIME_NO_TIMEVAL) \
++ && (defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) \
++ || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
++ || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_)))
+ /**
+ * Gets the time as POSIX timeval.
+ *
+@@ -396,8 +406,20 @@ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTim
+
+
+ /* PORTME: Add struct timespec guard macro here. */
+-#if defined(RTTIME_INCL_TIMESPEC) || defined(_STRUCT_TIMESPEC) || defined(_SYS__TIMESPEC_H_) || defined(TIMEVAL_TO_TIMESPEC) || defined(_TIMESPEC) \
+- || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
++/*
++ * Starting with Linux kernel version 5.6-rc3, the _STRUCT_TIMESPEC is only defined
++ * under !__KERNEL__ guard and _LINUX_TIME64_H does not define a corresponding
++ * _STRUCT_TIMESPEC64. Only 64-bit time-interfaces are now allowed into the kernel.
++ * We have to keep it for __KERNEL__ though to support older guest kernels (2.6.X)
++ * without _LINUX_TIME64_H.
++ */
++#if defined(RT_OS_LINUX) && defined(_LINUX_TIME64_H)
++#define RTTIME_NO_TIMESPEC
++#endif
++#if !defined(RTTIME_NO_TIMESPEC) \
++ && (defined(RTTIME_INCL_TIMESPEC) || defined(_STRUCT_TIMESPEC) || defined(_SYS__TIMESPEC_H_) \
++ || defined(TIMEVAL_TO_TIMESPEC) || defined(_TIMESPEC) \
++ || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_)))
+ /**
+ * Gets the time as POSIX timespec.
+ *
+@@ -431,15 +453,14 @@ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTim
+ {
+ return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimespec->tv_sec), pTimespec->tv_nsec);
+ }
++#endif /* various ways of detecting struct timespec */
+
+-
+-# ifdef _LINUX_TIME64_H
++#if defined(RTTIME_NO_TIMESPEC)
+ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval)
+ {
+ return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_nsec);
+ }
+-# endif
+-#endif /* various ways of detecting struct timespec */
++#endif /* RT_OS_LINUX && _LINUX_TIME64_H */
+
+
+
+diff -Naurp a/src/vboxhost/vboxnetflt/include/iprt/time.h b/src/vboxhost/vboxnetflt/include/iprt/time.h
+--- a/src/vboxhost/vboxnetflt/include/iprt/time.h 2020-02-04 10:54:52.000000000 +0000
++++ b/src/vboxhost/vboxnetflt/include/iprt/time.h 2020-04-05 16:18:14.000000000 +0000
+@@ -357,8 +357,18 @@ DECLINLINE(void) RTTimeSpecGetSecondsAnd
+
+
+ /* PORTME: Add struct timeval guard macro here. */
+-#if defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
+- || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
++/*
++ * Starting with Linux kernel version 5.6-rc3, the struct timeval is no longer
++ * available to kernel code and must not be used in kernel code.
++ * Only 64-bit time-interfaces are allowed into the kernel.
++ */
++#if defined(RT_OS_LINUX) && (defined(__KERNEL__) || defined(_LINUX_TIME64_H))
++#define RTTIME_NO_TIMEVAL
++#endif
++#if !defined(RTTIME_NO_TIMEVAL) \
++ && (defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) \
++ || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
++ || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_)))
+ /**
+ * Gets the time as POSIX timeval.
+ *
+@@ -396,8 +406,20 @@ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTim
+
+
+ /* PORTME: Add struct timespec guard macro here. */
+-#if defined(RTTIME_INCL_TIMESPEC) || defined(_STRUCT_TIMESPEC) || defined(_SYS__TIMESPEC_H_) || defined(TIMEVAL_TO_TIMESPEC) || defined(_TIMESPEC) \
+- || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
++/*
++ * Starting with Linux kernel version 5.6-rc3, the _STRUCT_TIMESPEC is only defined
++ * under !__KERNEL__ guard and _LINUX_TIME64_H does not define a corresponding
++ * _STRUCT_TIMESPEC64. Only 64-bit time-interfaces are now allowed into the kernel.
++ * We have to keep it for __KERNEL__ though to support older guest kernels (2.6.X)
++ * without _LINUX_TIME64_H.
++ */
++#if defined(RT_OS_LINUX) && defined(_LINUX_TIME64_H)
++#define RTTIME_NO_TIMESPEC
++#endif
++#if !defined(RTTIME_NO_TIMESPEC) \
++ && (defined(RTTIME_INCL_TIMESPEC) || defined(_STRUCT_TIMESPEC) || defined(_SYS__TIMESPEC_H_) \
++ || defined(TIMEVAL_TO_TIMESPEC) || defined(_TIMESPEC) \
++ || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_)))
+ /**
+ * Gets the time as POSIX timespec.
+ *
+@@ -431,15 +453,14 @@ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTim
+ {
+ return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimespec->tv_sec), pTimespec->tv_nsec);
+ }
++#endif /* various ways of detecting struct timespec */
+
+-
+-# ifdef _LINUX_TIME64_H
++#if defined(RTTIME_NO_TIMESPEC)
+ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval)
+ {
+ return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_nsec);
+ }
+-# endif
+-#endif /* various ways of detecting struct timespec */
++#endif /* RT_OS_LINUX && _LINUX_TIME64_H */
+
+
+
diff --git a/PKGBUILD b/PKGBUILD
index 9a53460d2e43..f31464a4ab87 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,7 +8,7 @@ pkgname=virtualbox-bin
pkgver=6.1.4
_build=136177
_rev=79806
-pkgrel=1
+pkgrel=2
pkgdesc='Oracle VM VirtualBox Binary Edition (Oracle branded non-OSE version)'
arch=('x86_64')
url='https://www.virtualbox.org/'
@@ -17,7 +17,7 @@ depends=('device-mapper' 'dkms' 'fontconfig' 'gcc' 'hicolor-icon-theme' 'libgl'
'libidl2' 'libxcursor' 'libxinerama' 'libxmu' 'python' 'sdl')
makedepends=('linux-headers')
optdepends=('virtualbox-ext-oracle: for Oracle extensions'
- 'java-runtime: for webservice java bindings'
+ 'java-runtime: for webservice sdk java bindings'
'linux-headers: build the module for Arch kernel'
'linux-lts-headers: build the module for LTS Arch kernel')
provides=("virtualbox=${pkgver}" 'virtualbox-sdk' 'VIRTUALBOX-HOST-MODULES'
@@ -38,7 +38,8 @@ source=("http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver
'vboxweb.conf'
'do_dkms'
'dkms.conf'
- '013-Makefile.patch')
+ '013-Makefile.patch'
+ '015-linux-5.6.patch')
noextract=("VirtualBoxSDK-${pkgver}-${_build}.zip")
sha256sums=('02e609e7404afa448c4a789136326e4dbacd28bbd1b3f7a4d59f644aea0fb98c'
'755d07a510574940ad6b664fa63fb7fa4b752d121f7decb76cc8e7fa77ba9718'
@@ -51,7 +52,8 @@ sha256sums=('02e609e7404afa448c4a789136326e4dbacd28bbd1b3f7a4d59f644aea0fb98c'
'12dbba3b59991f2b68cddeeeda20236aeff63e11b7e2d1b08d9d6a82225f6651'
'cc1c0500ab07bc13563d99037f776bf64bdc90bb521e31e2e0b04e42ea5bb36a'
'63f1e9eabedec2170bd0589aaa2bf5025ff8f8ec1764cc4823cbe446e9ce1388'
- '268e794de9d66a2751006b2ca3810fc6a05da4af2ffa8b58c56c94b292f1f424')
+ '268e794de9d66a2751006b2ca3810fc6a05da4af2ffa8b58c56c94b292f1f424'
+ '09ae0e211f1f35e231a00f55704b5339a79080def896d650cd54fb5a5af60700')
prepare() {
mkdir -p "${pkgname}-${pkgver}/VirtualBox-extracted"
@@ -66,6 +68,16 @@ prepare() {
# fix dkms build
patch -d "${pkgname}-${pkgver}/VirtualBox-extracted" -Np1 -i "${srcdir}/013-Makefile.patch"
+
+ # linux 5.6 fix
+ patch -d "${pkgname}-${pkgver}/VirtualBox-extracted" -Np1 -i "${srcdir}/015-linux-5.6.patch"
+}
+
+build() {
+ local _installdir='opt/VirtualBox'
+
+ cd "${pkgname}-${pkgver}/sdk/installer"
+ VBOX_INSTALL_PATH="/${_installdir}" python vboxapisetup.py build
}
package() {
@@ -87,7 +99,7 @@ package() {
printf '%s\n' ' -> Installing SDK...'
cd "${srcdir}/${pkgname}-${pkgver}"
pushd 'sdk/installer' >/dev/null
- VBOX_INSTALL_PATH="/${_installdir}" python vboxapisetup.py install --root "$pkgdir"
+ VBOX_INSTALL_PATH="/${_installdir}" python vboxapisetup.py install --root "$pkgdir" --skip-build --optimize='1'
popd >/dev/null
rm -r "${pkgdir}/${_installdir}/sdk"
mkdir -p "${pkgdir}/${_installdir}/sdk"