[Nix-dev] hardware.enableAllFirmware doesn't work
James Cook
james.cook at utoronto.ca
Tue Feb 21 03:09:41 CET 2012
Quoting Arie Middelkoop <amiddelk at gmail.com>:
> On 14-02-12 05:56, James Cook wrote:
>> This fixed it for me:
>> apply = list: pkgs.buildEnv {
>> + ignoreCollisions = true;
>>
>> Even with the above change, I think you get ugly warnings about the
>> collisions.
>
> Seems to me the best solution for now, although I guess that the
> order in which the firmwares appear in the list then matters. That's
> nasty.
>
> Another option would be to only enable ignoreCollisions when
> enableAllFirmware is set, and then add the allFirmware to the
> beginning (or end...) of the list. This complicates the code though.
>
> Alternatively, I could perhaps delete all the firmware in the
> non-free package that already exists in the kernel, with something
> like:
>
>> paths = `find -type=file ${kernel}/lib/firmware`
>> for path in paths ; do
>> rm -f "$out/$path"
>> done
>
> in the postInstall hook of the non-free package. Does not seem very
> appealing to me either.
>
> Arie
I don't know enough to compare one to the other, but the first option
seems okay (giving precedence to earlier things happens with Unix's
PATH and Java's CLASSPATH etc). Maybe using priorities would be
better, but that is hard to implement as far as I can tell.
I noticed one potentially confusing thing: if you add a directory
outside the nix store (e.g. /root/my-firmware), then only those files
which are present when the system is built will be used. I think it
might be good to update the documentation to mention the special path
/root/test-firmware .
Proposed new description:
List of directories containing firmware files. Such files
will be loaded automatically if the kernel asks for them
(i.e., when it has detected specific hardware that requires
firmware to function). If more than one path contains a
firmware file with the same name, the first path in the list
takes precedence. Note that you must rebuild your system if
you add files to any of these directories. For quick testing,
put firmware files in /root/test-firmware instead.
Also, it might be helpful if the example points out that you can put
derivations in the list:
example = [ pkgs.someFirmwarePackage "/root/my-firmware" ];
James
More information about the nix-dev
mailing list