0

So today I learned that my distro's linux-unfree-firmware package is 491 Mb in size. I'm pretty sure my hardware doesn't need all of these files. Hence I think I can reduce this disk usage if I'll only know what files I can exclude from there.

Is there any official documentation, that states exactly what files from https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/ are needed per device / computer model? Perhaps the official documentation of my Computer's hardware will state that? There's a Linux from scratch webpage that gives some info for popular hardware, but I'm wondering if there's a bit more "official" information available somewhere.

0

There is no "official" documentation for every piece of hardware there is and the firmware files that it requires, unfortunately. But, it is possible to know exactly what firmware files are needed by your hardware via hacking a bit on the Linux kernel build system.

More over, even if you do discover exactly what firmware files your hardware uses, you will get eventually a not-too-short list of files, that will need to be updated frequently - after pretty much every release (git tag) of https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/. This means that you won't be able to reliably filter out firmware files straight from the list that you'll soon learn to generate.

If you are still interested in this, follow this steps:

  1. Download the latest release of the kernel from https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ .
  2. Run: make localmodconfig.
    • This will generate a .config file that will contain a list of build parameters according to your current kernel.
  3. Run make.
    • This will build the kernel, so it might take a while.
    • You'll might need to install some dependencies to make the build finish.
    • After make will finish, you'll have a bunch of .ko files which are kernel module files.
  4. Run this command:
find -name '*.ko' -exec modinfo {} \; | awk '$1 == "firmware:" { print $2}'

The last command prints a list of firmware files which will probably be found in your distro's linux-unfree-firmware package. These are the files your hardware needs.

Credits: https://lists.kernelnewbies.org/pipermail/kernelnewbies/2020-May/020818.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.