mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
makeModulesClosure: Use kmod instead of module-init-tools
This commit is contained in:
parent
a9b4851b74
commit
4c77c6e232
@ -4,12 +4,12 @@
|
||||
# Also generate an appropriate modules.dep.
|
||||
|
||||
{ stdenv, kernel, nukeReferences, rootModules
|
||||
, module_init_tools, allowMissing ? false }:
|
||||
, kmod, allowMissing ? false }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = kernel.name + "-shrunk";
|
||||
builder = ./modules-closure.sh;
|
||||
buildInputs = [nukeReferences];
|
||||
inherit kernel rootModules module_init_tools allowMissing;
|
||||
inherit kernel rootModules kmod allowMissing;
|
||||
allowedReferences = ["out"];
|
||||
}
|
||||
|
@ -2,24 +2,20 @@ source $stdenv/setup
|
||||
|
||||
set -o pipefail
|
||||
|
||||
PATH=$module_init_tools/sbin:$PATH
|
||||
PATH=$kmod/sbin:$PATH
|
||||
|
||||
version=$(cd $kernel/lib/modules && ls -d *)
|
||||
|
||||
echo "kernel version is $version"
|
||||
|
||||
export MODULE_DIR=$(readlink -f $kernel/lib/modules/)
|
||||
|
||||
# Determine the dependencies of each root module.
|
||||
closure=
|
||||
for module in $rootModules; do
|
||||
echo "root module: $module"
|
||||
deps=$(modprobe --config /dev/null --set-version "$version" --show-depends "$module" \
|
||||
deps=$(modprobe --config no-config -d $kernel --set-version "$version" --show-depends "$module" \
|
||||
| sed 's/^insmod //') \
|
||||
|| if test -z "$allowMissing"; then exit 1; fi
|
||||
#for i in $deps; do echo $i; done
|
||||
if [[ "$deps" != builtin* ]]
|
||||
then
|
||||
if [[ "$deps" != builtin* ]]; then
|
||||
closure="$closure $deps"
|
||||
fi
|
||||
done
|
||||
@ -41,4 +37,4 @@ for module in $closure; do
|
||||
echo $target >> $out/insmod-list
|
||||
done
|
||||
|
||||
MODULE_DIR=$out/lib/modules/ depmod -a $version
|
||||
depmod -b $out -a $version
|
||||
|
@ -348,10 +348,9 @@ let
|
||||
|
||||
makeWrapper = makeSetupHook { } ../build-support/setup-hooks/make-wrapper.sh;
|
||||
|
||||
makeModulesClosure = {kernel, rootModules, allowMissing ? false}:
|
||||
makeModulesClosure = { kernel, rootModules, allowMissing ? false }:
|
||||
import ../build-support/kernel/modules-closure.nix {
|
||||
inherit stdenv module_init_tools kernel nukeReferences
|
||||
rootModules allowMissing;
|
||||
inherit stdenv kmod kernel nukeReferences rootModules allowMissing;
|
||||
};
|
||||
|
||||
pathsFromGraph = ../build-support/kernel/paths-from-graph.pl;
|
||||
|
Loading…
Reference in New Issue
Block a user