* Aggregator: use cp -s instead of lndir. Only symlink lib/modules.

* NVIDIA / Intel wireless drivers: put modules in
  $out/lib/modules/$kernelVersion so that depmod in the aggregator can
  find them.

svn path=/nixpkgs/trunk/; revision=10128
This commit is contained in:
Eelco Dolstra 2008-01-12 23:35:23 +00:00
parent ef0a521c39
commit b17f0f410c
4 changed files with 13 additions and 13 deletions

View File

@ -17,7 +17,8 @@ stdenv.mkDerivation {
# 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.
kernelBuild=$(echo ${kernel}/lib/modules/2.6.*/source)
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
@ -26,7 +27,7 @@ stdenv.mkDerivation {
make $makeFlags || true
make $makeFlags
installFlags=KMISC=$out
installFlags=KMISC=$out/lib/modules/$kernelVersion/misc
''; # */
meta = {

View File

@ -2,25 +2,25 @@ args : with args;
with builderDefs {
addSbinPath = true;
src = "";
buildInputs = [lndir module_init_tools];
buildInputs = [module_init_tools];
configureFlags = [];
} null; /* null is a terminator for sumArgs */
let
doCollect = FullDepEntry (''
ensureDir $out/
ensureDir $out/lib/modules
cd $out/
for i in $moduleSources; do
lndir $i/
cp -rs $i/lib/modules lib/
chmod -R u+w lib/
done
rm -rf nix-support
cd lib/modules/
rm */modules.*
MODULE_DIR=$PWD/ depmod -a
'') [minInit addInputs defEnsureDir];
in
stdenv.mkDerivation rec {
name = "module-aggregator";
name = "kernel-modules";
inherit moduleSources;
builder = writeScript (name + "-builder")
(textClosure [doCollect doForceShare doPropagate]);

View File

@ -20,7 +20,8 @@ myBuildPhase() {
#patch -p1 < $xenPatch
# Create the module.
sysSrc=$(echo $kernel/lib/modules/2.*/build/)
kernelVersion=$(cd $kernel/lib/modules && ls)
sysSrc=$(echo $kernel/lib/modules/$kernelVersion/build/)
unset src # used by the nv makefile
make SYSSRC=$sysSrc module
cd ../../..
@ -31,8 +32,8 @@ installPhase=myInstallPhase
myInstallPhase() {
# Install the kernel module.
ensureDir $out/lib
cp usr/src/nv/nvidia.ko $out/lib/
ensureDir $out/lib/modules/$kernelVersion/misc
cp usr/src/nv/nvidia.ko $out/lib/modules/$kernelVersion/misc
# Install libGL and friends.
cp -prd usr/lib/* usr/X11R6/lib/libXv* $out/lib/

View File

@ -3453,9 +3453,7 @@ rec {
module_aggregation = moduleSources:
import ../os-specific/linux/module-init-tools/aggregator.nix {
inherit fetchurl stdenv module_init_tools moduleSources
builderDefs;
inherit (xorg) lndir;
inherit fetchurl stdenv module_init_tools moduleSources builderDefs;
};
modutils = import ../os-specific/linux/modutils {