git.iko.soy/typeable/nixpkgs
on master help sign in
virtualbox: 5.2.28 -> 6.0.6

Quite some fixing was needed to get this to work. Changes in VirtualBox and additions: - VirtualBox is no longer officially supported on 32-bit hosts so i686-linux is removed from platforms for VirtualBox and the extension pack. 32-bit additions still work. - There was a refactoring of kernel module makefiles and two resulting bugs affected us which had to be patched. These bugs were reported to the bug tracker (see comments near patches). - The Qt5X11Extras makefile patch broke. Fixed it to apply again, making the libraries logic simpler and more correct (it just uses a different base path instead of always linking to Qt5X11Extras). - Added a patch to remove "test1" and "test2" kernel messages due to forgotten debugging code. - virtualbox-host NixOS module: the VirtualBoxVM executable should be setuid not VirtualBox. This matches how the official installer sets it up. - Additions: replaced a for loop for installing kernel modules with just a "make install", which seems to work without any of the things done in the previous code. - Additions: The package defined buildCommand which resulted in phases not running, including RUNPATH stripping in fixupPhase, and installPhase was defined which was not even run. Fixed this by refactoring using phases. Had to set dontStrip otherwise binaries were broken by stripping. The libdbus path had to be added later in fixupPhase because it is used via dlopen not directly linked. - Additions: Added zlib and libc to patchelf, otherwise runtime library errors result from some binaries. For some reason the missing libc only manifested itself for mount.vboxsf when included in the initrd. Changes in nixos/tests/virtualbox: - Update the simple-gui test to send the right keys to start the VM. With VirtualBox 5 it was enough to just send "return", but with 6 the Tools thing may be selected by default. Send "home" to reliably select Tools, "down" to move to the VM and "return" to start it. - Disable the VirtualBox UART by default because it causes a crash due to a regression in VirtualBox (specific to software virtualization and serial port usage). It can still be enabled using an option but there is an assert that KVM nested virtualization is enabled, which works around the problem (see below). - Add an option to enable nested KVM virtualization, allowing VirtualBox to use hardware virtualization. This works around the UART problem and also allows using 64-bit guests, but requires a kernel module parameter. - Add an option to run 64-bit guests. Tested that the tests pass with that. As mentioned this requires KVM nested virtualization.

