1 Title: Using appstream in Debian to locate packages with firmware and mime type support
5 <p>The <a href="https://wiki.debian.org/DEP-11">appstream system</a>
6 is taking shape in Debian, and one provided feature is a very
7 convenient way to tell you which package to install to make a given
8 firmware file available when the kernel is looking for it. This can
9 be done using apt-file too, but that is for someone else to blog
12 <p>Here is a small recipe to find the package with a given firmware
13 file, in this example I am looking for ctfw-3.2.3.0.bin, randomly
14 picked from the set of firmware announced using appstream in Debian
15 unstable. In general you would be looking for the firmware requested
16 by the kernel during kernel module loading. To find the package
17 providing the example file, do like this:</p>
20 % apt install appstream
24 % appstreamcli what-provides firmware:runtime ctfw-3.2.3.0.bin | \
25 awk '/Package:/ {print $2}'
30 <p>See <a href="https://wiki.debian.org/AppStream/Guidelines">the
31 appstream wiki</a> page to learn how to embed the package metadata in
32 a way appstream can use.</p>
34 <p>This same approach can be used to find any package supporting a
35 given MIME type. This is very useful when you get a file you do not
36 know how to handle. First find the mime type using <tt>file
37 --mime-type</tt>, and next look up the package providing support for
38 it. Lets say you got an SVG file. Its MIME type is image/svg+xml,
39 and you can find all packages handling this type like this:</p>
42 % apt install appstream
46 % appstreamcli what-provides mimetype image/svg+xml | \
47 awk '/Package:/ {print $2}'
71 <p>I believe the MIME types are fetched from the desktop file for
72 packages providing appstream metadata.</p>