From b2ebecd9e50471ec967ab9cdb2aba793d75cb747 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sun, 14 Aug 2016 13:00:52 +0300 Subject: modprobe service: drop kmod wrapper --- nixos/modules/system/boot/modprobe.nix | 39 ++-------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) (limited to 'nixos/modules/system/boot/modprobe.nix') diff --git a/nixos/modules/system/boot/modprobe.nix b/nixos/modules/system/boot/modprobe.nix index 9bb10eac98803..91f440535a487 100644 --- a/nixos/modules/system/boot/modprobe.nix +++ b/nixos/modules/system/boot/modprobe.nix @@ -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"; -- cgit 1.4.1 From 1f639587729daf6c34535addbc35fd6e5c816ffc Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sun, 14 Aug 2016 13:01:14 +0300 Subject: nixos treewide: don't set MODULE_DIR --- nixos/modules/hardware/video/bumblebee.nix | 1 - nixos/modules/hardware/video/webcam/facetimehd.nix | 1 - nixos/modules/services/hardware/tlp.nix | 4 ---- nixos/modules/services/hardware/udev.nix | 3 +-- nixos/modules/system/boot/kernel.nix | 5 ----- nixos/modules/system/boot/modprobe.nix | 2 -- nixos/modules/system/boot/stage-2-init.sh | 1 - nixos/modules/virtualisation/docker.nix | 1 - 8 files changed, 1 insertion(+), 17 deletions(-) (limited to 'nixos/modules/system/boot/modprobe.nix') diff --git a/nixos/modules/hardware/video/bumblebee.nix b/nixos/modules/hardware/video/bumblebee.nix index b10846ac18a1a..69db518ab21cb 100644 --- a/nixos/modules/hardware/video/bumblebee.nix +++ b/nixos/modules/hardware/video/bumblebee.nix @@ -75,7 +75,6 @@ in serviceConfig = { ExecStart = "${bumblebee}/bin/bumblebeed --use-syslog -g ${cfg.group} --driver ${cfg.driver}"; }; - environment.MODULE_DIR="/run/current-system/kernel-modules/lib/modules/"; }; }; } diff --git a/nixos/modules/hardware/video/webcam/facetimehd.nix b/nixos/modules/hardware/video/webcam/facetimehd.nix index 2a2fcf3057d4d..d311f600c3197 100644 --- a/nixos/modules/hardware/video/webcam/facetimehd.nix +++ b/nixos/modules/hardware/video/webcam/facetimehd.nix @@ -36,7 +36,6 @@ in # and load it back on resume powerManagement.resumeCommands = '' - export MODULE_DIR=/run/current-system/kernel-modules/lib/modules ${pkgs.kmod}/bin/modprobe -v facetimehd ''; diff --git a/nixos/modules/services/hardware/tlp.nix b/nixos/modules/services/hardware/tlp.nix index 5ab7daafa85b4..281d02a8c65e3 100644 --- a/nixos/modules/services/hardware/tlp.nix +++ b/nixos/modules/services/hardware/tlp.nix @@ -72,8 +72,6 @@ in ExecStart = "${tlp}/bin/tlp init start"; ExecStop = "${tlp}/bin/tlp init stop"; }; - - environment.MODULE_DIR="/run/current-system/kernel-modules/lib/modules/"; }; tlp-sleep = { @@ -92,8 +90,6 @@ in ExecStart = "${tlp}/bin/tlp suspend"; ExecStop = "${tlp}/bin/tlp resume"; }; - - environment.MODULE_DIR="/run/current-system/kernel-modules/lib/modules/"; }; }; diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index fb44790ab1f1d..7c4c93d0fcb32 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -316,8 +316,7 @@ in ''; systemd.services.systemd-udevd = - { environment.MODULE_DIR = "/run/booted-system/kernel-modules/lib/modules"; - restartTriggers = cfg.packages; + { restartTriggers = cfg.packages; }; }; diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index a6bbca9b30bb7..0f342f44fe76a 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -228,7 +228,6 @@ in systemd.services."systemd-modules-load" = { wantedBy = [ "multi-user.target" ]; restartTriggers = [ kernelModulesConf ]; - environment.MODULE_DIR = "/run/booted-system/kernel-modules/lib/modules"; serviceConfig = { # Ignore failed module loads. Typically some of the # modules in ‘boot.kernelModules’ are "nice to have but @@ -238,10 +237,6 @@ in }; }; - systemd.services.kmod-static-nodes = - { environment.MODULE_DIR = "/run/booted-system/kernel-modules/lib/modules"; - }; - lib.kernelConfig = { isYes = option: { assertion = config: config.isYes option; diff --git a/nixos/modules/system/boot/modprobe.nix b/nixos/modules/system/boot/modprobe.nix index 91f440535a487..b915a98d5375b 100644 --- a/nixos/modules/system/boot/modprobe.nix +++ b/nixos/modules/system/boot/modprobe.nix @@ -63,8 +63,6 @@ with lib; echo ${pkgs.kmod}/bin/modprobe > /proc/sys/kernel/modprobe ''; - environment.sessionVariables.MODULE_DIR = "/run/current-system/kernel-modules/lib/modules"; - }; } diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh index 4a7f073ea8adc..c5a14f0766d57 100644 --- a/nixos/modules/system/boot/stage-2-init.sh +++ b/nixos/modules/system/boot/stage-2-init.sh @@ -207,6 +207,5 @@ exec {logOutFd}>&- {logErrFd}>&- # Start systemd. echo "starting systemd..." PATH=/run/current-system/systemd/lib/systemd \ - MODULE_DIR=/run/booted-system/kernel-modules/lib/modules \ LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive \ exec systemd diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix index 97b2927cf1bde..ebc2be087a5b2 100644 --- a/nixos/modules/virtualisation/docker.nix +++ b/nixos/modules/virtualisation/docker.nix @@ -96,7 +96,6 @@ in } // proxy_env; 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; -- cgit 1.4.1