From 2b99b29136be560b733780565209ea9a8ae09cdf Mon Sep 17 00:00:00 2001 From: Matteo Scarlata Date: Thu, 12 Mar 2020 21:24:46 +0100 Subject: [PATCH] virtualbox: 6.0.14 -> 6.1.4 Update Virtualbox to its latest version. This allows compilation against kernel >= 5.4 to succeed without further patches (see #74260, build would fail for linux-5.5.5 to 5.5.9). --- .../virtualization/virtualbox/default.nix | 25 +------- .../virtualbox/extra_symbols.patch | 21 ++++++ .../virtualbox/guest-additions/default.nix | 64 +------------------ .../virtualization/virtualbox/hardened.patch | 52 +++++++-------- 4 files changed, 53 insertions(+), 109 deletions(-) create mode 100644 pkgs/applications/virtualization/virtualbox/extra_symbols.patch diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix index 6c15b2ea2ced..5d3044bdbc71 100644 --- a/pkgs/applications/virtualization/virtualbox/default.nix +++ b/pkgs/applications/virtualization/virtualbox/default.nix @@ -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 = "036x2mvkk22lbg72cz6pik9z538j1ag6mmwjjmfikgrq1i7v24jy"; - version = "6.0.14"; + main = "59f8f5774473f593e3eb5940e2a337e0674bcd9854164b2578fd43f896260c99"; + version = "6.1.4"; iasl' = iasl.overrideAttrs (old: rec { inherit (old) pname; @@ -89,6 +89,7 @@ in stdenv.mkDerivation { patches = optional enableHardening ./hardened.patch + ++ [ ./extra_symbols.patch ] # When hardening is enabled, we cannot use wrapQtApp to ensure that VirtualBoxVM sees # the correct environment variables needed for Qt to work, specifically QT_PLUGIN_PATH. # This is because VirtualBoxVM would detect that it is wrapped that and refuse to run, @@ -102,26 +103,6 @@ in stdenv.mkDerivation { }) ++ [ ./qtx11extras.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/extra_symbols.patch b/pkgs/applications/virtualization/virtualbox/extra_symbols.patch new file mode 100644 index 000000000000..174bb8d9e70c --- /dev/null +++ b/pkgs/applications/virtualization/virtualbox/extra_symbols.patch @@ -0,0 +1,21 @@ +diff --git a/src/VBox/HostDrivers/linux/Makefile b/src/VBox/HostDrivers/linux/Makefile +index 6e44129b..e68ce128 100644 +--- a/src/VBox/HostDrivers/linux/Makefile ++++ b/src/VBox/HostDrivers/linux/Makefile +@@ -95,13 +95,13 @@ vboxpci: vboxdrv + install: + @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv install + @if [ -d vboxnetflt ]; then \ +- $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetflt install; \ ++ $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) KBUILD_EXTRA_SYMBOLS=$(abspath vboxnetflt/Module.symvers) -C vboxnetflt install; \ + fi + @if [ -d vboxnetadp ]; then \ +- $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp install; \ ++ $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) KBUILD_EXTRA_SYMBOLS=$(abspath vboxnetadp/Module.symvers) -C vboxnetadp install; \ + fi + @if [ -d vboxpci ]; then \ +- $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxpci install; \ ++ $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) KBUILD_EXTRA_SYMBOLS=$(abspath vboxpci/Module.symvers) -C vboxpci install; \ + fi + + else diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix index 690b72f3eeb0..fdb393a94ebe 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, fetchpatch, findutils, patchutils }: +, zlib, xorg, dbus, virtualbox}: let version = virtualbox.version; @@ -26,7 +26,7 @@ in stdenv.mkDerivation rec { src = fetchurl { url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso"; - sha256 = "1c9ysx0fhxxginmp607b4fk74dvlr32n6w52gawm06prf4xg90nb"; + sha256 = "e2846a7576cce1b92a7c0744f41eaac750248d6e31dfca5c45d5766648b394c7"; }; KERN_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; @@ -43,67 +43,9 @@ in stdenv.mkDerivation rec { prePatch = '' substituteInPlace src/vboxguest-${version}/vboxvideo/vbox_ttm.c \ --replace "pszProcName); + AssertLogRelRCReturn(vrc, vrc); +diff --git a/src/VBox/Main/src-all/MachineLaunchVMCommonWorker.cpp b/src/VBox/Main/src-all/MachineLaunchVMCommonWorker.cpp +index 2991d3a7..d042a08b 100644 +--- a/src/VBox/Main/src-all/MachineLaunchVMCommonWorker.cpp ++++ b/src/VBox/Main/src-all/MachineLaunchVMCommonWorker.cpp +@@ -90,7 +90,7 @@ int MachineLaunchVMCommonWorker(const Utf8Str &aNameOrId, + + /* Get the path to the executable directory w/ trailing slash: */ + char szPath[RTPATH_MAX]; +- int vrc = RTPathAppPrivateArch(szPath, sizeof(szPath)); ++ int vrc = RTStrCopy(szPath, sizeof(szPath) - 1, "/run/wrappers/bin"); + AssertRCReturn(vrc, vrc); + size_t cbBufLeft = RTPathEnsureTrailingSeparator(szPath, sizeof(szPath)); + AssertReturn(cbBufLeft > 0, VERR_FILENAME_TOO_LONG);