summary refs log tree commit diff
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2014-01-21 00:29:35 +0100
committerVladimír Čunát <vcunat@gmail.com>2014-01-28 12:52:36 +0100
commit5acaa980a510f77fce358bdbe93ab5fa388118fd (patch)
treec407cf2ccba52f91f085a9c70256c320b0d60d78
parent849b383f4d26eed9145fe2b584d1cf3d6f7dd63a (diff)
downloadnixpkgs-5acaa980a510f77fce358bdbe93ab5fa388118fd.tar
nixpkgs-5acaa980a510f77fce358bdbe93ab5fa388118fd.tar.gz
nixpkgs-5acaa980a510f77fce358bdbe93ab5fa388118fd.tar.bz2
nixpkgs-5acaa980a510f77fce358bdbe93ab5fa388118fd.tar.lz
nixpkgs-5acaa980a510f77fce358bdbe93ab5fa388118fd.tar.xz
nixpkgs-5acaa980a510f77fce358bdbe93ab5fa388118fd.tar.zst
nixpkgs-5acaa980a510f77fce358bdbe93ab5fa388118fd.zip
pull module blacklist from Ubuntu and use it by default
People often have serious problems due to bogus modules like *fb.
-rw-r--r--nixos/modules/system/boot/modprobe.nix24
-rw-r--r--pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix28
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 36 insertions, 18 deletions
diff --git a/nixos/modules/system/boot/modprobe.nix b/nixos/modules/system/boot/modprobe.nix
index 027a7ac99d5..f694fd29dd0 100644
--- a/nixos/modules/system/boot/modprobe.nix
+++ b/nixos/modules/system/boot/modprobe.nix
@@ -68,7 +68,10 @@ with pkgs.lib;
 
   config = mkIf (!config.boot.isContainer) {
 
-    environment.etc = singleton
+    environment.etc = [
+      { source = "${pkgs.kmod-blacklist-ubuntu}/modprobe.conf";
+        target = "modprobe.d/ubuntu.conf";
+      }
       { source = pkgs.writeText "modprobe.conf"
           ''
             ${flip concatMapStrings config.boot.blacklistedKernelModules (name: ''
@@ -77,26 +80,11 @@ with pkgs.lib;
             ${config.boot.extraModprobeConfig}
           '';
         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.
-        "evbug"
-
-        # This module causes ALSA to occassionally select the wrong
-        # default sound device, and is little more than an annoyance
-        # on modern machines.
-        "snd_pcsp"
-
-        # The cirrusfb module prevents X11 from starting.  FIXME:
-        # Ubuntu blacklists all framebuffer devices because they're
-        # "buggy" and cause suspend problems.  Maybe we should too?
-        "cirrusfb"
-      ];
-
     system.activationScripts.modprobe =
       ''
         # Allow the kernel to find our wrapped modprobe (which searches
diff --git a/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix b/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix
new file mode 100644
index 00000000000..9da50766f92
--- /dev/null
+++ b/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchbzr }:
+
+stdenv.mkDerivation rec {
+  name = "blacklist-ubuntu-${builtins.toString src.revision}"; # Saucy
+
+  src = fetchbzr {
+    url = meta.homepage;
+    sha256 = "0ci4b5dxzirc27zvgpr3s0pa78gjmfjwprmvyplxhwxb765la9v9";
+    revision = 13;
+  };
+
+  unpackPhase = "true";
+
+  installPhase = ''
+    mkdir "$out"
+    for f in "$src"/debian/modprobe.d/*.conf; do
+      echo "''\n''\n## file: "`basename "$f"`"''\n''\n" >> "$out"/modprobe.conf
+      cat "$f" >> "$out"/modprobe.conf
+    done
+  '';
+
+  #TODO: iwlwifi.conf has some strange references
+
+  meta = {
+    homepage = https://code.launchpad.net/~ubuntu-branches/ubuntu/saucy/kmod/saucy;
+    description = "Linux kernel module blacklists from Ubuntu";
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 9b3c86cd29c..85ac461732d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6835,6 +6835,8 @@ let
 
   kmod = callPackage ../os-specific/linux/kmod { };
 
+  kmod-blacklist-ubuntu = callPackage ../os-specific/linux/kmod-blacklist-ubuntu { };
+
   kvm = qemu_kvm;
 
   libcap = callPackage ../os-specific/linux/libcap { };