summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2016-08-15 19:01:44 -0400
committerShea Levy <shea@shealevy.com>2016-08-15 19:01:44 -0400
commit57b2d1e9b0dcdd1d25bd2d450174764b9417ffc1 (patch)
tree73a214240d657ab03d4b52c3ba6c61f6538e030d /nixos/modules/system
parent760b2b9048ea775c319cb348d74447a20dea513e (diff)
parentb067b5301104c7d09d86d69febaa423a49ce14c0 (diff)
downloadnixlib-57b2d1e9b0dcdd1d25bd2d450174764b9417ffc1.tar
nixlib-57b2d1e9b0dcdd1d25bd2d450174764b9417ffc1.tar.gz
nixlib-57b2d1e9b0dcdd1d25bd2d450174764b9417ffc1.tar.bz2
nixlib-57b2d1e9b0dcdd1d25bd2d450174764b9417ffc1.tar.lz
nixlib-57b2d1e9b0dcdd1d25bd2d450174764b9417ffc1.tar.xz
nixlib-57b2d1e9b0dcdd1d25bd2d450174764b9417ffc1.tar.zst
nixlib-57b2d1e9b0dcdd1d25bd2d450174764b9417ffc1.zip
Merge branch 'modprobe-fix' of git://github.com/abbradar/nixpkgs
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/boot/kernel.nix5
-rw-r--r--nixos/modules/system/boot/modprobe.nix41
-rw-r--r--nixos/modules/system/boot/stage-2-init.sh1
3 files changed, 2 insertions, 45 deletions
diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix
index a6bbca9b30bb..0f342f44fe76 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 9bb10eac9880..b915a98d5375 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,11 +60,9 @@ 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";
-
   };
 
 }
diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh
index 4a7f073ea8ad..c5a14f0766d5 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