Change:
Describe the bug Virtualbox kernel drivers don't build with latest kernel. To Reproduce Steps to reproduce the behavior: on latest master, channel hasn't updated yet d=(import /home/maciej/Projekte/nix { configuration = {pkgs, ...}: { boot.kernelPackages = pkgs.linuxPackageslatest; = true; }; }).vm Expected behavior Builds Metadata system: host os: multi-user?: sandbox: version: channels(root): channels(maciej): nixpkgs: Maintainer information:
Hi sorry for the duplicate bug report. You may find some useful information in this other issue trackers: Upstream tracker: Related to this issue: [Patch available]
Virtualbox 6.1.6 was released last week, which fixes the Linux 5.6 issues. I opened a PR with a fix for , which needs to be merged into to

Discussion:
let python = python3; buildType = "release"; <del> # Remember to change the extpackRev and version in extpack.nix and # guest-additions/default.nix as well. main = "59f8f5774473f593e3eb5940e2a337e0674bcd9854164b2578fd43f896260c99"; version = "6.1.4"; </del> <ins> # Use maintainers/scripts/update.nix to update the version and all related hashes or # change the hashes in extpack.nix and guest-additions/default.nix as well manually. version = "6.1.6"; </ins> iasl' = iasl.overrideAttrs (old: rec { inherit (old) pname;

src = fetchurl { url = "https://download.virtualbox.org/virtualbox/${version}/VirtualBox-${version}.tar.bz2"; <del> sha256 = main; </del> <ins> sha256 = "b031c30d770f28c5f884071ad933e8c1f83e65b93aaba03a4012077c1d90a54f"; </ins> }; outputs = [ "out" "modsrc" ];

postPatch = '' sed -i -e 's|/sbin/ifconfig|${nettools}/bin/ifconfig|'  src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp <ins> '' + optionalString headless '' # Fix compile error in version 6.1.6 substituteInPlace src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp  --replace PSHCLFORMATDATA PSHCLFORMATS </ins> ''; # first line: ugly hack, and it isn't yet clear why it's a problem

