diff --git a/man/rules/meson.build b/man/rules/meson.build
index 1cfb54723a..0f6519106a 100644
--- a/man/rules/meson.build
+++ b/man/rules/meson.build
@@ -125,6 +125,7 @@ manpages = [
'SD_ID128_FORMAT_VAL',
'SD_ID128_MAKE',
'SD_ID128_MAKE_STR',
+ 'SD_ID128_MAKE_UUID_STR',
'SD_ID128_NULL',
'SD_ID128_UUID_FORMAT_STR',
'sd_id128_equal',
diff --git a/man/sd-id128.xml b/man/sd-id128.xml
index 716c62522d..891a4585c6 100644
--- a/man/sd-id128.xml
+++ b/man/sd-id128.xml
@@ -24,6 +24,7 @@
SD_ID128_FORMAT_VAL
SD_ID128_MAKE
SD_ID128_MAKE_STR
+ SD_ID128_MAKE_UUID_STR
SD_ID128_NULL
SD_ID128_UUID_FORMAT_STR
sd_id128_equal
@@ -121,10 +122,12 @@ int main(int argc, char **argv) {
return 0;
}
- SD_ID128_UUID_FORMAT_STR is similar to
- SD_ID128_FORMAT_STR but includes separating hyphens to conform to the "canonical
- representation". This formats the string based on SD_ID128_UUID_FORMAT_STR and SD_ID128_MAKE_UUID_STR()
+ are similar to
+ SD_ID128_FORMAT_STR and SD_ID128_MAKE_STR(),
+ but include separating hyphens to conform to the
+ "canonical representation".
+ They format the string based on RFC4122 Variant 1 rules, i.e. converting from Big
Endian byte order. This matches behaviour of most other Linux userspace infrastructure. It's probably
best to avoid UUIDs of other variants, in order to avoid unnecessary ambiguities. All 128-bit IDs
diff --git a/src/systemd/sd-id128.h b/src/systemd/sd-id128.h
index 90d4bbf14e..f2dd7357f8 100644
--- a/src/systemd/sd-id128.h
+++ b/src/systemd/sd-id128.h
@@ -107,6 +107,9 @@ int sd_id128_get_boot_app_specific(sd_id128_t app_id, sd_id128_t *ret);
#define SD_ID128_MAKE_STR(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) \
#a #b #c #d #e #f #g #h #i #j #k #l #m #n #o #p
+#define SD_ID128_MAKE_UUID_STR(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) \
+ #a #b #c #d "-" #e #f "-" #g #h "-" #i #j "-" #k #l #m #n #o #p
+
_sd_pure_ static __inline__ int sd_id128_equal(sd_id128_t a, sd_id128_t b) {
return memcmp(&a, &b, 16) == 0;
}