modprobe service: drop kmod wrapper

wip/yesman
Nikolay Amiantov 8 years ago
parent 1afd250676
commit b2ebecd9e5
  1. 2
      nixos/modules/config/zram.nix
  2. 2
      nixos/modules/services/hardware/udev.nix
  3. 2
      nixos/modules/services/networking/fan.nix
  4. 2
      nixos/modules/services/networking/strongswan.nix
  5. 39
      nixos/modules/system/boot/modprobe.nix
  6. 2
      nixos/modules/tasks/cpu-freq.nix
  7. 2
      nixos/modules/virtualisation/docker.nix

@ -8,7 +8,7 @@ let
devices = map (nr: "zram${toString nr}") (range 0 (cfg.numDevices - 1));
modprobe = "${config.system.sbin.modprobe}/sbin/modprobe";
modprobe = "${pkgs.kmod}/bin/modprobe";
in

@ -58,7 +58,7 @@ let
# Fix some paths in the standard udev rules. Hacky.
for i in $out/*.rules; do
substituteInPlace $i \
--replace \"/sbin/modprobe \"${config.system.sbin.modprobe}/sbin/modprobe \
--replace \"/sbin/modprobe \"${pkgs.kmod}/bin/modprobe \
--replace \"/sbin/mdadm \"${pkgs.mdadm}/sbin/mdadm \
--replace \"/sbin/blkid \"${pkgs.utillinux}/sbin/blkid \
--replace \"/bin/mount \"${pkgs.utillinux}/bin/mount \

@ -5,7 +5,7 @@ with lib;
let
cfg = config.networking.fan;
modprobe = "${config.system.sbin.modprobe}/sbin/modprobe";
modprobe = "${pkgs.kmod}/bin/modprobe";
in

@ -118,7 +118,7 @@ in
systemd.services.strongswan = {
description = "strongSwan IPSec Service";
wantedBy = [ "multi-user.target" ];
path = with pkgs; [ config.system.sbin.modprobe iproute iptables utillinux ]; # XXX Linux
path = with pkgs; [ kmod iproute iptables utillinux ]; # XXX Linux
wants = [ "keys.target" ];
after = [ "network.target" "keys.target" ];
environment = {

@ -8,41 +8,6 @@ with lib;
options = {
system.sbin.modprobe = mkOption {
internal = true;
default = pkgs.stdenv.mkDerivation {
name = "modprobe";
buildCommand = ''
mkdir -p $out/bin
for i in ${pkgs.kmod}/sbin/*; do
name=$(basename $i)
echo "$text" > $out/bin/$name
echo 'exec '$i' "$@"' >> $out/bin/$name
chmod +x $out/bin/$name
done
ln -s bin $out/sbin
'';
text =
''
#! ${pkgs.stdenv.shell}
export MODULE_DIR=/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.
if [ ! -d "$MODULE_DIR/$(${pkgs.coreutils}/bin/uname -r)" ]; then
MODULE_DIR=/run/booted-system/kernel-modules/lib/modules/
fi
'';
meta.priority = 4;
};
description = ''
Wrapper around modprobe that sets the path to the modules
tree.
'';
};
boot.blacklistedKernelModules = mkOption {
type = types.listOf types.str;
default = [];
@ -87,7 +52,7 @@ with lib;
'';
environment.etc."modprobe.d/debian.conf".source = pkgs.kmod-debian-aliases;
environment.systemPackages = [ config.system.sbin.modprobe pkgs.kmod ];
environment.systemPackages = [ pkgs.kmod ];
system.activationScripts.modprobe =
''
@ -95,7 +60,7 @@ with lib;
# in the right location in the Nix store for kernel modules).
# We need this when the kernel (or some module) auto-loads a
# module.
echo ${config.system.sbin.modprobe}/sbin/modprobe > /proc/sys/kernel/modprobe
echo ${pkgs.kmod}/bin/modprobe > /proc/sys/kernel/modprobe
'';
environment.sessionVariables.MODULE_DIR = "/run/current-system/kernel-modules/lib/modules";

@ -38,7 +38,7 @@ in
description = "CPU Frequency Governor Setup";
after = [ "systemd-modules-load.service" ];
wantedBy = [ "multi-user.target" ];
path = [ cpupower config.system.sbin.modprobe ];
path = [ cpupower pkgs.kmod ];
unitConfig.ConditionVirtualization = false;
serviceConfig = {
Type = "oneshot";

@ -95,7 +95,7 @@ in
LimitNPROC = 1048576;
} // proxy_env;
path = [ config.system.sbin.modprobe ] ++ (optional (cfg.storageDriver == "zfs") pkgs.zfs);
path = [ pkgs.kmod ] ++ (optional (cfg.storageDriver == "zfs") pkgs.zfs);
environment.MODULE_DIR = "/run/current-system/kernel-modules/lib/modules";
postStart = if cfg.socketActivation then "" else cfg.postStart;

Loading…
Cancel
Save