[Nix-dev] Two common wireless firmware nix expressions
Tony White
tonywhite100 at googlemail.com
Sun Apr 12 06:16:01 CEST 2009
I've been able to successfully create and test two firmware
expressions for NixOS. One is for the ipw2100 firmware that the
ipw2100 module requires to bring up the device and the other is for
the rt73usb module, Which also requires firmware.
Both modules are shipped with the mainline Linux kernel (Which is
included with NixOS,) So it only seems logical that the expressions be
available for users, Like me :) Of those two devices.
Both devices are wireless adapters.
/etc/nixos/nixpkgs/pkgs/os-specific/linux/firmware/ipw2100
Contains default.nix :
{stdenv, fetchurl}:
stdenv.mkDerivation {
name = "ipw2100fw-1.3";
src = fetchurl {
url = http://bughost.org/firmware/ipw2100-fw-1.3.tgz;
sha256 = "e1107c455e48d324a616b47a622593bc8413dcce72026f72731c0b03dae3a7a2";
};
buildPhase = "true";
# Installation copies the firmware AND the license. The license
# says: "Your rights to redistribute the Software shall be
# contingent upon your installation of this Agreement in its
# entirety in the same directory as the Software."
unpackPhase = "
tar xvfz $src
";
installPhase = "ensureDir $out; cp * $out";
meta = {
# "... you may transfer a copy of the Software ... provided such
# recipient agrees to be fully bound by the terms hereof."
description = "Firmware for the Intel 2100 wireless card (requires
acceptance of license, see
http://ipw2100.sourceforge.net/firmware.php?fid=4";
homepage = http://ipw2100.sourceforge.net/firmware.php;
license = http://ipw2100.sourceforge.net/firmware.php?fid=4;
# See also http://ipw2100.sourceforge.net/firmware_faq.php
};
}
/etc/nixos/nixpkgs/pkgs/top-level/all-packages.nix requires the
following amended :
ipw2100fw = import ../os-specific/linux/firmware/ipw2100 {
inherit fetchurl stdenv;
};
In the ### OS-SPECIFIC section.
The vendor of the rt73usb device provides their own version of the
rt73 kernel driver but the driver is linked to the development of the
driver included in the mainline kernel. What that means is that the
expression downloads the driver's source from the vendor and only
copies the firmware from the archive. It's really not worth using the
vendor's own driver because it would require blacklisting the mainline
kernel's rt73usb driver for it to work and the driver that ships with
the mainline kernel works just fine.
So, /media/nixos/etc/nixos/nixpkgs/pkgs/os-specific/linux/firmware/rt73fw
Contains default.nix :
{stdenv, fetchurl}:
stdenv.mkDerivation {
name = "rt73fw-1.1.0.2";
src = fetchurl {
url = http://www.ralinktech.com.tw/data/drivers/2009_0206_RT73_Linux_STA_Drv1.1.0.2.tar.bz2;
sha256 = "6d4a0a647138693bc466babe6f476f5fa26a88da4177e20ad71efe99fe174db5";
};
buildPhase = "true";
# RT2501USB(RT73:RT2571W/RT2573/RT2671)
# Installation copies the firmware rt73.bin.
installPhase = "ensureDir $out; cp Module/rt73.bin $out";
meta = {
# The archive and the download page provides no license
# but we'll assume gpl. Vendor provides a driver but we
# only need the firmware from the archive because
# a driver module that can already use the firmware is included
# with the mainline Linux kernel
description = "Firmware for the rt73 usb wireless card";
homepage = http://www.ralinktech.com/ralink/Home/Support/Linux.html;
};
}
/etc/nixos/nixpkgs/pkgs/top-level/all-packages.nix requires the
following amended :
rt73fw = import ../os-specific/linux/firmware/rt73fw {
inherit fetchurl stdenv;
};
Again in the ### OS-SPECIFIC section.
With both devices I've been able to create fully working wpa
connections using NixOS' kernel driver for each, The firmware,
wpa_supplicant and dhclient. So tested and working.
Normally I think I should maybe be politely requesting svn access to
commit these two expressions, however I've never used svn to commit
anything before, I don't expect that I'd want to commit anything more
than this for a while due to the fact I'm really new to nix and I'm
still in the process of getting to grips with it.
Maybe in the future I'll ask but for now I'll just keep a copy of any
more expressions I build locally and then as I migrate to NixOS, I'll
setup a git repo and maintain them from there, Until my understanding
of nix & NixOS is greater.
So if someone could commit these two expressions please, That would be great.
I'm asking because these two firmware expressions are missing from the
repos, The hardware works but requires the firmware and the hardware
is reasonably common, rt73usb is especially common.
I hope that this is OK.
Many thanks,
Tony
More information about the nix-dev
mailing list