Let the kernel load firmware directly

Loading firmware via udevd is obsolete. Fixes #4552.
This commit is contained in:
Eelco Dolstra 2014-10-20 13:13:10 +02:00
parent 3bd72fc71f
commit a3b873924b

View file

@ -168,7 +168,6 @@ in
hardware.firmware = mkOption { hardware.firmware = mkOption {
type = types.listOf types.path; type = types.listOf types.path;
default = []; default = [];
example = [ "/root/my-firmware" ];
description = '' description = ''
List of directories containing firmware files. Such files List of directories containing firmware files. Such files
will be loaded automatically if the kernel asks for them will be loaded automatically if the kernel asks for them
@ -177,10 +176,10 @@ in
firmware file with the same name, the first path in the list firmware file with the same name, the first path in the list
takes precedence. Note that you must rebuild your system if takes precedence. Note that you must rebuild your system if
you add files to any of these directories. For quick testing, you add files to any of these directories. For quick testing,
put firmware files in /root/test-firmware and add that put firmware files in <filename>/root/test-firmware</filename>
directory to the list. and add that directory to the list. Note that you can also
Note that you can also add firmware packages to this add firmware packages to this list as these are directories in
list as these are directories in the nix store. the nix store.
''; '';
apply = list: pkgs.buildEnv { apply = list: pkgs.buildEnv {
name = "firmware"; name = "firmware";
@ -244,6 +243,11 @@ in
echo "regenerating udev hardware database..." echo "regenerating udev hardware database..."
${config.systemd.package}/bin/udevadm hwdb --update && ln -sfn ${config.systemd.package} /var/lib/udev/prev-systemd ${config.systemd.package}/bin/udevadm hwdb --update && ln -sfn ${config.systemd.package} /var/lib/udev/prev-systemd
fi fi
# Allow the kernel to find our firmware.
if [ -e /sys/module/firmware_class/parameters/path ]; then
echo -n "${config.hardware.firmware}" > /sys/module/firmware_class/parameters/path
fi
''; '';
systemd.services.systemd-udevd = systemd.services.systemd-udevd =