Skip to content

Commit 40c82a4

Browse files
authored
Merge pull request #88 from poettering/ddi-suffix-mime
ddi-spec: define suggested suffixes, mime types, sector sizes for DDIs
2 parents 898872d + 68dd1d9 commit 40c82a4

2 files changed

Lines changed: 28 additions & 9 deletions

File tree

specs/discoverable_disk_image.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,31 @@ SPDX-License-Identifier: CC-BY-4.0
77
---
88
# Discoverable Disk Image (DDI)
99

10-
DDIs (Discoverable Disk Images) are self-describing file system images that follow the DPS
11-
([Discoverable Partitions Specification](discoverable_partitions_specification.md)), wrapped in a GPT
12-
partition table, that may contain root (or `/usr/`) filesystems, system extensions, configuration extensions,
13-
portable services, containers and more, and are all protected by signed dm-verity all combined into one.
14-
They are designed to be composable and stackable, and provide security by default.
10+
DDIs (Discoverable Disk Images) are self-describing file system images that follow the DPS ([Discoverable
11+
Partitions Specification](discoverable_partitions_specification.md)), wrapped in a GPT partition table, that
12+
may contain root (or `/usr/`) filesystems for bootable OS images, system extensions, configuration
13+
extensions, portable services, containers and more, and shall be protected by signed `dm-verity` all combined
14+
into one. They are designed to be composable and stackable, and provide security by default.
1515

1616
## Image Format
1717
The images use the GPT partition table verbatim, so it will not be redefined here. Each partition contains
18-
a standard Linux filesystem (e.g.: squashfs), so again this will not be redefined here.
18+
a standard Linux filesystem (e.g.: `erofs`), so again this will not be redefined here.
1919
The [DPS](discoverable_partitions_specification.md) defines the GUIDs to use and the format of the
20-
dm-verity signature partition's JSON content.
20+
`dm-verity` signature partition's JSON content.
21+
22+
It is recommended to use a sector size of 512 bytes or 4096 for DDIs. Software operating with DDIs should
23+
automatically derive the sector size used for a DDI by looking for the `EFI PART` magic string at offsets 512
24+
or 4096, as per GPT specification.
25+
26+
## Naming
27+
28+
DDIs should use `.raw` as file suffix. A secondary suffix may be used to clarify the specific usage class of
29+
a DDI. For now the two secondary suffixes `.sysext.raw` and `.confext.raw` are defined (for system extension
30+
DDIs and configuration extension DDIs, see [Extension
31+
Images](https://uapi-group.org/specifications/specs/extension_image) for details).
32+
33+
The MIME type for DDIs is `application/vnd.efi.img`, [as per
34+
IANA](https://www.iana.org/assignments/media-types/application/vnd.efi.img).
2135

2236
## Image Version
2337
If the DDI is versioned, the version format described in the

specs/extension_image.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ to identify them.
3838
Extension Images should be additive, and not override content present in the base image or other DDIs,
3939
but this will not be enforced.
4040

41+
## File Suffix
42+
Since extensions images are DDIs, they should carry the `.raw` suffix. In order to make discerning system
43+
extensions and configuration extensions easy it is recommended to use the `.sysext.raw` suffix for system
44+
extensions, and `.confext.raw` for configuration extensions.
45+
4146
## Identification
4247
An Extension Image must contain a `extension-release.<IMAGE>` file, where `<IMAGE>` must either match the
4348
name of the sysext minus the suffix, or alternatively `extension-release.<IMAGE>` must be tagged with a
@@ -64,7 +69,7 @@ Examples: `"SYSEXT_LEVEL=2"`, `"CONFEXT_LEVEL=15.14"`.
6469

6570
If not present, and if `VERSION_ID=` is present instead, then this will be checked instead.
6671

67-
#### `VERSION_ID=` `ID=` `ARCHITECTURE=`
72+
#### `VERSION_ID=`, `ID=`, `ARCHITECTURE=`
6873
`VERSION_ID=` and `ID=` are used to match the Extension Image with the root DDI, and `ARCHITECTURE=` is used
6974
to match with the host's CPU architecture, as defined in the
7075
[`os-release` specification](https://www.freedesktop.org/software/systemd/man/os-release.html).
@@ -79,7 +84,7 @@ can be used to also identify the sysext itself, by prefixing them with `SYSEXT_`
7984
There are also extension-specific fields that do not apply to 'os-release', `SYSEXT_SCOPE=`,
8085
`CONFEXT_SCOPE=` and `ARCHITECTURE=`.
8186

82-
#### `SYSEXT_SCOPE=` `CONFEXT_SCOPE=`
87+
#### `SYSEXT_SCOPE=`, `CONFEXT_SCOPE=`
8388
Takes a space-separated list of one or more of the strings `"system"`, `"initrd"` and `"portable"`. This field
8489
is optional and indicates what environments the system extension is applicable to: i.e. to regular systems,
8590
to initrds, or to [portable service images](https://systemd.io/PORTABLE_SERVICES/). If unspecified,

0 commit comments

Comments
 (0)