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