kmod: enable on darwin
This is needed to build linux kernels on darwin. While we can’t actually use it to load kernel modules, we can use it to create indexes of modules on macOS. (cherry picked from commit ebb31480e8a45efbaff4c4a212bdfc0b053adde0)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{ stdenv, buildPackages, lib, fetchurl, autoreconfHook, pkgconfig, libxslt, xz }:
|
||||
{ stdenv, buildPackages, lib, fetchurl, autoreconfHook, pkgconfig
|
||||
, libxslt, xz, elf-header }:
|
||||
|
||||
let
|
||||
systems = [ "/run/current-system/kernel-modules" "/run/booted-system/kernel-modules" "" ];
|
||||
@@ -14,7 +15,7 @@ in stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook pkgconfig libxslt ];
|
||||
buildInputs = [ xz ];
|
||||
buildInputs = [ xz elf-header ];
|
||||
|
||||
configureFlags = [
|
||||
"--sysconfdir=/etc"
|
||||
@@ -22,7 +23,8 @@ in stdenv.mkDerivation rec {
|
||||
"--with-modulesdirs=${modulesDirs}"
|
||||
];
|
||||
|
||||
patches = [ ./module-dir.patch ];
|
||||
patches = [ ./module-dir.patch ]
|
||||
++ lib.optional stdenv.isDarwin ./darwin.patch;
|
||||
|
||||
postInstall = ''
|
||||
for prog in rmmod insmod lsmod modinfo modprobe depmod; do
|
||||
@@ -37,6 +39,6 @@ in stdenv.mkDerivation rec {
|
||||
homepage = https://www.kernel.org/pub/linux/utils/kernel/kmod/;
|
||||
description = "Tools for loading and managing Linux kernel modules";
|
||||
license = licenses.lgpl21;
|
||||
platforms = platforms.linux;
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user