Although virtualbox has code to download it at runtime, I'd like to have
it included at build time because:
* I like programs that are fully functional even when offline.
* Runtime downloading doesn't work, it results in error message
"During certificate downloading: Unknown reason".
This change increases the closure size 5 % (969 -> 1020 MiB).
Some history:
The linux kernel v5.18-rc contains the commit
> commit 6e8ec2552c7d13991148e551e3325a624d73fac6
> Author: Jason A. Donenfeld <Jason@zx2c4.com>
> Date: 2022-01-16 14:23:10 +0100
>
> random: use computational hash for entropy extraction
> [...]
which modifies the kernels random number generator.
This change broke VirtualBox 6.1.34 in several ways:
It causes random crashes and filesystem corruption in the guest
(at least on some host CPU models).
More details can be found in the
corresponding ticket in the VirtualBox bug tracker:
https://www.virtualbox.org/ticket/20914
That ticket also contains a patch "vbox-linux-5.18.patch"
for VirtualBox that fixes the problem,
at least for kernels 5.18 and (hopefully) above.
This patch got added to nixpkgs' VirtualBox build recipe with
9c8132494f .
Meanwhile, the kernel patch got backported to LTS kernels.
As the VirtualBox patch contains several `#if RTLNX_VER_MIN(5,18,0)`
clauses to apply the fix,
it can't heal VirtualBox on LTS kernel versions.
The result is that VirtualBox is still broken if used
with linux kernels 5.10 and 5.15
(currenly the default kernel in nixpkgs).
Luckily, VirtualBox developers updated the patch
(now named "vbox-linux-5.19.patch") to not only fix the
problem for the upcoming 5.19 kernel, but also address
backport releases.
The commit at hand replaces "vbox-linux-5.18.patch"
with the new "vbox-linux-5.19.patch",
fixing VirtualBox for LTS kernel releases.
The guest additions currently don't build, either before or after this
change, but upgrading is still good because it gets us Linux 5.16
compatibility for the kernel module.
For some reason the original source tarball for version 6.1.14 didn't
bundle the sources for `virtio`-support causing a build-failure.
After this was reported, a new tarball named
`VirtualBox-6.1.14a.tar.bz2` was published which fixes the issue[1].
[1] https://www.virtualbox.org/ticket/19862
VirtualBox ships with "alternative BIOS sources" for its virtual BIOS.
These are generated by first compiling the BIOS C sources with the
Open Watcom toolchain, disassembling the output and checking in the
disassembly into the VirtualBox repo.
The result means that the BIOS C code cannot be patched, because it's
not compiled from the C sources, if Open Watcom is not there.
As Open Watcom is now available in nixpkgs, we can just ignore the
alternative BIOS sources and compile it from C directly.
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).
Newer `iasl`-versions disallow strings within certain declarations[1]
which breaks the virtualbox build as it relies on exactly this
behavior[2].
This should be removed again when updating virtualbox to 6.1.
[1] https://acpica.org/node/172
[2] https://hydra.nixos.org/build/108774352