commit5bec9dc65b46eeb45a63a9f7875b5ddfbb798d10 authorAmbroz Bizjak <abizjak.pro@gmail.com> dateSat 4 May 2019, 16:18 (8 years ago) parent48a65ef
14 files changed+146−275
nixos/modules/virtualisation/virtualbox-host.nix+1−1 nixos/tests/virtualbox.nix+34−8 pkgs/applications/virtualization/virtualbox/default.nix+10−9 pkgs/applications/virtualization/virtualbox/extpack.nix+3−3 pkgs/applications/virtualization/virtualbox/fix_kbuild.patch+12 pkgs/applications/virtualization/virtualbox/fix_module_makefile_sed.patch+36 pkgs/applications/virtualization/virtualbox/fix_printk_test.patch+14 pkgs/applications/virtualization/virtualbox/guest-additions/default.nix+34−48 pkgs/applications/virtualization/virtualbox/guest-additions/fix_kerndir.patch−38 pkgs/applications/virtualization/virtualbox/guest-additions/fix_kernincl.patch−12 pkgs/applications/virtualization/virtualbox/qtx11extras.patch+2−17 pkgs/os-specific/linux/virtualbox/default.nix−6 pkgs/os-specific/linux/virtualbox/fix_kbuild.patch−85 pkgs/os-specific/linux/virtualbox/fix_kerndir.patch−48
nixos/modules/virtualisation/virtualbox-host.nix+1−1
@@ -104,7 +104,7 @@ in
104104 "VBoxNetNAT"
105105 "VBoxSDL"
106106 "VBoxVolInfo"
107− "VirtualBox"
107+ "VirtualBoxVM"
108108 ]));
109109
110110 users.groups.vboxusers.gid = config.ids.gids.vboxusers;
nixos/tests/virtualbox.nix+34−8
@@ -2,9 +2,26 @@
22 config ? {},
33 pkgs ? import ../.. { inherit system config; },
44 debug ? false,
5− enableUnfree ? false
5+ enableUnfree ? false,
6+ # Nested KVM virtualization (https://www.linux-kvm.org/page/Nested_Guests)
7+ # requires a modprobe flag on the build machine: (kvm-amd for AMD CPUs)
8+ # boot.extraModprobeConfig = "options kvm-intel nested=Y";
9+ # Without this VirtualBox will use SW virtualization and will only be able
10+ # to run 32-bit guests.
11+ useKvmNestedVirt ? false,
12+ # Whether to run 64-bit guests instead of 32-bit. Requires nested KVM.
13+ use64bitGuest ? false,
14+ # Whether to enable the virtual UART in VirtualBox guests, allowing to see
15+ # the guest console. There is currently a bug in VirtualBox where this will
16+ # cause a crash if running with SW virtualization
17+ # (https://www.virtualbox.org/ticket/18632). If you need to debug the tests
18+ # then enable this and nested KVM to work around the crash (see above).
19+ enableVBoxUART ? false
620}:
721
22+assert use64bitGuest -> useKvmNestedVirt;
23+assert enableVBoxUART -> useKvmNestedVirt; # VirtualBox bug, see above
24+
825with import ../lib/testing.nix { inherit system pkgs; };
926with pkgs.lib;
1027
@@ -94,7 +111,7 @@ let
94111
95112 testVM = vmName: vmScript: let
96113 cfg = (import ../lib/eval-config.nix {
97− system = "i686-linux";
114+ system = if use64bitGuest then "x86_64-linux" else "i686-linux";
98115 modules = [
99116 ../modules/profiles/minimal.nix
100117 (testVMConfig vmName vmScript)
@@ -141,13 +158,15 @@ let
141158 sharePath = "/home/alice/vboxshare-${name}";
142159
143160 createFlags = mkFlags [
144− "--ostype Linux26"
161+ "--ostype ${if use64bitGuest then "Linux26_64" else "Linux26"}"
145162 "--register"
146163 ];
147164
148− vmFlags = mkFlags ([
149− "--uart1 0x3F8 4"
150− "--uartmode1 client /run/virtualbox-log-${name}.sock"
165+ vmFlags = mkFlags (
166+ (optionals enableVBoxUART [
167+ "--uart1 0x3F8 4"
168+ "--uartmode1 client /run/virtualbox-log-${name}.sock"
169+ ]) ++ [
151170 "--memory 768"
152171 "--audio none"
153172 ] ++ (attrs.vmFlags or []));
@@ -180,7 +199,7 @@ let
180199 ];
181200 in {
182201 machine = {
183− systemd.sockets."vboxtestlog-${name}" = {
202+ systemd.sockets."vboxtestlog-${name}" = mkIf enableVBoxUART {
184203 description = "VirtualBox Test Machine Log Socket For ${name}";
185204 wantedBy = [ "sockets.target" ];
186205 before = [ "multi-user.target" ];
@@ -188,7 +207,7 @@ let
188207 socketConfig.Accept = true;
189208 };
190209
191− systemd.services."vboxtestlog-${name}@" = {
210+ systemd.services."vboxtestlog-${name}@" = mkIf enableVBoxUART {
192211 description = "VirtualBox Test Machine Log For ${name}";
193212 serviceConfig.StandardInput = "socket";
194213 serviceConfig.StandardOutput = "syslog";
@@ -346,6 +365,8 @@ let
346365 vmConfigs = mapAttrsToList mkVMConf vms;
347366 in [ ./common/user-account.nix ./common/x11.nix ] ++ vmConfigs;
348367 virtualisation.memorySize = 2048;
368+ virtualisation.qemu.options =
369+ if useKvmNestedVirt then ["-cpu" "kvm64,vmx=on"] else [];
349370 virtualisation.virtualbox.host.enable = true;
350371 services.xserver.displayManager.auto.user = "alice";
351372 users.users.alice.extraGroups = let
@@ -412,9 +433,14 @@ in mapAttrs (mkVBoxTest false vboxVMs) {
412433 );
413434 $machine->sleep(5);
414435 $machine->screenshot("gui_manager_started");
436+ # Home to select Tools, down to move to the VM, enter to start it.
437+ $machine->sendKeys("home");
438+ $machine->sendKeys("down");
415439 $machine->sendKeys("ret");
416440 $machine->screenshot("gui_manager_sent_startup");
417441 waitForStartup_simple (sub {
442+ $machine->sendKeys("home");
443+ $machine->sendKeys("down");
418444 $machine->sendKeys("ret");
419445 });
420446 $machine->screenshot("gui_started");
pkgs/applications/virtualization/virtualbox/default.nix+10−9
@@ -1,4 +1,4 @@
1−{ config, stdenv, fetchurl, lib, fetchpatch, iasl, dev86, pam, libxslt, libxml2
1+{ config, stdenv, fetchurl, lib, iasl, dev86, pam, libxslt, libxml2
22, libX11, xorgproto, libXext, libXcursor, libXmu, qt5, libIDL, SDL, libcap
33, libpng, glib, lvm2, libXrandr, libXinerama, libopus
44, pkgconfig, which, docbook_xsl, docbook_xml_dtd_43
@@ -21,8 +21,8 @@ let
2121 buildType = "release";
2222 # Remember to change the extpackRev and version in extpack.nix and
2323 # guest-additions/default.nix as well.
24− main = "0jmrbyhs92lyarpvylxqn2ajxdg9b290w5nd4g0i4h83d28bwbw0";
25− version = "5.2.28";
24+ main = "0lp584a350ya1zn03lhgmdbi91yp8yfja9hlg2jz1xyfj2dc869l";
25+ version = "6.0.6";
2626in stdenv.mkDerivation {
2727 name = "virtualbox-${version}";
2828
@@ -76,11 +76,12 @@ in stdenv.mkDerivation {
7676 optional enableHardening ./hardened.patch
7777 ++ [
7878 ./qtx11extras.patch
79− (fetchpatch {
80− name = "010-qt-5.11.patch";
81− url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/010-qt-5.11.patch?h=packages/virtualbox";
82− sha256 = "0hjx99pg40wqyggnrpylrp5zngva4xrnk7r90i0ynrqc7n84g9pn";
83− })
79+ # https://www.virtualbox.org/ticket/18620
80+ ./fix_kbuild.patch
81+ # https://www.virtualbox.org/ticket/18621
82+ ./fix_module_makefile_sed.patch
83+ # https://forums.virtualbox.org/viewtopic.php?f=7&t=92815
84+ ./fix_printk_test.patch
8485 ];
8586
8687 postPatch = ''
@@ -192,6 +193,6 @@ in stdenv.mkDerivation {
192193 license = licenses.gpl2;
193194 homepage = https://www.virtualbox.org/;
194195 maintainers = with maintainers; [ flokli sander ];
195− platforms = [ "x86_64-linux" "i686-linux" ];
196+ platforms = [ "x86_64-linux" ];
196197 };
197198}
pkgs/applications/virtualization/virtualbox/extpack.nix+3−3
@@ -2,7 +2,7 @@
22
33with lib;
44
5−let version = "5.2.28";
5+let version = "6.0.6";
66in
77fetchurl rec {
88 name = "Oracle_VM_VirtualBox_Extension_Pack-${version}.vbox-extpack";
@@ -10,7 +10,7 @@ fetchurl rec {
1010 sha256 =
1111 # Manually sha256sum the extensionPack file, must be hex!
1212 # Thus do not use `nix-prefetch-url` but instead plain old `sha256sum`.
13− let value = "376e07cbf2ff2844c95c800346c8e4697d7bc671ae0e21e46153b2e7b4ccc1d6";
13+ let value = "794f023a186bd217c29c3d30bd1434b6e9de3b242c7bf740d06d10f2d3d981c6";
1414 in assert (builtins.stringLength value) == 64; value;
1515
1616 meta = {
@@ -18,6 +18,6 @@ fetchurl rec {
1818 license = licenses.virtualbox-puel;
1919 homepage = https://www.virtualbox.org/;
2020 maintainers = with maintainers; [ flokli sander cdepillabout ];
21− platforms = [ "x86_64-linux" "i686-linux" ];
21+ platforms = [ "x86_64-linux" ];
2222 };
2323}
pkgs/applications/virtualization/virtualbox/fix_kbuild.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -urN a/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile b/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile
2+--- a/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile
3++++ b/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile
4+@@ -58,7 +58,7 @@
5+ RT_WITH_VBOX \
6+ VBOX_WITH_HARDENING \
7+ VBOX_WITH_64_BITS_GUESTS # <-- must be consistent with Config.kmk!
8+-VBOXMOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie -Wno-declaration-after-statement
9++VBOXMOD_CFLAGS = -include $(VBOXNETADPT_DIR)include/VBox/SUPDrvMangling.h -fno-pie -Wno-declaration-after-statement
10+
11+ include $(obj)/Makefile-footer.gmk
12+
pkgs/applications/virtualization/virtualbox/fix_module_makefile_sed.patchnew file+36
@@ -0,0 +1,36 @@
1+diff -urN VirtualBox-6.0.6/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk VirtualBox-6.0.6.new/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk
2+--- VirtualBox-6.0.6/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk 2019-04-16 12:16:38.000000000 +0200
3++++ VirtualBox-6.0.6.new/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk 2019-05-04 15:19:14.545497602 +0200
4+@@ -175,7 +175,7 @@
5+ | $$(dir $$@)
6+ $(QUIET)$(RM) -f -- $@
7+ ifndef VBOX_WITH_HARDENING
8+- $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
9++ $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $<
10+ else
11+ $(QUIET)$(CP) -f $< $@
12+ endif
13+diff -urN VirtualBox-6.0.6/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk VirtualBox-6.0.6.new/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk
14+--- VirtualBox-6.0.6/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk 2019-04-16 12:16:39.000000000 +0200
15++++ VirtualBox-6.0.6.new/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk 2019-05-04 15:19:13.809493324 +0200
16+@@ -525,7 +525,7 @@
17+ | $$(dir $$@)
18+ $(QUIET)$(RM) -f -- $@
19+ ifndef VBOX_WITH_HARDENING
20+- $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
21++ $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $<
22+ else
23+ $(QUIET)$(CP) -f $< $@
24+ endif
25+diff -urN VirtualBox-6.0.6/src/VBox/HostDrivers/VBoxPci/Makefile.kmk VirtualBox-6.0.6.new/src/VBox/HostDrivers/VBoxPci/Makefile.kmk
26+--- VirtualBox-6.0.6/src/VBox/HostDrivers/VBoxPci/Makefile.kmk 2019-04-16 12:16:40.000000000 +0200
27++++ VirtualBox-6.0.6.new/src/VBox/HostDrivers/VBoxPci/Makefile.kmk 2019-05-04 15:42:12.029664987 +0200
28+@@ -67,7 +67,7 @@
29+ | $$(dir $$@)
30+ $(QUIET)$(RM) -f -- $@
31+ ifndef VBOX_WITH_HARDENING
32+- $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
33++ $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $<
34+ else
35+ $(QUIET)$(CP) -f $< $@
36+ endif
pkgs/applications/virtualization/virtualbox/fix_printk_test.patchnew file+14
@@ -0,0 +1,14 @@
1+diff -urN VirtualBox-6.0.6/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c VirtualBox-6.0.6.new/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
2+--- VirtualBox-6.0.6/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c 2019-04-16 12:16:37.000000000 +0200
3++++ VirtualBox-6.0.6.new/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c 2019-05-04 15:59:44.439905223 +0200
4+@@ -426,10 +426,8 @@
5+ int rc;
6+ PSUPDRVSESSION pSession;
7+ Log(("VBoxDrvLinuxCreate: pFilp=%p pid=%d/%d %s\n", pFilp, RTProcSelf(), current->pid, current->comm));
8+- printk("test1\n");
9+
10+ #ifdef VBOX_WITH_HARDENING
11+- printk("test2\n");
12+ /*
13+ * Only root is allowed to access the unrestricted device, enforce it!
14+ */
pkgs/applications/virtualization/virtualbox/guest-additions/default.nix+34−48
@@ -1,5 +1,5 @@
11{ stdenv, fetchurl, lib, patchelf, cdrkit, kernel, which, makeWrapper
2−, xorg, dbus, virtualbox }:
2+, zlib, xorg, dbus, virtualbox }:
33
44let
55 version = virtualbox.version;
@@ -19,32 +19,23 @@ stdenv.mkDerivation {
1919
2020 src = fetchurl {
2121 url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
22− sha256 = "0cwdmdgcd1jysyw7c9b3cdk1ngk5nq7slh1zkhxkvvq142cnm1v9";
22+ sha256 = "1srcsf9264l5yxbq2x83z66j38blbfrywq5lkzwb5kih6sv548c3";
2323 };
2424
2525 KERN_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
2626 KERN_INCL = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/source/include";
2727
28− patchFlags = [ "-p1" "-d" "install/src/vboxguest-${version}" ];
29−
30− patches = [
31− ./fix_kerndir.patch
32− ./fix_kernincl.patch
33− ];
28+ # If you add a patch you probably need this.
29+ #patchFlags = [ "-p1" "-d" "install/src/vboxguest-${version}" ];
3430
3531 hardeningDisable = [ "pic" ];
3632
3733 NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types -Wno-error=implicit-function-declaration";
3834
3935 nativeBuildInputs = [ patchelf makeWrapper ];
40− buildInputs = [ cdrkit dbus ] ++ kernel.moduleBuildDependencies;
36+ buildInputs = [ cdrkit ] ++ kernel.moduleBuildDependencies;
4137
42− installPhase = ''
43− mkdir -p $out
44− cp -r install/* $out
45− '';
46−
47− buildCommand = with xorg; ''
38+ unpackPhase = ''
4839 ${if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then ''
4940 isoinfo -J -i $src -x /VBoxLinuxAdditions.run > ./VBoxLinuxAdditions.run
5041 chmod 755 ./VBoxLinuxAdditions.run
@@ -63,39 +54,30 @@ stdenv.mkDerivation {
6354 ''
6455 else throw ("Architecture: "+stdenv.hostPlatform.system+" not supported for VirtualBox guest additions")
6556 }
57+ '';
6658
67− cd ../
68− patchPhase
69− cd install/src
70−
71− # Build kernel modules
72− export INSTALL_MOD_PATH=$out
59+ doConfigure = false;
7360
61+ buildPhase = ''
62+ # Build kernel modules.
63+ cd src
7464 find . -type f | xargs sed 's/depmod -a/true/' -i
75−
7665 cd vboxguest-${version}
77−
66+ # Run just make first. If we only did make install, we get symbol warnings during build.
7867 make
79−
8068 cd ../..
8169
8270 # Change the interpreter for various binaries
83− for i in sbin/VBoxService bin/{VBoxClient,VBoxControl} other/mount.vboxsf
84− do
85− ${if stdenv.hostPlatform.system == "i686-linux" then ''
86− patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $i
87− ''
88− else if stdenv.hostPlatform.system == "x86_64-linux" then ''
89− patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux-x86-64.so.2 $i
90− ''
91− else throw ("Architecture: "+stdenv.hostPlatform.system+" not supported for VirtualBox guest additions")
92− }
93− patchelf --set-rpath ${lib.makeLibraryPath [ stdenv.cc.cc dbus libX11 libXt libXext libXmu libXfixes libXrandr libXcursor ]} $i
71+ for i in sbin/VBoxService bin/{VBoxClient,VBoxControl} other/mount.vboxsf; do
72+ patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} $i
73+ patchelf --set-rpath ${lib.makeLibraryPath [ stdenv.cc.cc stdenv.cc.libc zlib
74+ xorg.libX11 xorg.libXt xorg.libXext xorg.libXmu xorg.libXfixes xorg.libXrandr xorg.libXcursor ]} $i
9475 done
9576
9677 for i in lib/VBoxOGL*.so
9778 do
98− patchelf --set-rpath ${lib.makeLibraryPath [ "$out" dbus libXcomposite libXdamage libXext libXfixes ]} $i
79+ patchelf --set-rpath ${lib.makeLibraryPath [ "$out"
80+ xorg.libXcomposite xorg.libXdamage xorg.libXext xorg.libXfixes ]} $i
9981 done
10082
10183 # FIXME: Virtualbox 4.3.22 moved VBoxClient-all (required by Guest Additions
@@ -105,6 +87,13 @@ stdenv.mkDerivation {
10587 # Remove references to /usr from various scripts and files
10688 sed -i -e "s|/usr/bin|$out/bin|" other/vboxclient.desktop
10789 sed -i -e "s|/usr/bin|$out/bin|" bin/VBoxClient-all
90+ '';
91+
92+ installPhase = ''
93+ # Install kernel modules.
94+ cd src/vboxguest-${version}
95+ make install INSTALL_MOD_PATH=$out
96+ cd ../..
10897
10998 # Install binaries
11099 install -D -m 755 other/mount.vboxsf $out/bin/mount.vboxsf
@@ -131,21 +120,18 @@ stdenv.mkDerivation {
131120 # Install Xorg drivers
132121 mkdir -p $out/lib/xorg/modules/{drivers,input}
133122 install -m 644 other/vboxvideo_drv_${xserverABI}.so $out/lib/xorg/modules/drivers/vboxvideo_drv.so
123+ '';
134124
135− # Install kernel modules
136− cd src
125+ # Stripping breaks these binaries for some reason.
126+ dontStrip = true;
137127
138− for i in *
139− do
140− cd $i
141− kernelVersion=$(cd ${kernel.dev}/lib/modules; ls)
142− export MODULE_DIR=$out/lib/modules/$kernelVersion/misc
143− find . -type f | xargs sed -i -e "s|-o root||g" \
144− -e "s|-g root||g"
145− make install
146− cd ..
128+ # Some code dlopen() libdbus, patch RUNPATH in fixupPhase so it isn't stripped.
129+ postFixup = ''
130+ for i in $(grep -F libdbus-1.so -l -r $out/{lib,bin}); do
131+ origRpath=$(patchelf --print-rpath "$i")
132+ patchelf --set-rpath "$origRpath:${lib.makeLibraryPath [ dbus ]}" "$i"
147133 done
148− ''; # */
134+ '';
149135
150136 meta = {
151137 description = "Guest additions for VirtualBox";
pkgs/applications/virtualization/virtualbox/guest-additions/fix_kerndir.patchdeleted−38
@@ -1,38 +0,0 @@
1−diff --git a/vboxsf/Makefile.include.header b/vboxsf/Makefile.include.header
2−index 8df1eb4d25..5a3e5604e7 100644
3−--- a/vboxsf/Makefile.include.header
4−+++ b/vboxsf/Makefile.include.header
5−@@ -117,7 +117,6 @@ else # neq($(KERNELRELEASE),)
6− endif # neq($(KERNELRELEASE),)
7−
8− # Kernel build folder
9−-KERN_DIR := /lib/modules/$(KERN_VER)/build
10− ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
11− $(error Error: unable to find the headers of the Linux kernel to build against. \
12− Specify KERN_VER=<version> and run Make again)
13−
14−diff --git a/vboxguest/Makefile.include.header b/vboxguest/Makefile.include.header
15−index 8df1eb4d25..5a3e5604e7 100644
16−--- a/vboxguest/Makefile.include.header
17−+++ b/vboxguest/Makefile.include.header
18−@@ -117,7 +117,6 @@ else # neq($(KERNELRELEASE),)
19− endif # neq($(KERNELRELEASE),)
20−
21− # Kernel build folder
22−-KERN_DIR := /lib/modules/$(KERN_VER)/build
23− ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
24− $(error Error: unable to find the headers of the Linux kernel to build against. \
25− Specify KERN_VER=<version> and run Make again)
26−
27−diff --git a/vboxvideo/Makefile.include.header b/vboxvideo/Makefile.include.header
28−index 8df1eb4d25..5a3e5604e7 100644
29−--- a/vboxvideo/Makefile.include.header
30−+++ b/vboxvideo/Makefile.include.header
31−@@ -117,7 +117,6 @@ else # neq($(KERNELRELEASE),)
32− endif # neq($(KERNELRELEASE),)
33−
34− # Kernel build folder
35−-KERN_DIR := /lib/modules/$(KERN_VER)/build
36− ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
37− $(error Error: unable to find the headers of the Linux kernel to build against. \
38− Specify KERN_VER=<version> and run Make again)
pkgs/applications/virtualization/virtualbox/guest-additions/fix_kernincl.patchdeleted−12
@@ -1,12 +0,0 @@
1−diff --git a/vboxvideo/Makefile.include.header b/vboxvideo/Makefile.include.header
2−index 8df1eb4d25..5a3e5604e7 100644
3−--- a/vboxvideo/Makefile.include.header
4−+++ b/vboxvideo/Makefile.include.header
5−@@ -122,7 +122,6 @@ ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
6− Specify KERN_VER=<version> and run Make again)
7− endif
8− # Kernel include folder
9−-KERN_INCL := $(KERN_DIR)/include
10− # module install folder
11− INSTALL_MOD_DIR ?= misc
12− MODULE_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KERN_VER)/$(INSTALL_MOD_DIR)
pkgs/applications/virtualization/virtualbox/qtx11extras.patch+2−17
@@ -2,30 +2,15 @@ diff --git a/kBuild/units/qt5.kmk b/kBuild/units/qt5.kmk
22index 71b96a3..73391f0 100644
33--- a/kBuild/units/qt5.kmk
44+++ b/kBuild/units/qt5.kmk
5−@@ -1019,9 +1019,10 @@ else
5+@@ -1054,9 +1054,9 @@ else
66 $(eval $(target)_LIBS += $(PATH_SDK_QT5_LIB)/$(qt_prefix)qtmain$(qt_infix)$(SUFF_LIB) )
77 endif
88 else
99- $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(PATH_SDK_QT5_LIB)/lib$(qt_prefix)Qt5$(module)$(qt_infix)$(SUFF_DLL)) )
10−+ $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(PATH_SDK_QT5_LIB)/lib$(qt_prefix)Qt5$(module)$(qt_infix)$(SUFF_DLL)) \
11−+ $(PATH_QT5_X11_EXTRAS_LIB)/lib$(qt_prefix)Qt5X11Extras$(qt_infix)$(SUFF_DLL))
10++ $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(if $(filter X11Extras,$(module)),$(PATH_QT5_X11_EXTRAS_LIB),$(PATH_SDK_QT5_LIB))/lib$(qt_prefix)Qt5$(module)$(qt_infix)$(SUFF_DLL)) )
1211 endif
1312- $(eval $(target)_INCS += $(addprefix $(PATH_SDK_QT5_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT5_INC) )
1413+ $(eval $(target)_INCS += $(addprefix $(PATH_SDK_QT5_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT5_INC) $(PATH_QT5_X11_EXTRAS_INC)/QtX11Extras )
1514 endif
1615 $(eval $(target)_DEFS += $(foreach module,$(toupper $(qt_modules)), QT_$(module)_LIB) )
1716
18−diff --git a/src/VBox/Frontends/VirtualBox/Makefile.kmk b/src/VBox/Frontends/VirtualBox/Makefile.kmk
19−index 3295bfefe7..796370623c 100644
20−--- a/src/VBox/Frontends/VirtualBox/Makefile.kmk
21−+++ b/src/VBox/Frontends/VirtualBox/Makefile.kmk
22−@@ -916,9 +916,6 @@ endif
23− # The Qt modules we're using.
24− # (The include directory and lib/framework for each module will be added by the Qt unit.)
25− VirtualBox_QT_MODULES = Core Gui Widgets PrintSupport
26−-VirtualBox_QT_MODULES.linux += X11Extras
27−-VirtualBox_QT_MODULES.solaris += X11Extras
28−-VirtualBox_QT_MODULES.freebsd += X11Extras
29− VirtualBox_QT_MODULES.darwin += MacExtras
30− VirtualBox_QT_MODULES.win += WinExtras
31− if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL)
pkgs/os-specific/linux/virtualbox/default.nix−6
@@ -9,13 +9,7 @@ stdenv.mkDerivation {
99
1010 nativeBuildInputs = kernel.moduleBuildDependencies;
1111
12− patches = [
13− ./fix_kerndir.patch
14− ./fix_kbuild.patch
15− ];
16−
1712 KERN_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
18− INCLUDE_BASE = "${virtualbox.modsrc}";
1913
2014 makeFlags = [
2115 "-C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
pkgs/os-specific/linux/virtualbox/fix_kbuild.patchdeleted−85
@@ -1,85 +0,0 @@
1−diff --git a/vboxdrv/Makefile b/vboxdrv/Makefile
2−index e262c61..4af8dac 100644
3−--- a/vboxdrv/Makefile
4−+++ b/vboxdrv/Makefile
5−@@ -131,7 +131,7 @@ ifdef VBOX_WITH_NATIVE_DTRACE
6− MOD_OBJS += SUPDrvDTrace.o
7− endif
8−
9−-MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
10−+MOD_INCL = $(addprefix -I$(INCLUDE_BASE)/$(MOD_NAME),/ /include /r0drv/linux)
11− ifdef VBOX_WITH_NATIVE_DTRACE
12− MOD_INCL += -I/usr/include/linux -I/usr/include
13− endif
14−@@ -157,7 +157,7 @@ ifdef VBOX_WITH_TEXT_MODMEM_HACK
15− endif
16−
17− # build defs
18−-MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h \
19−+MOD_CFLAGS = -include include/VBox/SUPDrvMangling.h \
20− -fno-omit-frame-pointer -fno-pie
21−
22− include $(obj)/Makefile.include.footer
23−diff --git a/vboxnetadp/Makefile b/vboxnetadp/Makefile
24−index e262c61..4af8dac 100644
25−--- a/vboxnetadp/Makefile
26−+++ b/vboxnetadp/Makefile
27−@@ -34,7 +34,7 @@ MOD_OBJS += math/gcc/divdi3.o \
28− math/gcc/umoddi3.o
29− endif
30−
31−-MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
32−+MOD_INCL = $(addprefix -I$(INCLUDE_BASE)/$(MOD_NAME),/ /include /r0drv/linux)
33− MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX \
34− -DRT_WITH_VBOX -DVBOX_WITH_HARDENING \
35− -Wno-declaration-after-statement
36−@@ -59,6 +59,6 @@ ifdef VBOX_USE_INSERT_PAGE
37− endif
38−
39− # build defs
40−-MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie
41−+MOD_CFLAGS = -include include/VBox/SUPDrvMangling.h -fno-pie
42−
43− include $(obj)/Makefile.include.footer
44−diff --git a/vboxnetflt/Makefile b/vboxnetflt/Makefile
45−index e262c61..4af8dac 100644
46−--- a/vboxnetflt/Makefile
47−+++ b/vboxnetflt/Makefile
48−@@ -38,7 +38,7 @@ MOD_OBJS += math/gcc/divdi3.o \
49− math/gcc/umoddi3.o
50− endif
51−
52−-MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
53−+MOD_INCL = $(addprefix -I$(INCLUDE_BASE)/$(MOD_NAME),/ /include /r0drv/linux)
54− MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
55− -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING \
56− -Wno-declaration-after-statement
57−@@ -63,6 +63,6 @@ ifdef VBOX_USE_INSERT_PAGE
58− endif
59−
60− # build defs
61−-MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie
62−+MOD_CFLAGS = -include include/VBox/SUPDrvMangling.h -fno-pie
63−
64− include $(obj)/Makefile.include.footer
65−diff --git a/vboxpci/Makefile b/vboxpci/Makefile
66−index e262c61..4af8dac 100644
67−--- a/vboxpci/Makefile
68−+++ b/vboxpci/Makefile
69−@@ -38,7 +38,7 @@ MOD_OBJS += math/gcc/divdi3.o \
70− math/gcc/umoddi3.o
71− endif
72−
73−-MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
74−+MOD_INCL = $(addprefix -I$(INCLUDE_BASE)/$(MOD_NAME),/ /include /r0drv/linux)
75− MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX \
76− -DRT_WITH_VBOX -DVBOX_WITH_HARDENING
77− ifeq ($(BUILD_TARGET_ARCH),amd64)
78−@@ -60,6 +60,6 @@ ifdef VBOX_USE_INSERT_PAGE
79− endif
80−
81− # build defs
82−-MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie
83−+MOD_CFLAGS = -include include/VBox/SUPDrvMangling.h -fno-pie
84−
85− include $(obj)/Makefile.include.footer
pkgs/os-specific/linux/virtualbox/fix_kerndir.patchdeleted−48
@@ -1,48 +0,0 @@
1−diff --git a/vboxdrv/Makefile.include.header b/vboxdrv/Makefile.include.header
2−index 8df1eb4d25..5a3e5604e7 100644
3−--- a/vboxdrv/Makefile.include.header
4−+++ b/vboxdrv/Makefile.include.header
5−@@ -117,7 +117,6 @@ else # neq($(KERNELRELEASE),)
6− endif # neq($(KERNELRELEASE),)
7−
8− # Kernel build folder
9−-KERN_DIR := /lib/modules/$(KERN_VER)/build
10− ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
11− $(error Error: unable to find the headers of the Linux kernel to build against. \
12− Specify KERN_VER=<version> and run Make again)
13−diff --git a/vboxnetadp/Makefile.include.header b/vboxnetadp/Makefile.include.header
14−index 8df1eb4d25..5a3e5604e7 100644
15−--- a/vboxnetadp/Makefile.include.header
16−+++ b/vboxnetadp/Makefile.include.header
17−@@ -117,7 +117,6 @@ else # neq($(KERNELRELEASE),)
18− endif # neq($(KERNELRELEASE),)
19−
20− # Kernel build folder
21−-KERN_DIR := /lib/modules/$(KERN_VER)/build
22− ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
23− $(error Error: unable to find the headers of the Linux kernel to build against. \
24− Specify KERN_VER=<version> and run Make again)
25−diff --git a/vboxnetflt/Makefile.include.header b/vboxnetflt/Makefile.include.header
26−index 8df1eb4d25..5a3e5604e7 100644
27−--- a/vboxnetflt/Makefile.include.header
28−+++ b/vboxnetflt/Makefile.include.header
29−@@ -117,7 +117,6 @@ else # neq($(KERNELRELEASE),)
30− endif # neq($(KERNELRELEASE),)
31−
32− # Kernel build folder
33−-KERN_DIR := /lib/modules/$(KERN_VER)/build
34− ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
35− $(error Error: unable to find the headers of the Linux kernel to build against. \
36− Specify KERN_VER=<version> and run Make again)
37−diff --git a/vboxpci/Makefile.include.header b/vboxpci/Makefile.include.header
38−index 8df1eb4d25..5a3e5604e7 100644
39−--- a/vboxpci/Makefile.include.header
40−+++ b/vboxpci/Makefile.include.header
41−@@ -117,7 +117,6 @@ else # neq($(KERNELRELEASE),)
42− endif # neq($(KERNELRELEASE),)
43−
44− # Kernel build folder
45−-KERN_DIR := /lib/modules/$(KERN_VER)/build
46− ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
47− $(error Error: unable to find the headers of the Linux kernel to build against. \
48− Specify KERN_VER=<version> and run Make again)