passthru = { inherit version;       # for guest additions inherit extensionPack; # for inclusion in profile to prevent gc <ins> updateScript = ./update.sh; </ins> }; meta = {

# 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 <del> let value = "3b73798d776ff223ea8025b1a45001762f8d4e5bcd1ea61449773c1249935800"; </del> <ins> let value = "80b96b4b51a502141f6a8981f1493ade08a00762622c39e48319e5b122119bf3"; </ins> in assert (builtins.stringLength value) == 64; value; meta = {

src = fetchurl { url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso"; <del> sha256 = "e2846a7576cce1b92a7c0744f41eaac750248d6e31dfca5c45d5766648b394c7"; </del> <ins> sha256 = "bcde4691dea7de93b65a10a43dda2b8f52e570f820992ad281c9bb5c8dede181"; </ins> }; KERN_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";

<del> #!/usr/bin/env nix-shell #!nix-shell -i python3 -p python3 import os import re import json import urllib.request from distutils.version import LooseVersion UPSTREAM_INFO_FILE = os.path.join( os.path.dirname(os.path.abspath(__file__)), "upstream-info.json" ) def fetch_latest_version(): url = "http://download.virtualbox.org/virtualbox/LATEST.TXT" return urllib.request.urlopen(url).read().strip().decode() def load_upstream_info(): try: with open(UPSTREAM_INFO_FILE, 'r') as fp: return json.load(fp) except FileNotFoundError: return {'version': "0"} def save_upstream_info(contents): remark = "Generated using update.py from the same directory." contents['__NOTE'] = remark data = json.dumps(contents, indent=2, sort_keys=True) with open(UPSTREAM_INFO_FILE, 'w') as fp: fp.write(data + "n") def fetch_file_table(version): url = "http://download.virtualbox.org/virtualbox/{}/SHA256SUMS" url = url.format(version) result = {} for line in urllib.request.urlopen(url): sha, name = line.rstrip().split() result[name.lstrip(b'*').decode()] = sha.decode() return result def update_to_version(version): extpack_start = 'Oracle_VM_VirtualBox_Extension_Pack-' version_re = version.replace('.', '.') attribute_map = { 'extpack': r'^' + extpack_start + r'[^-]+-[^.]+.vbox-extpack$', 'extpackRev': r'^' + extpack_start + r'[^-]+-([^.]+).vbox-extpack$', 'main': r'^VirtualBox-' + version_re + r'.tar.bz2$', 'guest': r'^VBoxGuestAdditions_' + version_re + r'.iso$', } table = fetch_file_table(version) new_attrs = {'version': version} for attr, searchexpr in attribute_map.items(): result = [re.search(searchexpr, key) for key in table.keys()] filtered = filter(lambda m: m is not None, result) found = [m.groups()[0] if len(m.groups()) > 0 else table[m.group(0)] for m in filtered if m is not None] if len(found) == 0: msg = "No package found for attribute {}".format(attr) raise AssertionError(msg) elif len(found) != 1: msg = "More than one package found for attribute {}: ".format(attr) msg += ', '.join(found) raise AssertionError(msg) else: new_attrs[attr] = found[0] return new_attrs info = load_upstream_info() latest = fetch_latest_version() if LooseVersion(info['version']) < LooseVersion(latest): print("Updating to version {}...".format(latest), end="", flush=True) new_attrs = update_to_version(latest) save_upstream_info(new_attrs) print(" done.") else: print("Version {} is already the latest one.".format(info['version'])) </del>

<ins> #!/usr/bin/env nix-shell #!nix-shell -i bash -p curl common-updater-scripts nix-prefetch-scripts jq set -xeuo pipefail nixpkgs="$(git rev-parse --show-toplevel)" attr=virtualbox oldVersion="$(nix-instantiate --eval -E "with import $nixpkgs {}; $attr.version or (builtins.parseDrvName $attr.name).version" | tr -d '"')" latestVersion="$(curl -sS https://download.virtualbox.org/virtualbox/LATEST.TXT)" function fileShaSum() { echo "$1" | grep -w $2 | cut -f1 -d' ' } function oldHash() { nix-instantiate --eval --strict -A "$1.drvAttrs.outputHash" | tr -d '"' } function nixFile() { nix-instantiate --eval --strict -A "${1}.meta.position" | sed -re 's/^"(.*):[0-9]+"$/1/' } if [ ! "$oldVersion" = "$latestVersion" ]; then shaSums=$(curl -sS https://download.virtualbox.org/virtualbox/$latestVersion/SHA256SUMS) virtualBoxShaSum=$(fileShaSum "$shaSums" "VirtualBox-$latestVersion.tar.bz2") extpackShaSum=$(fileShaSum "$shaSums" "Oracle_VM_VirtualBox_Extension_Pack-$latestVersion.vbox-extpack") guestAdditionsShaSum=$(fileShaSum "$shaSums" "*VBoxGuestAdditions_$latestVersion.iso") virtualboxNixFile=$(nixFile ${attr}) extpackNixFile=$(nixFile ${attr}Extpack) guestAdditionsNixFile=$(nixFile linuxPackages.${attr}GuestAdditions) extpackOldShaSum=$(oldHash ${attr}Extpack) guestAdditionsOldShaSum=$(oldHash linuxPackages.${attr}GuestAdditions.src) update-source-version $attr $latestVersion $virtualBoxShaSum sed -i -e 's|value = "'$extpackOldShaSum'"|value = "'$extpackShaSum'"|' $extpackNixFile sed -i -e 's|sha256 = "'$guestAdditionsOldShaSum'"|sha256 = "'$guestAdditionsShaSum'"|' $guestAdditionsNixFile git add $virtualboxNixFile $extpackNixFile $guestAdditionsNixFile git commit -m "$attr: ${oldVersion} -> ${latestVersion}" else echo "$attr is already up-to-date" fi </ins>