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
>
15 is taking shape in Debian, and one provided feature is a very
16 convenient way to tell you which package to install to make a given
17 firmware file available when the kernel is looking for it. This can
18 be done using apt-file too, but that is for someone else to blog
21 <p
>Here is a small recipe to find the package with a given firmware
22 file, in this example I am looking for ctfw-
3.2.3.0.bin, randomly
23 picked from the set of firmware announced using appstream in Debian
24 unstable. In general you would be looking for the firmware requested
25 by the kernel during kernel module loading. To find the package
26 providing the example file, do like this:
</p
>
28 <blockquote
><pre
>
29 % apt install appstream
33 % appstreamcli what-provides firmware:runtime ctfw-
3.2.3.0.bin | \
34 awk
'/Package:/ {print $
2}
'
37 </pre
></blockquote
>
39 <p
>See
<a href=
"https://wiki.debian.org/AppStream/Guidelines
">the
40 appstream wiki
</a
> page to learn how to embed the package metadata in
41 a way appstream can use.
</p
>
43 <p
>This same approach can be used to find any package supporting a
44 given MIME type. This is very useful when you get a file you do not
45 know how to handle. First find the mime type using
<tt
>file
46 --mime-type
</tt
>, and next look up the package providing support for
47 it. Lets say you got an SVG file. Its MIME type is image/svg+xml,
48 and you can find all packages handling this type like this:
</p
>
50 <blockquote
><pre
>
51 % apt install appstream
55 % appstreamcli what-provides mimetype image/svg+xml | \
56 awk
'/Package:/ {print $
2}
'
78 </pre
></blockquote
>
80 <p
>I believe the MIME types are fetched from the desktop file for
81 packages providing appstream metadata.
</p
>