1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries from February
2016</title>
5 <description>Entries from February
2016</description>
6 <link>http://people.skolelinux.org/pere/blog/
</link>
10 <title>Using appstream in Debian to locate packages with firmware and mime type support
</title>
11 <link>http://people.skolelinux.org/pere/blog/Using_appstream_in_Debian_to_locate_packages_with_firmware_and_mime_type_support.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Using_appstream_in_Debian_to_locate_packages_with_firmware_and_mime_type_support.html
</guid>
13 <pubDate>Thu,
4 Feb
2016 16:
40:
00 +
0100</pubDate>
14 <description><p
>The
<a href=
"https://wiki.debian.org/DEP-
11">appstream system
</a
> is
15 taking shape in Debian, and one feature set that is very convenient is
16 its ability to tell you want package to install to get a given
17 firmware file. This can be done using apt-file too, but that is for
18 someone else to blog about. :)
</p
>
20 <p
>Here is a small recipe to find the package with a given firmware
21 file, in this example I am looking for ctfw-
3.2.3.0.bin, randomly
22 picked from the set of firmware announced using appstream in Debian
23 unstable. In general you would be looking for the firmware requested
24 by the kernel during kernel module loading. To find the package
25 providing the example file, do like this:
</p
>
27 <blockquote
><pre
>
28 % apt install appstream
32 % appstreamcli what-provides firmware:runtime ctfw-
3.2.3.0.bin | \
33 awk
'/Package:/ {print $
2}
'
36 </pre
></blockquote
>
38 <p
>See
<a href=
"https://wiki.debian.org/AppStream/Guidelines
">the
39 appstream wiki
</a
> page to learn how to embed the package metadata in
40 a way appstream can use.
</p
>
42 <p
>This same approach can be used to find any package supporting a
43 given MIME type. This is very useful when you get a file you do not
44 know how to handle. First find the mime type using
<tt
>file
45 --mime-type
</tt
>, and next look up the package providing support for
46 it. Lets say you got an SVG file. Its MIME type is image/svg+xml,
47 and you can find all packages handling this type like this:
</p
>
49 <blockquote
><pre
>
50 % apt install appstream
54 % appstreamcli what-provides mimetype image/svg+xml | \
55 awk
'/Package:/ {print $
2}
'
77 </pre
></blockquote
>
79 <p
>I believe the MIME types are fetched from the desktop file for
80 packages providing appstream metadata.
</p
>