]> pere.pagekite.me Git - homepage.git/blob - blog/data/2016-02-04-appstream-firmware.txt
Generated.
[homepage.git] / blog / data / 2016-02-04-appstream-firmware.txt
1 Title: Using appstream in Debian to locate packages with firmware and mime type support
2 Tags: english, debian
3 Date: 2016-02-04 16:40
4
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
10 about. :)</p>
11
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>
18
19 <blockquote><pre>
20 % apt install appstream
21 [...]
22 % apt update
23 [...]
24 % appstreamcli what-provides firmware:runtime ctfw-3.2.3.0.bin | \
25 awk '/Package:/ {print $2}'
26 firmware-qlogic
27 %
28 </pre></blockquote>
29
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>
33
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>
40
41 <blockquote><pre>
42 % apt install appstream
43 [...]
44 % apt update
45 [...]
46 % appstreamcli what-provides mimetype image/svg+xml | \
47 awk '/Package:/ {print $2}'
48 bkchem
49 phototonic
50 inkscape
51 shutter
52 tetzle
53 geeqie
54 xia
55 pinta
56 gthumb
57 karbon
58 comix
59 mirage
60 viewnior
61 postr
62 ristretto
63 kolourpaint4
64 eog
65 eom
66 gimagereader
67 midori
68 %
69 </pre></blockquote>
70
71 <p>I believe the MIME types are fetched from the desktop file for
72 packages providing appstream metadata.</p>