Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From the kernel's perspective, see <a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/firmware_class/README;hb=HEAD" rel="noreferrer">/usr/src/linux/Documentation/firmware_class/README</a>:</p> <pre> kernel(driver): calls request_firmware(&fw_entry, $FIRMWARE, device) userspace: - /sys/class/firmware/xxx/{loading,data} appear. - hotplug gets called with a firmware identifier in $FIRMWARE and the usual hotplug environment. - hotplug: echo 1 &gt; /sys/class/firmware/xxx/loading kernel: Discard any previous partial load. userspace: - hotplug: cat appropriate_firmware_image &gt; \ /sys/class/firmware/xxx/data kernel: grows a buffer in PAGE_SIZE increments to hold the image as it comes in. userspace: - hotplug: echo 0 &gt; /sys/class/firmware/xxx/loading kernel: request_firmware() returns and the driver has the firmware image in fw_entry-&gt;{data,size}. If something went wrong request_firmware() returns non-zero and fw_entry is set to NULL. kernel(driver): Driver code calls release_firmware(fw_entry) releasing the firmware image and any related resource. </pre> <p>The kernel doesn't actually load any firmware at all. It simply informs userspace, "I want a firmware by the name of <em>xxx</em>", and waits for userspace to pipe the firmware image back to the kernel.</p> <p>Now, on Ubuntu 8.04,</p> <pre> $ grep firmware /etc/udev/rules.d/80-program.rules # Load firmware on demand SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware_helper" </pre> <p>so as you've discovered, <code>udev</code> is configured to run <code>firmware_helper</code> when the kernel asks for firmware.</p> <pre> $ apt-get source udev Reading package lists... Done Building dependency tree Reading state information... Done Need to get 312kB of source archives. Get:1 http://us.archive.ubuntu.com hardy-security/main udev 117-8ubuntu0.2 (dsc) [716B] Get:2 http://us.archive.ubuntu.com hardy-security/main udev 117-8ubuntu0.2 (tar) [245kB] Get:3 http://us.archive.ubuntu.com hardy-security/main udev 117-8ubuntu0.2 (diff) [65.7kB] Fetched 312kB in 1s (223kB/s) gpg: Signature made Tue 14 Apr 2009 05:31:34 PM EDT using DSA key ID 17063E6D gpg: Can't check signature: public key not found dpkg-source: extracting udev in udev-117 dpkg-source: unpacking udev_117.orig.tar.gz dpkg-source: applying ./udev_117-8ubuntu0.2.diff.gz $ cd udev-117/ $ cat debian/patches/80-extras-firmware.patch </pre> <p>If you read the source, you'll find that Ubuntu wrote a <code>firmware_helper</code> which is hard-coded to first look for <code>/lib/modules/$(uname -r)/$FIRMWARE</code>, then <code>/lib/modules/$FIRMWARE</code>, and no other locations. Translating it to <code>sh</code>, it does approximately this:</p> <pre><code>echo -n 1 &gt; /sys/$DEVPATH/loading cat /lib/firmware/$(uname -r)/$FIRMWARE &gt; /sys/$DEVPATH/data \ || cat /lib/firmware/$FIRMWARE &gt; /sys/$DEVPATH/data if [ $? = 0 ]; then echo -n 1 &gt; /sys/$DEVPATH/loading echo -n -1 &gt; /sys/$DEVPATH/loading fi </code></pre> <p>which is exactly the format the kernel expects.</p> <hr> <p>To make a long story short: Ubuntu's <code>udev</code> package has customizations that always look in <code>/lib/firmware/$(uname -r)</code> first. This policy is being handled in userspace.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload