Allow to skip non-existent modules. For custom kernels.

svn path=/nixpkgs/trunk/; revision=11273
This commit is contained in:
Michael Raskin 2008-03-24 19:38:18 +00:00
parent 71d50c6b25
commit 4eaf33cc7a
2 changed files with 3 additions and 2 deletions

View File

@ -3,11 +3,12 @@
# the modules identified by `rootModules', plus their dependencies.
# Also generate an appropriate modules.dep.
{stdenv, kernel, rootModules, module_init_tools}:
{stdenv, kernel, rootModules, module_init_tools, allowMissing ? false}:
stdenv.mkDerivation {
name = kernel.name + "-shrunk";
builder = ./modules-closure.sh;
inherit kernel rootModules module_init_tools;
allowedReferences = ["out"];
allowMissing = if allowMissing then "true" else "";
}

View File

@ -15,7 +15,7 @@ closure=
for module in $rootModules; do
echo "root module: $module"
deps=$(modprobe --config /dev/null --set-version "$version" --show-depends "$module" \
| sed 's/^insmod //')
| sed 's/^insmod //') || if test -z "allowMissing"; then exit 1; fi
#for i in $deps; do echo $i; done
closure="$closure $deps"
done