]> err.no Git - systemd/commitdiff
firmware: fix error reporting on missing firmware files
authorThomas Bächler <thomas@archlinux.org>
Sun, 31 Jan 2010 12:49:02 +0000 (13:49 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Sun, 31 Jan 2010 22:04:57 +0000 (23:04 +0100)
The new firmware loader does not report an error to the kernel if a firmware file
is missing. This results in modprobe stalling for 60 seconds for each firmware
a module tries to load.

extras/firmware/firmware.c

index 8f70be42ac2660b5e75e0dfa63228e9d5692a645..16455dec8f3299ef2283ce1382ad1cb1d99a0cb4 100644 (file)
@@ -149,6 +149,7 @@ int main(int argc, char **argv)
 
        util_path_encode(firmware, fwencpath, sizeof(fwencpath));
        util_strscpyl(misspath, sizeof(misspath), udev_get_dev_path(udev), "/.udev/firmware-missing/", fwencpath, NULL);
+       util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL);
 
        if (fwfile == NULL) {
                int err;
@@ -166,6 +167,7 @@ int main(int argc, char **argv)
                        udev_selinux_resetfscreatecon(udev);
                } while (err == -ENOENT);
                rc = 2;
+               set_loading(udev, loadpath, "-1");
                goto exit;
        }
 
@@ -176,7 +178,6 @@ int main(int argc, char **argv)
        if (unlink(misspath) == 0)
                util_delete_path(udev, misspath);
 
-       util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL);
        set_loading(udev, loadpath, "1");
 
        util_strscpyl(datapath, sizeof(datapath), udev_get_sys_path(udev), devpath, "/data", NULL);