Use kmod instead of module-init-tools
This commit is contained in:
parent
164d6e6ab2
commit
ab86759eb3
|
@ -16,8 +16,7 @@ let
|
||||||
'';
|
'';
|
||||||
|
|
||||||
requiredPackages =
|
requiredPackages =
|
||||||
[ config.system.sbin.modprobe # must take precedence over module_init_tools
|
[ config.environment.nix
|
||||||
config.environment.nix
|
|
||||||
pkgs.acl
|
pkgs.acl
|
||||||
pkgs.attr
|
pkgs.attr
|
||||||
pkgs.bashInteractive # bash with ncurses support
|
pkgs.bashInteractive # bash with ncurses support
|
||||||
|
@ -38,7 +37,6 @@ let
|
||||||
pkgs.less
|
pkgs.less
|
||||||
pkgs.libcap
|
pkgs.libcap
|
||||||
pkgs.man
|
pkgs.man
|
||||||
pkgs.module_init_tools
|
|
||||||
pkgs.nano
|
pkgs.nano
|
||||||
pkgs.ncurses
|
pkgs.ncurses
|
||||||
pkgs.netcat
|
pkgs.netcat
|
||||||
|
|
|
@ -9,7 +9,6 @@ with pkgs.lib;
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
system.sbin.modprobe = mkOption {
|
system.sbin.modprobe = mkOption {
|
||||||
# should be moved in module-init-tools
|
|
||||||
internal = true;
|
internal = true;
|
||||||
default = pkgs.writeTextFile {
|
default = pkgs.writeTextFile {
|
||||||
name = "modprobe";
|
name = "modprobe";
|
||||||
|
@ -18,8 +17,8 @@ with pkgs.lib;
|
||||||
text =
|
text =
|
||||||
''
|
''
|
||||||
#! ${pkgs.stdenv.shell}
|
#! ${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
|
# Fall back to the kernel modules used at boot time if the
|
||||||
# modules in the current configuration don't match the
|
# modules in the current configuration don't match the
|
||||||
# running kernel.
|
# running kernel.
|
||||||
|
@ -27,7 +26,7 @@ with pkgs.lib;
|
||||||
MODULE_DIR=/var/run/booted-system/kernel-modules/lib/modules/
|
MODULE_DIR=/var/run/booted-system/kernel-modules/lib/modules/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${pkgs.module_init_tools}/sbin/modprobe "$@"
|
exec ${pkgs.kmod}/sbin/modprobe "$@"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -78,6 +77,8 @@ with pkgs.lib;
|
||||||
target = "modprobe.d/nixos.conf";
|
target = "modprobe.d/nixos.conf";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [ config.system.sbin.modprobe pkgs.kmod ];
|
||||||
|
|
||||||
boot.blacklistedKernelModules =
|
boot.blacklistedKernelModules =
|
||||||
[ # This module is for debugging and generates gigantic amounts
|
[ # This module is for debugging and generates gigantic amounts
|
||||||
# of log output, so it should never be loaded automatically.
|
# of log output, so it should never be loaded automatically.
|
||||||
|
@ -104,7 +105,7 @@ with pkgs.lib;
|
||||||
|
|
||||||
environment.shellInit =
|
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
|
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.
|
# Start systemd.
|
||||||
echo "starting 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
|
||||||
|
|
Loading…
Reference in New Issue