mime: register confext/sysext images in shared-mime-info

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.
This commit is contained in:
Lennart Poettering 2023-11-20 11:51:47 +01:00
parent 7e3607996a
commit eb981a5b9b
3 changed files with 19 additions and 0 deletions

View 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)
############################################################

13
mime/io.systemd.xml Normal file
View file

@ -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>

3
mime/meson.build Normal file
View file

@ -0,0 +1,3 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
install_data('io.systemd.xml', install_dir : mimepackagesdir)