* 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 # Urgh, we need the complete kernel sources for some header
# files. So unpack the original kernel source tarball and copy # files. So unpack the original kernel source tarball and copy
# the configured include directory etc. on top of it. # 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} tar xvfj ${kernel.src}
kernelSource=$(echo $(pwd)/linux-*) kernelSource=$(echo $(pwd)/linux-*)
cp -prd $kernelBuild/* $kernelSource cp -prd $kernelBuild/* $kernelSource
@ -26,7 +27,7 @@ stdenv.mkDerivation {
make $makeFlags || true make $makeFlags || true
make $makeFlags make $makeFlags
installFlags=KMISC=$out installFlags=KMISC=$out/lib/modules/$kernelVersion/misc
''; # */ ''; # */
meta = { meta = {

View File

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

View File

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

View File

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