From b17f0f410c6df3546aa44e1c5ba20bf7ed3ff93f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 12 Jan 2008 23:35:23 +0000 Subject: [PATCH] * 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 --- pkgs/os-specific/linux/iwlwifi/default.nix | 5 +++-- .../os-specific/linux/module-init-tools/aggregator.nix | 10 +++++----- pkgs/os-specific/linux/nvidia/builder.sh | 7 ++++--- pkgs/top-level/all-packages.nix | 4 +--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pkgs/os-specific/linux/iwlwifi/default.nix b/pkgs/os-specific/linux/iwlwifi/default.nix index 9096d71a28ac..8859f7346b51 100644 --- a/pkgs/os-specific/linux/iwlwifi/default.nix +++ b/pkgs/os-specific/linux/iwlwifi/default.nix @@ -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 = { diff --git a/pkgs/os-specific/linux/module-init-tools/aggregator.nix b/pkgs/os-specific/linux/module-init-tools/aggregator.nix index 09866f414e5d..37c072c0d3db 100644 --- a/pkgs/os-specific/linux/module-init-tools/aggregator.nix +++ b/pkgs/os-specific/linux/module-init-tools/aggregator.nix @@ -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]); diff --git a/pkgs/os-specific/linux/nvidia/builder.sh b/pkgs/os-specific/linux/nvidia/builder.sh index 4ef8c551d1c8..00d70d6198f2 100755 --- a/pkgs/os-specific/linux/nvidia/builder.sh +++ b/pkgs/os-specific/linux/nvidia/builder.sh @@ -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/ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 787bf0954ebb..404511cde40d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 {