]> pere.pagekite.me Git - homepage.git/commitdiff
New blog post.
authorPetter Reinholdtsen <pere@hungry.com>
Thu, 4 Feb 2016 15:40:48 +0000 (16:40 +0100)
committerPetter Reinholdtsen <pere@hungry.com>
Thu, 4 Feb 2016 15:40:48 +0000 (16:40 +0100)
blog/data/2016-02-04-appstream-firmware.txt [new file with mode: 0644]

diff --git a/blog/data/2016-02-04-appstream-firmware.txt b/blog/data/2016-02-04-appstream-firmware.txt
new file mode 100644 (file)
index 0000000..93c3daf
--- /dev/null
@@ -0,0 +1,71 @@
+Title: Using appstream in Debian to locate packages with firmware and mime type support
+Tags: english, debian
+Date: 2016-02-04 16:40
+
+<p>The <a href="https://wiki.debian.org/DEP-11">appstream system</a> is
+taking shape in Debian, and one feature set that is very convenient is
+its ability to tell you want package to install to get a given
+firmware file.  This can be done using apt-file too, but that is for
+someone else to blog about. :)</p>
+
+<p>Here is a small recipe to find the package with a given firmware
+file, in this example I am looking for ctfw-3.2.3.0.bin, randomly
+picked from the set of firmware announced using appstream in Debian
+unstable.  In general you would be looking for the firmware requested
+by the kernel during kernel module loading.  To find the package
+providing the example file, do like this:</p>
+
+<blockquote><pre>
+% apt install appstream
+[...]
+% apt update
+[...]
+% appstreamcli what-provides firmware:runtime ctfw-3.2.3.0.bin | \
+  awk '/Package:/ {print $2}'
+firmware-qlogic
+%
+</pre></blockquote>
+
+<p>See <a href="https://wiki.debian.org/AppStream/Guidelines">the
+appstream wiki</a> page to learn how to embed the package metadata in
+a way appstream can use.</p>
+
+<p>This same approach can be used to find any package supporting a
+given MIME type.  This is very useful when you get a file you do not
+know how to handle.  First find the mime type using <tt>file
+--mime-type</tt>, and next look up the package providing support for
+it.  Lets say you got an SVG file.  Its MIME type is image/svg+xml,
+and you can find all packages handling this type like this:</p>
+
+<blockquote><pre>
+% apt install appstream
+[...]
+% apt update
+[...]
+% appstreamcli what-provides mimetype image/svg+xml | \
+  awk '/Package:/ {print $2}'
+bkchem
+phototonic
+inkscape
+shutter
+tetzle
+geeqie
+xia
+pinta
+gthumb
+karbon
+comix
+mirage
+viewnior
+postr
+ristretto
+kolourpaint4
+eog
+eom
+gimagereader
+midori
+%
+</pre></blockquote>
+
+<p>I believe the MIME types are fetched from the desktop file for
+packages providing appstream metadata.</p>