diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix index 13e70c2561d2..6ecdf1d29bc1 100644 --- a/pkgs/applications/virtualization/virtualbox/default.nix +++ b/pkgs/applications/virtualization/virtualbox/default.nix @@ -2,7 +2,7 @@ , libX11, xorgproto, libXext, libXcursor, libXmu, libIDL, SDL, libcap, libGL , libpng, glib, lvm2, libXrandr, libXinerama, libopus, qtbase, qtx11extras , qttools, qtsvg, qtwayland, pkgconfig, which, docbook_xsl, docbook_xml_dtd_43 -, alsaLib, curl, libvpx, nettools, dbus, substituteAll +, alsaLib, curl, libvpx, nettools, dbus, substituteAll, fetchpatch , makeself, perl , javaBindings ? true, jdk ? null # Almost doesn't affect closure size , pythonBindings ? false, python3 ? null @@ -21,8 +21,8 @@ let buildType = "release"; # Remember to change the extpackRev and version in extpack.nix and # guest-additions/default.nix as well. - main = "1hxbvr78b0fddcn7npz72ki89lpmbgqj4b5qvxm1wik7v0d8v1y8"; - version = "6.0.12"; + main = "036x2mvkk22lbg72cz6pik9z538j1ag6mmwjjmfikgrq1i7v24jy"; + version = "6.0.14"; in stdenv.mkDerivation { pname = "virtualbox"; inherit version; @@ -92,9 +92,26 @@ in stdenv.mkDerivation { }) ++ [ ./qtx11extras.patch - # Kernel 5.3 fix, should be fixed with VirtualBox 6.0.14 - # https://www.virtualbox.org/ticket/18911 - ./kernel-5.3-fix.patch + # Kernel 5.4 fix, should be fixed with next upstream release + # https://www.virtualbox.org/ticket/18945 + (fetchpatch { + name = "kernel-5.4-fix-1.patch"; + url = "https://www.virtualbox.org/changeset/81586/vbox?format=diff"; + sha256 = "0zbkc9v65pkdmjik53x29g39qyf7narkhpwpx5n1n1bfqnhf0k1r"; + stripLen = 1; + }) + (fetchpatch { + name = "kernel-5.4-fix-2.patch"; + url = "https://www.virtualbox.org/changeset/81587/vbox?format=diff"; + sha256 = "1j98cqxj8qlqwaqr4mvwwbkmchw8jmygjwgzz82gix7fj76j2y9c"; + stripLen = 1; + }) + (fetchpatch { + name = "kernel-5.4-fix-3.patch"; + url = "https://www.virtualbox.org/changeset/81649/vbox?format=diff"; + sha256 = "1d6p5k5dgzmjglqfkbcbvpn1x3wxila30q4gcbb7pxwfgclaw2hk"; + stripLen = 1; + }) ]; postPatch = '' diff --git a/pkgs/applications/virtualization/virtualbox/extpack.nix b/pkgs/applications/virtualization/virtualbox/extpack.nix index 9357a641de2f..c935a40c5400 100644 --- a/pkgs/applications/virtualization/virtualbox/extpack.nix +++ b/pkgs/applications/virtualization/virtualbox/extpack.nix @@ -2,7 +2,7 @@ with lib; -let version = "6.0.12"; +let version = "6.0.14"; in fetchurl rec { name = "Oracle_VM_VirtualBox_Extension_Pack-${version}.vbox-extpack"; @@ -11,7 +11,7 @@ fetchurl rec { # Manually sha256sum the extensionPack file, must be hex! # Thus do not use `nix-prefetch-url` but instead plain old `sha256sum`. # Checksums can also be found at https://www.virtualbox.org/download/hashes/${version}/SHA256SUMS - let value = "27a0956940654b0accf4d79692078bd496d9f062e4ed3da69e5421cba8d1e444"; + let value = "c8a5cc980c9c94cdac3d94e23cf159c2433aae76b416dbfb5b1a918758f21e63"; in assert (builtins.stringLength value) == 64; value; meta = { diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix index af247af0051e..690b72f3eeb0 100644 --- a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix +++ b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, lib, patchelf, cdrkit, kernel, which, makeWrapper -, zlib, xorg, dbus, virtualbox, dos2unix }: +, zlib, xorg, dbus, virtualbox, dos2unix, fetchpatch, findutils, patchutils }: let version = virtualbox.version; @@ -21,12 +21,12 @@ let { name = "libXfixes.so"; pkg = xorg.libXfixes; } ]; -in stdenv.mkDerivation { +in stdenv.mkDerivation rec { name = "VirtualBox-GuestAdditions-${version}-${kernel.version}"; src = fetchurl { url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso"; - sha256 = "0hflsbx70dli34mpx94vd33p55ycfs3ahzwcdzqxdiwiiskjpykq"; + sha256 = "1c9ysx0fhxxginmp607b4fk74dvlr32n6w52gawm06prf4xg90nb"; }; KERN_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; @@ -43,13 +43,67 @@ in stdenv.mkDerivation { prePatch = '' substituteInPlace src/vboxguest-${version}/vboxvideo/vbox_ttm.c \ --replace " 1) - { - /* Fire the function on all other CPUs without waiting for completion. */ --# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) -+# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0) -+ smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */); -+# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) - int rc = smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */); -+ Assert(!rc); NOREF(rc); - # else - int rc = smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* retry */, 0 /* wait */); --# endif - Assert(!rc); NOREF(rc); -+# endif - } - #endif - -@@ -326,7 +329,6 @@ - { - #ifdef CONFIG_SMP - IPRT_LINUX_SAVE_EFL_AC(); -- int rc; - RTMPARGS Args; - - RTTHREADPREEMPTSTATE PreemptState = RTTHREADPREEMPTSTATE_INITIALIZER; -@@ -337,14 +339,17 @@ - Args.cHits = 0; - - RTThreadPreemptDisable(&PreemptState); --# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) -- rc = smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */); -+# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0) -+ smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */); -+# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) -+ int rc = smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */); -+ Assert(rc == 0); NOREF(rc); - # else /* older kernels */ -- rc = smp_call_function(rtmpLinuxWrapper, &Args, 0 /* retry */, 1 /* wait */); -+ int rc = smp_call_function(rtmpLinuxWrapper, &Args, 0 /* retry */, 1 /* wait */); -+ Assert(rc == 0); NOREF(rc); - # endif /* older kernels */ - RTThreadPreemptRestore(&PreemptState); - -- Assert(rc == 0); NOREF(rc); - IPRT_LINUX_RESTORE_EFL_AC(); - #else - RT_NOREF(pfnWorker, pvUser1, pvUser2); diff --git a/pkgs/applications/virtualization/virtualbox/kernel-5.3-fix.patch b/pkgs/applications/virtualization/virtualbox/kernel-5.3-fix.patch deleted file mode 100644 index ba9c7c941db9..000000000000 --- a/pkgs/applications/virtualization/virtualbox/kernel-5.3-fix.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- a/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c -+++ b/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c -@@ -2123,7 +2123,9 @@ - #endif - if (in_dev != NULL) - { -- for_ifa(in_dev) { -+ struct in_ifaddr *ifa; -+ -+ for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) { - if (VBOX_IPV4_IS_LOOPBACK(ifa->ifa_address)) - return NOTIFY_OK; - -@@ -2137,7 +2139,7 @@ - - pThis->pSwitchPort->pfnNotifyHostAddress(pThis->pSwitchPort, - /* :fAdded */ true, kIntNetAddrType_IPv4, &ifa->ifa_address); -- } endfor_ifa(in_dev); -+ } - } - - /* ---- a/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c -+++ a/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c -@@ -283,12 +283,15 @@ - if (RTCpuSetCount(&OnlineSet) > 1) - { - /* Fire the function on all other CPUs without waiting for completion. */ --# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) -+# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0) -+ smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */); -+# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) - int rc = smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */); -+ Assert(!rc); NOREF(rc); - # else - int rc = smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* retry */, 0 /* wait */); --# endif - Assert(!rc); NOREF(rc); -+# endif - } - #endif - -@@ -326,7 +329,6 @@ - { - #ifdef CONFIG_SMP - IPRT_LINUX_SAVE_EFL_AC(); -- int rc; - RTMPARGS Args; - - RTTHREADPREEMPTSTATE PreemptState = RTTHREADPREEMPTSTATE_INITIALIZER; -@@ -337,14 +339,17 @@ - Args.cHits = 0; - - RTThreadPreemptDisable(&PreemptState); --# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) -- rc = smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */); -+# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0) -+ smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */); -+# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) -+ int rc = smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */); -+ Assert(rc == 0); NOREF(rc); - # else /* older kernels */ -- rc = smp_call_function(rtmpLinuxWrapper, &Args, 0 /* retry */, 1 /* wait */); -+ int rc = smp_call_function(rtmpLinuxWrapper, &Args, 0 /* retry */, 1 /* wait */); -+ Assert(rc == 0); NOREF(rc); - # endif /* older kernels */ - RTThreadPreemptRestore(&PreemptState); - -- Assert(rc == 0); NOREF(rc); - IPRT_LINUX_RESTORE_EFL_AC(); - #else - RT_NOREF(pfnWorker, pvUser1, pvUser2);