]> pere.pagekite.me Git - homepage.git/blob - blog/data/2016-02-04-appstream-firmware.txt
New blog post.
[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> is
6 taking shape in Debian, and one feature set that is very convenient is
7 its ability to tell you want package to install to get a given
8 firmware file. This can be done using apt-file too, but that is for
9 someone else to blog about. :)</p>
10
11 <p>Here is a small recipe to find the package with a given firmware
12 file, in this example I am looking for ctfw-3.2.3.0.bin, randomly
13 picked from the set of firmware announced using appstream in Debian
14 unstable. In general you would be looking for the firmware requested
15 by the kernel during kernel module loading. To find the package
16 providing the example file, do like this:</p>
17
18 <blockquote><pre>
19 % apt install appstream
20 [...]
21 % apt update
22 [...]
23 % appstreamcli what-provides firmware:runtime ctfw-3.2.3.0.bin | \
24 awk '/Package:/ {print $2}'
25 firmware-qlogic
26 %
27 </pre></blockquote>
28
29 <p>See <a href="https://wiki.debian.org/AppStream/Guidelines">the
30 appstream wiki</a> page to learn how to embed the package metadata in
31 a way appstream can use.</p>
32
33 <p>This same approach can be used to find any package supporting a
34 given MIME type. This is very useful when you get a file you do not
35 know how to handle. First find the mime type using <tt>file
36 --mime-type</tt>, and next look up the package providing support for
37 it. Lets say you got an SVG file. Its MIME type is image/svg+xml,
38 and you can find all packages handling this type like this:</p>
39
40 <blockquote><pre>
41 % apt install appstream
42 [...]
43 % apt update
44 [...]
45 % appstreamcli what-provides mimetype image/svg+xml | \
46 awk '/Package:/ {print $2}'
47 bkchem
48 phototonic
49 inkscape
50 shutter
51 tetzle
52 geeqie
53 xia
54 pinta
55 gthumb
56 karbon
57 comix
58 mirage
59 viewnior
60 postr
61 ristretto
62 kolourpaint4
63 eog
64 eom
65 gimagereader
66 midori
67 %
68 </pre></blockquote>
69
70 <p>I believe the MIME types are fetched from the desktop file for
71 packages providing appstream metadata.</p>