]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mime: register confext/sysext images in shared-mime-info
authorLennart Poettering <lennart@poettering.net>
Mon, 20 Nov 2023 10:51:47 +0000 (11:51 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 6 Dec 2023 21:11:21 +0000 (22:11 +0100)
This make them recognized by file managers and stuff. Maybe one day we
should properly register mime types in the "vnd." namespace with IANA,
but I am too lazy to deal with the bureaucracy for that, hence let's
stick with the x. namespace for now.

This defines confext/sysext DDIs as subtype of:

https://www.iana.org/assignments/media-types/application/vnd.efi.img

Which is what everyone appears to use for raw disk images, in particular
if they contain a GPT partition table.

meson.build
mime/io.systemd.xml [new file with mode: 0644]
mime/meson.build [new file with mode: 0644]

index 56bdc39c3dcb4a94c6aa915d9c1acc312bc9a64b..06033b8b627dde326ddd28fc2cc1c7c6192fb21a 100644 (file)
@@ -176,6 +176,7 @@ repartdefinitionsdir = libexecdir / 'repart/definitions'
 ntpservicelistdir = prefixdir / 'lib/systemd/ntp-units.d'
 credstoredir = prefixdir / 'lib/credstore'
 pcrlockdir = prefixdir / 'lib/pcrlock.d'
+mimepackagesdir = prefixdir / 'share/mime/packages'
 
 configfiledir = get_option('configfiledir')
 if configfiledir == ''
@@ -2236,6 +2237,8 @@ subdir('src/fuzz')
 subdir('src/ukify/test')  # needs to be last for test_env variable
 subdir('test/fuzz')
 
+subdir('mime')
+
 alias_target('devel', libsystemd_pc, libudev_pc, systemd_pc, udev_pc)
 
 ############################################################
diff --git a/mime/io.systemd.xml b/mime/io.systemd.xml
new file mode 100644 (file)
index 0000000..8b95cef
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+  <mime-type type="application/x.systemd-sysext">
+    <sub-class-of type="application/vnd.efi.img"/>
+    <comment>System Extension DDI</comment>
+    <glob pattern="*.sysext.raw"/>
+  </mime-type>
+  <mime-type type="application/x.systemd-confext">
+    <sub-class-of type="application/vnd.efi.img"/>
+    <comment>Configuration Extension DDI</comment>
+    <glob pattern="*.confext.raw"/>
+  </mime-type>
+</mime-info>
diff --git a/mime/meson.build b/mime/meson.build
new file mode 100644 (file)
index 0000000..17bc043
--- /dev/null
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+install_data('io.systemd.xml', install_dir : mimepackagesdir)