From cfed953b5f304164a66d42e55f51d02cff793f77 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 12 Jan 2008 22:53:13 +0000 Subject: [PATCH] * 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 --- default.nix | 3 +-- system/options.nix | 8 ++++++++ system/system.nix | 6 +----- upstart-jobs/default.nix | 10 +++++----- upstart-jobs/udev-firmware-loader.sh | 6 ++++-- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/default.nix b/default.nix index 481202b75caf..09c9a1569d88 100644 --- a/default.nix +++ b/default.nix @@ -4,8 +4,7 @@ let let env = builtins.getEnv "NIXOS_CONFIG"; in if env == "" then /etc/nixos/configuration.nix else env; - system = import system/system.nix {configuration = import configFileName; - inherit configFileName; }; + system = import system/system.nix {configuration = import configFileName;}; in diff --git a/system/options.nix b/system/options.nix index 8511e65a0665..bf571d56635d 100644 --- a/system/options.nix +++ b/system/options.nix @@ -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 { default = ""; example = "text=anything; echo You can put $text here."; diff --git a/system/system.nix b/system/system.nix index a1ceb345ccd1..5b6f23749f02 100644 --- a/system/system.nix +++ b/system/system.nix @@ -1,7 +1,6 @@ { platform ? __currentSystem , stage2Init ? "" , configuration -, configFileName ? "" }: rec { @@ -247,10 +246,7 @@ rec { ++ pkgs.lib.optional (config.networking.defaultMailServer.directDelivery) pkgs.ssmtp ++ pkgs.lib.concatLists (map (job: job.extraPath) upstartJobs.jobs) ++ (config.environment.extraPackages) pkgs - ++ pkgs.lib.optional (config.fonts.enableFontDir) fontDir - ++ pkgs.lib.optional (configFileName != "" ) - (pkgs.runCommand "configuration" {} '' mkdir -p $out/share && cp "${configFileName}" $out/share/configuration.nix '') - ; + ++ pkgs.lib.optional (config.fonts.enableFontDir) fontDir; # We don't want to put all of `startPath' and `path' in $PATH, since diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 6fceee08cfe9..7fe6d45dfe69 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -26,12 +26,12 @@ let inherit (pkgs) stdenv writeText substituteAll udev procps; inherit (pkgs.lib) cleanSource; firmwareDirs = - pkgs.lib.optional (config.networking.enableIntel2200BGFirmware) pkgs.ipw2200fw - ++ - (config.services.udev.addFirmware); + pkgs.lib.optional config.networking.enableIntel2200BGFirmware pkgs.ipw2200fw + ++ pkgs.lib.optional config.networking.enableIntel3945ABGFirmware pkgs.iwlwifi3945ucode + ++ config.services.udev.addFirmware; extraUdevPkgs = - pkgs.lib.optional (config.services.hal.enable) pkgs.hal; - sndMode = config.services.udev.sndMode; + pkgs.lib.optional config.services.hal.enable pkgs.hal; + sndMode = config.services.udev.sndMode; }) # Makes LVM logical volumes available. diff --git a/upstart-jobs/udev-firmware-loader.sh b/upstart-jobs/udev-firmware-loader.sh index 03f0290fd330..3592e72bb136 100755 --- a/upstart-jobs/udev-firmware-loader.sh +++ b/upstart-jobs/udev-firmware-loader.sh @@ -6,14 +6,16 @@ exec > /var/log/udev-fw 2>&1 if test "$ACTION" = "add"; then - ls -l /sys/$DEVPATH >> /tmp/fw 2>&1 + ls -l /sys/$DEVPATH if ! test -e /sys/$DEVPATH/loading; then echo "Firmware loading is not supported by device \`DEVPATH'." exit 1 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 echo "Loading \`$FIRMWARE' for device \`$DEVPATH' from $dir." echo 1 > /sys/$DEVPATH/loading