Use kmod instead of module-init-tools

This commit is contained in:
Eelco Dolstra 2012-06-15 14:18:26 -04:00
parent 164d6e6ab2
commit ab86759eb3
3 changed files with 10 additions and 15 deletions

@ -16,8 +16,7 @@ let
'';
requiredPackages =
[ config.system.sbin.modprobe # must take precedence over module_init_tools
config.environment.nix
[ config.environment.nix
pkgs.acl
pkgs.attr
pkgs.bashInteractive # bash with ncurses support
@ -38,7 +37,6 @@ let
pkgs.less
pkgs.libcap
pkgs.man
pkgs.module_init_tools
pkgs.nano
pkgs.ncurses
pkgs.netcat

@ -9,7 +9,6 @@ with pkgs.lib;
options = {
system.sbin.modprobe = mkOption {
# should be moved in module-init-tools
internal = true;
default = pkgs.writeTextFile {
name = "modprobe";
@ -18,8 +17,8 @@ with pkgs.lib;
text =
''
#! ${pkgs.stdenv.shell}
export MODULE_DIR=${config.system.modulesTree}/lib/modules/
export MODULE_DIR=/var/run/current-system/kernel-modules/lib/modules
# Fall back to the kernel modules used at boot time if the
# modules in the current configuration don't match the
# running kernel.
@ -27,7 +26,7 @@ with pkgs.lib;
MODULE_DIR=/var/run/booted-system/kernel-modules/lib/modules/
fi
exec ${pkgs.module_init_tools}/sbin/modprobe "$@"
exec ${pkgs.kmod}/sbin/modprobe "$@"
'';
};
description = ''
@ -78,6 +77,8 @@ with pkgs.lib;
target = "modprobe.d/nixos.conf";
};
environment.systemPackages = [ config.system.sbin.modprobe pkgs.kmod ];
boot.blacklistedKernelModules =
[ # This module is for debugging and generates gigantic amounts
# of log output, so it should never be loaded automatically.
@ -104,7 +105,7 @@ with pkgs.lib;
environment.shellInit =
''
export MODULE_DIR=${config.system.modulesTree}/lib/modules/
export MODULE_DIR=/var/run/current-system/kernel-modules/lib/modules
'';
};

@ -188,12 +188,8 @@ if [ -n "$debug2" ]; then
fi
# FIXME: auto-loading of kernel modules in systemd doesn't work yet
# because it uses libkmod.
"$(cat /proc/sys/kernel/modprobe)" autofs4
"$(cat /proc/sys/kernel/modprobe)" ipv6
# Start systemd.
echo "starting systemd..."
PATH=/var/run/current-system/systemd/lib/systemd exec systemd --log-target journal --log-level debug --crash-shell
PATH=/var/run/current-system/systemd/lib/systemd \
MODULE_DIR=/var/run/current-system/kernel-modules/lib/modules \
exec systemd --log-target journal --log-level debug --crash-shell