mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
Merge #1618: use ubuntu module blacklists by default
This commit is contained in:
commit
b5a32b3944
3 changed files with 36 additions and 18 deletions
|
@ -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
|
||||
|
|
28
pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix
Normal file
28
pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix
Normal file
|
@ -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";
|
||||
};
|
||||
}
|
|
@ -6855,6 +6855,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 { };
|
||||
|
|
Loading…
Reference in a new issue