From: Petter Reinholdtsen Date: Thu, 4 Feb 2016 15:40:48 +0000 (+0100) Subject: New blog post. X-Git-Url: http://pere.pagekite.me/gitweb/homepage.git/commitdiff_plain/7edd3b085c148018326e69bdba0f72242f784f6b New blog post. --- diff --git a/blog/data/2016-02-04-appstream-firmware.txt b/blog/data/2016-02-04-appstream-firmware.txt new file mode 100644 index 0000000000..93c3daf9d6 --- /dev/null +++ b/blog/data/2016-02-04-appstream-firmware.txt @@ -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 + +

The appstream system 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. :)

+ +

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:

+ +
+% apt install appstream
+[...]
+% apt update
+[...]
+% appstreamcli what-provides firmware:runtime ctfw-3.2.3.0.bin | \
+  awk '/Package:/ {print $2}'
+firmware-qlogic
+%
+
+ +

See the +appstream wiki page to learn how to embed the package metadata in +a way appstream can use.

+ +

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 file +--mime-type, 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:

+ +
+% 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
+%
+
+ +

I believe the MIME types are fetched from the desktop file for +packages providing appstream metadata.