git.iko.soy/typeable/nixpkgs
on master help sign in
Fix pci_get_bus_and_slot removed in kernel 4.17
commitd25607c79db9fca7f1c8696b792e376b42fb2ecb authorUnknown <iulian.meghea@gmail.com> dateSat 5 May 2018, 11:22 (9 years ago) parentb41ede5
2 files changed+19−3
pkgs/applications/virtualization/virtualbox/default.nix+1−3 pkgs/applications/virtualization/virtualbox/kernpcidev.patch+18
pkgs/applications/virtualization/virtualbox/default.nix+1−3
@@ -94,9 +94,7 @@ in stdenv.mkDerivation {
9494
9595 patches =
9696 optional enableHardening ./hardened.patch
97− ++ [ ./qtx11extras.patch ];
98−
99−
97+ ++ [ ./qtx11extras.patch ./kernpcidev.patch ];
10098
10199 postPatch = ''
102100 sed -i -e 's|/sbin/ifconfig|${nettools}/bin/ifconfig|' \
pkgs/applications/virtualization/virtualbox/kernpcidev.patchnew file+18
@@ -0,0 +1,18 @@
1+diff --git a/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c b/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
2+index b8019f7..b7d2e39 100644
3+--- a/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
4++++ b/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
5+@@ -73,8 +73,11 @@ MODULE_LICENSE("GPL");
6+ MODULE_VERSION(VBOX_VERSION_STRING);
7+ #endif
8+
9+-
10+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
11++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
12++# define PCI_DEV_GET(v,d,p) pci_get_device(v,d,p)
13++# define PCI_DEV_PUT(x) pci_dev_put(x)
14++# define PCI_DEV_GET_SLOT(bus, devfn) pci_get_domain_bus_and_slot(0, bus, devfn)
15++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
16+ # define PCI_DEV_GET(v,d,p) pci_get_device(v,d,p)
17+ # define PCI_DEV_PUT(x) pci_dev_put(x)
18+ # define PCI_DEV_GET_SLOT(bus, devfn) pci_get_bus_and_slot(bus, devfn)