mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 23:54:01 +00:00
0aea0db581
modules) together in an attribute set returned by the function "kernelPackagesFor" that takes a kernel as argument. For instance, kernelPackages_2_6_23 is the result of calling this function with kernel_2_6_23. This is necessary in NixOS to make it easier to override the kernel: it's not enough to just specify a different kernel (via the boot.kernel option), but you also need matching nvidiaDriver, aufs, iwlwifi, etc. Having a single attribute set that contains all kernel-related packages makes this much easier. * The kernel now has a passthru attribute "features" that allows NixOS expressions to test whether a kernel has certain features. For instance, the externel "iwlwifi" kernel module package should only be built on kernels < 2.6.24, as kernels >= 2.6.24 have iwlwifi support integrated. So the NixOS expressions can do the test "kernel.features ? iwlwifi" to see if the iwlwifi package should be built. Kernel patches can declare additional features. E.g., the fbsplash patch adds a "fbSplash" feature. svn path=/nixpkgs/trunk/; revision=11881
41 lines
1.2 KiB
Nix
41 lines
1.2 KiB
Nix
{stdenv, fetchurl, kernel}:
|
|
|
|
let version = "1.2.25"; in
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "iwlwifi-${version}-${kernel.version}";
|
|
|
|
src = fetchurl {
|
|
url = "http://www.intellinuxwireless.org/iwlwifi/downloads/iwlwifi-${version}.tgz";
|
|
sha256 = "09fjy0swcyd77fdp8x2825wj5cd73hwbzl8mz9sy2ha21p1qwq1d";
|
|
};
|
|
|
|
preBuild = ''
|
|
substituteInPlace scripts/generate_compatible \
|
|
--replace '/usr/bin/env /bin/bash' $shell
|
|
substituteInPlace Makefile \
|
|
--replace /sbin/depmod true
|
|
|
|
# Urgh, we need the complete kernel sources for some header
|
|
# files. So unpack the original kernel source tarball and copy
|
|
# the configured include directory etc. on top of it.
|
|
kernelVersion=$(cd ${kernel}/lib/modules && ls)
|
|
kernelBuild=$(echo ${kernel}/lib/modules/$kernelVersion/source)
|
|
tar xvfj ${kernel.src}
|
|
kernelSource=$(echo $(pwd)/linux-*)
|
|
cp -prd $kernelBuild/* $kernelSource
|
|
|
|
makeFlags=KSRC=$kernelSource
|
|
make $makeFlags || true
|
|
make $makeFlags
|
|
|
|
installFlags=KMISC=$out/lib/modules/$kernelVersion/misc
|
|
''; # */
|
|
|
|
meta = {
|
|
description = "Intel Wireless WiFi Link drivers for Linux";
|
|
homepage = http://www.intellinuxwireless.org/;
|
|
license = "GPLv2";
|
|
};
|
|
}
|