* Check against accidentally mixing kernel versions (e.g. Linux 2.6.25

with AUFS built against Linux 2.6.23).

svn path=/nixpkgs/trunk/; revision=11784
This commit is contained in:
Eelco Dolstra 2008-05-08 15:36:19 +00:00
parent e6028ae5f4
commit fb790c15e9
2 changed files with 28 additions and 39 deletions

View File

@ -1,39 +1,28 @@
args : with args; {stdenv, module_init_tools, modules}:
let localDefs = builderDefs {
addSbinPath = true;
src = "";
buildInputs = [module_init_tools];
configureFlags = [];
} null; /* null is a terminator for sumArgs */
in with localDefs;
let
doCollect = FullDepEntry ('' stdenv.mkDerivation {
ensureDir $out/lib/modules name = "kernel-modules";
cd $out/
for i in $moduleSources; do buildCommand = ''
cp -rfs $i/* . ensureDir $out/lib/modules
chmod -R u+w . cd $out/
done modules="${toString modules}"
rm -rf nix-support for i in $modules; do
cd lib/modules/ cp -rfs $i/* .
rm */modules.* chmod -R u+w .
# linux-* will pass the new kernel version to depmod to take rather than `uname -r` (see man page) v=$(cd $i/lib/modules && ls -d *)
MODULE_DIR=$PWD/ depmod -a $(basename lib/modules/2.*) if test -n "$version" -a "$v" != "$version"; then
cd $out/ echo "kernel version mismatch: $version versus $v (in the module paths $modules)";
'') [minInit addInputs defEnsureDir]; exit 1
in fi
stdenv.mkDerivation rec { version=$v
name = "kernel-modules"; done
inherit moduleSources; echo "kernel version is $version"
builder = writeScript (name + "-builder") rm -rf nix-support
(textClosure localDefs [doCollect doForceShare doPropagate]); cd lib/modules/
meta = { rm */modules.*
description = " # linux-* will pass the new kernel version to depmod to take rather than `uname -r` (see man page)
A directory to hold all the modules, including those MODULE_DIR=$PWD/ ${module_init_tools}/sbin/depmod -a $(basename lib/modules/2.*)
built separately from kernel. Later mentioned directories in cd $out/
moduleSources have higher priority. '';
";
inherit src;
};
} }

View File

@ -4494,9 +4494,9 @@ let pkgs = rec {
inherit fetchurl stdenv; inherit fetchurl stdenv;
}; };
module_aggregation = moduleSources: aggregateModules = modules:
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 builderDefs; inherit stdenv module_init_tools modules;
}; };
modutils = import ../os-specific/linux/modutils { modutils = import ../os-specific/linux/modutils {