forked from mirrors/nixpkgs
* Option to enable the Intel 3945 firmware. (It's enabled by
default since it doesn't seem to have the legal issues of the Intel 2200 firmware.) * Firmware loader: don't write in /tmp. Also a hack to quickly test new firmwares. * Revert r10105 since the build fails if configuration.nix is a symlink. Anyway copying configuration.nix does not necessarily make sense since it can import other expressions, which would also have to be copied. Perhaps a better approach would be to write a serialisation of the config to a file (maybe with builtins.toXML). svn path=/nixos/trunk/; revision=10127
This commit is contained in:
parent
4475a74fb8
commit
cfed953b5f
|
@ -4,8 +4,7 @@ let
|
||||||
let env = builtins.getEnv "NIXOS_CONFIG"; in
|
let env = builtins.getEnv "NIXOS_CONFIG"; in
|
||||||
if env == "" then /etc/nixos/configuration.nix else env;
|
if env == "" then /etc/nixos/configuration.nix else env;
|
||||||
|
|
||||||
system = import system/system.nix {configuration = import configFileName;
|
system = import system/system.nix {configuration = import configFileName;};
|
||||||
inherit configFileName; };
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
|
@ -338,6 +338,14 @@
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableIntel3945ABGFirmware = mkOption {
|
||||||
|
default = true;
|
||||||
|
description = "
|
||||||
|
This option enables automatic loading of the firmware for the Intel
|
||||||
|
PRO/Wireless 3945ABG.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
localCommands = mkOption {
|
localCommands = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
example = "text=anything; echo You can put $text here.";
|
example = "text=anything; echo You can put $text here.";
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{ platform ? __currentSystem
|
{ platform ? __currentSystem
|
||||||
, stage2Init ? ""
|
, stage2Init ? ""
|
||||||
, configuration
|
, configuration
|
||||||
, configFileName ? ""
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
|
@ -247,10 +246,7 @@ rec {
|
||||||
++ pkgs.lib.optional (config.networking.defaultMailServer.directDelivery) pkgs.ssmtp
|
++ pkgs.lib.optional (config.networking.defaultMailServer.directDelivery) pkgs.ssmtp
|
||||||
++ pkgs.lib.concatLists (map (job: job.extraPath) upstartJobs.jobs)
|
++ pkgs.lib.concatLists (map (job: job.extraPath) upstartJobs.jobs)
|
||||||
++ (config.environment.extraPackages) pkgs
|
++ (config.environment.extraPackages) pkgs
|
||||||
++ pkgs.lib.optional (config.fonts.enableFontDir) fontDir
|
++ pkgs.lib.optional (config.fonts.enableFontDir) fontDir;
|
||||||
++ pkgs.lib.optional (configFileName != "" )
|
|
||||||
(pkgs.runCommand "configuration" {} '' mkdir -p $out/share && cp "${configFileName}" $out/share/configuration.nix '')
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
# We don't want to put all of `startPath' and `path' in $PATH, since
|
# We don't want to put all of `startPath' and `path' in $PATH, since
|
||||||
|
|
|
@ -26,12 +26,12 @@ let
|
||||||
inherit (pkgs) stdenv writeText substituteAll udev procps;
|
inherit (pkgs) stdenv writeText substituteAll udev procps;
|
||||||
inherit (pkgs.lib) cleanSource;
|
inherit (pkgs.lib) cleanSource;
|
||||||
firmwareDirs =
|
firmwareDirs =
|
||||||
pkgs.lib.optional (config.networking.enableIntel2200BGFirmware) pkgs.ipw2200fw
|
pkgs.lib.optional config.networking.enableIntel2200BGFirmware pkgs.ipw2200fw
|
||||||
++
|
++ pkgs.lib.optional config.networking.enableIntel3945ABGFirmware pkgs.iwlwifi3945ucode
|
||||||
(config.services.udev.addFirmware);
|
++ config.services.udev.addFirmware;
|
||||||
extraUdevPkgs =
|
extraUdevPkgs =
|
||||||
pkgs.lib.optional (config.services.hal.enable) pkgs.hal;
|
pkgs.lib.optional config.services.hal.enable pkgs.hal;
|
||||||
sndMode = config.services.udev.sndMode;
|
sndMode = config.services.udev.sndMode;
|
||||||
})
|
})
|
||||||
|
|
||||||
# Makes LVM logical volumes available.
|
# Makes LVM logical volumes available.
|
||||||
|
|
|
@ -6,14 +6,16 @@ exec > /var/log/udev-fw 2>&1
|
||||||
|
|
||||||
if test "$ACTION" = "add"; then
|
if test "$ACTION" = "add"; then
|
||||||
|
|
||||||
ls -l /sys/$DEVPATH >> /tmp/fw 2>&1
|
ls -l /sys/$DEVPATH
|
||||||
|
|
||||||
if ! test -e /sys/$DEVPATH/loading; then
|
if ! test -e /sys/$DEVPATH/loading; then
|
||||||
echo "Firmware loading is not supported by device \`DEVPATH'."
|
echo "Firmware loading is not supported by device \`DEVPATH'."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for dir in @firmwareDirs@; do
|
# /root/test-firmware is an impure location allowing quick testing
|
||||||
|
# of firmwares.
|
||||||
|
for dir in /root/test-firmware @firmwareDirs@; do
|
||||||
if test -e "$dir/$FIRMWARE"; then
|
if test -e "$dir/$FIRMWARE"; then
|
||||||
echo "Loading \`$FIRMWARE' for device \`$DEVPATH' from $dir."
|
echo "Loading \`$FIRMWARE' for device \`$DEVPATH' from $dir."
|
||||||
echo 1 > /sys/$DEVPATH/loading
|
echo 1 > /sys/$DEVPATH/loading
|
||||||
|
|
Loading…
Reference in a new issue