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
20 lines
482 B
Nix
20 lines
482 B
Nix
{stdenv, klibc}:
|
|
|
|
stdenv.mkDerivation {
|
|
name = "${klibc.name}-shrunk";
|
|
buildCommand = ''
|
|
ensureDir $out/lib
|
|
cp -prd ${klibc}/lib/klibc/bin $out/
|
|
cp -p ${klibc}/lib/*.so $out/lib/
|
|
chmod +w $out/*
|
|
old=$(echo ${klibc}/lib/klibc-*.so)
|
|
new=$(echo $out/lib/klibc-*.so)
|
|
for i in $out/bin/*; do
|
|
echo $i
|
|
sed "s^$old^$new^" -i $i
|
|
# !!! use patchelf
|
|
#patchelf --set-rpath /foo/bar $i
|
|
done
|
|
''; # */
|
|
allowedReferences = ["out"];
|
|
}
|