Remove enableIntel* and enableGo7007 options.

Update nixos-hardware-scan.pl to generate files without these options.

svn path=/nixos/branches/fix-style/; revision=13856
This commit is contained in:
Nicolas Pierron 2009-01-25 15:48:59 +00:00
parent 6086aee542
commit fa3437cb35
5 changed files with 32 additions and 82 deletions

View File

@ -4,6 +4,7 @@ use File::Spec;
use File::Basename; use File::Basename;
my @requireList = ();
my @kernelModules = (); my @kernelModules = ();
my @initrdKernelModules = (); my @initrdKernelModules = ();
@ -56,8 +57,6 @@ push @kernelModules, "kvm-amd" if hasCPUFeature "svm";
# modules are auto-detected so we don't need to list them here. # modules are auto-detected so we don't need to list them here.
# However, some are needed in the initrd to boot the system. # However, some are needed in the initrd to boot the system.
my $enableIntel2200BGFirmware = "false";
my $enableIntel3945ABGFirmware = "false";
my $videoDriver = "vesa"; my $videoDriver = "vesa";
sub pciCheck { sub pciCheck {
@ -97,11 +96,13 @@ sub pciCheck {
# Can't rely on $module here, since the module may not be loaded # Can't rely on $module here, since the module may not be loaded
# due to missing firmware. Ideally we would check modules.pcimap # due to missing firmware. Ideally we would check modules.pcimap
# here. # here.
$enableIntel2200BGFirmware = "true" if $vendor eq "0x8086" && push @requireList, "(import ./configurations/hardware/network/Intel2200BG.nix)" if
$vendor eq "0x8086" &&
($device eq "0x1043" || $device eq "0x104f" || $device eq "0x4220" || ($device eq "0x1043" || $device eq "0x104f" || $device eq "0x4220" ||
$device eq "0x4221" || $device eq "0x4223" || $device eq "0x4224"); $device eq "0x4221" || $device eq "0x4223" || $device eq "0x4224");
$enableIntel3945ABGFirmware = "true" if $vendor eq "0x8086" && push @requireList, "(import ./configurations/hardware/network/Intel3945ABG.nix)" if
$vendor eq "0x8086" &&
($device eq "0x4229" || $device eq "0x4230" || ($device eq "0x4229" || $device eq "0x4230" ||
$device eq "0x4222" || $device eq "0x4227"); $device eq "0x4222" || $device eq "0x4227");
@ -197,14 +198,26 @@ sub toNixExpr {
return $res; return $res;
} }
sub multiLineList {
my $indent = shift;
my $res = "";
foreach my $s (@_) {
$res .= "\n$indent $s";
}
$res .= "\nindent";
return $res;
}
my $initrdKernelModules = toNixExpr(removeDups @initrdKernelModules); my $initrdKernelModules = toNixExpr(removeDups @initrdKernelModules);
my $kernelModules = toNixExpr(removeDups @kernelModules); my $kernelModules = toNixExpr(removeDups @kernelModules);
my $requireList = multiLineList(" ", removeDups @requireList);
## This is a generated file. Do not modify! ## This is a generated file. Do not modify!
## Make changes to /etc/nixos/configuration.nix instead. ## Make changes to /etc/nixos/configuration.nix instead.
print <<EOF ; print <<EOF ;
{ {
require = [$requireList];
boot = { boot = {
initrd = { initrd = {
extraKernelModules = [ $initrdKernelModules ]; extraKernelModules = [ $initrdKernelModules ];
@ -216,12 +229,15 @@ print <<EOF ;
maxJobs = $cpus; maxJobs = $cpus;
}; };
# list of file systems which can be mounted.
fileSystems = [
];
# list of swap devices.
swapDevices = [
];
networking = { networking = {
enableIntel3945ABGFirmware = $enableIntel3945ABGFirmware;
# Warning: setting this option to `true' requires acceptance of the
# firmware license, see http://ipw2200.sourceforge.net/firmware.php?fid=7.
enableIntel2200BGFirmware = $enableIntel2200BGFirmware;
}; };
services = { services = {
@ -229,7 +245,7 @@ print <<EOF ;
xserver = { xserver = {
videoDriver = "$videoDriver"; videoDriver = "$videoDriver";
}; };
}; };
} }
EOF EOF

View File

@ -9,7 +9,6 @@ let
kernelPackages = mkOption { kernelPackages = mkOption {
default = pkgs.kernelPackages; default = pkgs.kernelPackages;
example = pkgs.kernelPackages_2_6_25; example = pkgs.kernelPackages_2_6_25;
merge = backwardPkgsFunMerge;
description = " description = "
This option allows you to override the Linux kernel used by This option allows you to override the Linux kernel used by
NixOS. Since things like external kernel module packages are NixOS. Since things like external kernel module packages are
@ -57,7 +56,6 @@ let
description = '' description = ''
A list of additional packages supplying kernel modules. A list of additional packages supplying kernel modules.
''; '';
merge = backwardPkgsFunListMerge;
}; };
kernelModules = mkOption { kernelModules = mkOption {
@ -148,14 +146,13 @@ in
{ {
require = [ require = [
options options
# udev
]; ];
system = { system = {
# include kernel modules. # include kernel modules.
modulesTree = [ kernel ] modulesTree = [ kernel ] ++ config.boot.extraModulePackages;
# this line should be removed!
++ pkgs.lib.optional config.hardware.enableGo7007 kernelPackages.wis_go7007
++ config.boot.extraModulePackages;
}; };
services = { services = {

View File

@ -209,21 +209,6 @@ in
}; };
}; };
# Hm, this sounds like a catch-all...
hardware = {
enableGo7007 = mkOption {
default = false;
merge = obsoleteMerge;
description = ''
Enable this option to get support for the WIS GO7007SB
multi-format video encoder, which is used in a number of
devices such as the Plextor ConvertX TV402U USB TV device.
'';
};
};
networking = { networking = {
@ -275,45 +260,6 @@ in
"; ";
}; };
enableIntel2200BGFirmware = mkOption {
default = false;
merge = obsoleteMerge;
description = "
Turn on this option if you want firmware for the Intel
PRO/Wireless 2200BG to be loaded automatically. This is
required if you want to use this device. Intel requires you to
accept the license for this firmware, see
<link xlink:href='http://ipw2200.sourceforge.net/firmware.php?fid=7'/>.
";
};
enableIntel3945ABGFirmware = mkOption {
default = false;
merge = obsoleteMerge;
description = "
This option enables automatic loading of the firmware for the Intel
PRO/Wireless 3945ABG.
";
};
enableIntel4965AGNFirmware = mkOption {
default = false;
merge = obsoleteMerge;
description = "
This option enables automatic loading of the firmware for the Intel
PRO/Wireless 4965AGN.
";
};
enableZydasZD1211Firmware = mkOption {
default = false;
merge = obsoleteMerge;
description = "
This option enables automatic loading of the firmware for the Zydas
ZyDAS ZD1211(b) 802.11a/b/g USB WLAN chip.
";
};
localCommands = mkOption { localCommands = mkOption {
default = ""; default = "";
example = "text=anything; echo You can put $text here."; example = "text=anything; echo You can put $text here.";

View File

@ -155,7 +155,6 @@ rec {
++ pkgs.lib.optional config.networking.defaultMailServer.directDelivery pkgs.ssmtp ++ pkgs.lib.optional config.networking.defaultMailServer.directDelivery pkgs.ssmtp
++ config.environment.extraPackages ++ config.environment.extraPackages
++ pkgs.lib.optional config.fonts.enableFontDir fontDir ++ pkgs.lib.optional config.fonts.enableFontDir fontDir
++ pkgs.lib.optional config.hardware.enableGo7007 kernelPackages.wis_go7007
# NSS modules need to be in `systemPath' so that (i) the builder # NSS modules need to be in `systemPath' so that (i) the builder
# chroot gets to seem them, and (ii) applications can benefit from # chroot gets to seem them, and (ii) applications can benefit from

View File

@ -147,16 +147,8 @@ let
inherit modprobe config; inherit modprobe config;
inherit (pkgs) stdenv writeText substituteAll udev procps; inherit (pkgs) stdenv writeText substituteAll udev procps;
inherit (pkgs.lib) cleanSource; inherit (pkgs.lib) cleanSource;
firmwareDirs = firmwareDirs = config.services.udev.addFirmware;
pkgs.lib.optional config.networking.enableIntel2200BGFirmware pkgs.ipw2200fw extraUdevPkgs = config.services.udev.addUdevPkgs;
++ pkgs.lib.optional config.networking.enableIntel3945ABGFirmware pkgs.iwlwifi3945ucode
++ pkgs.lib.optional config.networking.enableIntel4965AGNFirmware kernelPackages.iwlwifi4965ucode
++ pkgs.lib.optional config.networking.enableZydasZD1211Firmware pkgs.zd1211fw
++ pkgs.lib.optional config.hardware.enableGo7007 "${kernelPackages.wis_go7007}/firmware"
++ config.services.udev.addFirmware;
extraUdevPkgs =
pkgs.lib.optional config.hardware.enableGo7007 kernelPackages.wis_go7007
++ config.services.udev.addUdevPkgs;
}) })
# Makes LVM logical volumes available. # Makes LVM logical volumes available.