summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-04-05 12:13:44 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-04-05 13:48:38 +0200
commitbd44566c4d504237b25202a1104f67032c826f2d (patch)
tree510f050ac2fde81d3bdd68ac8d1a09ebf1bd116b
parent38df8d3f521c8d76c507c092f4a8e4bb84f9f48a (diff)
downloadsystemd-bd44566c4d504237b25202a1104f67032c826f2d.tar.gz
tree-wide: use SD_ID128_UUID_FORMAT_STR as appropriate
-rw-r--r--src/boot/bootctl.c10
-rw-r--r--src/shared/efivars.c2
-rw-r--r--src/shared/id128-print.c2
3 files changed, 8 insertions, 6 deletions
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c
index a7de3800fc..0595f873f0 100644
--- a/src/boot/bootctl.c
+++ b/src/boot/bootctl.c
@@ -220,7 +220,7 @@ static int status_binaries(const char *esp_path, sd_id128_t partition) {
printf(" ESP: %s", esp_path);
if (!sd_id128_is_null(partition))
- printf(" (/dev/disk/by-partuuid/%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x)", SD_ID128_FORMAT_VAL(partition));
+ printf(" (/dev/disk/by-partuuid/" SD_ID128_UUID_FORMAT_STR ")", SD_ID128_FORMAT_VAL(partition));
printf("\n");
r = enumerate_binaries(esp_path, "EFI/systemd", NULL);
@@ -262,7 +262,8 @@ static int print_efi_option(uint16_t id, bool in_order) {
printf(" Title: %s%s%s\n", ansi_highlight(), strna(title), ansi_normal());
printf(" ID: 0x%04X\n", id);
printf(" Status: %sactive%s\n", active ? "" : "in", in_order ? ", boot-order" : "");
- printf(" Partition: /dev/disk/by-partuuid/%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n", SD_ID128_FORMAT_VAL(partition));
+ printf(" Partition: /dev/disk/by-partuuid/" SD_ID128_UUID_FORMAT_STR "\n",
+ SD_ID128_FORMAT_VAL(partition));
printf(" File: %s%s\n", special_glyph(SPECIAL_GLYPH_TREE_RIGHT), path);
printf("\n");
@@ -380,7 +381,8 @@ static int status_entries(
printf("Boot Loader Entries:\n"
" $BOOT: %s", dollar_boot_path);
if (!sd_id128_is_null(dollar_boot_partition_uuid))
- printf(" (/dev/disk/by-partuuid/%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x)", SD_ID128_FORMAT_VAL(dollar_boot_partition_uuid));
+ printf(" (/dev/disk/by-partuuid/" SD_ID128_UUID_FORMAT_STR ")",
+ SD_ID128_FORMAT_VAL(dollar_boot_partition_uuid));
printf("\n\n");
r = boot_entries_load_config(esp_path, xbootldr_path, &config);
@@ -1150,7 +1152,7 @@ static int verb_status(int argc, char *argv[], void *userdata) {
if (stub)
printf(" Stub: %s\n", stub);
if (!sd_id128_is_null(loader_part_uuid))
- printf(" ESP: /dev/disk/by-partuuid/%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",
+ printf(" ESP: /dev/disk/by-partuuid/" SD_ID128_UUID_FORMAT_STR "\n",
SD_ID128_FORMAT_VAL(loader_part_uuid));
else
printf(" ESP: n/a\n");
diff --git a/src/shared/efivars.c b/src/shared/efivars.c
index 4f32163bba..875b8439e1 100644
--- a/src/shared/efivars.c
+++ b/src/shared/efivars.c
@@ -772,7 +772,7 @@ int efi_loader_get_device_part_uuid(sd_id128_t *u) {
if (r < 0)
return r;
- if (sscanf(p, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ if (sscanf(p, SD_ID128_UUID_FORMAT_STR,
&parsed[0], &parsed[1], &parsed[2], &parsed[3],
&parsed[4], &parsed[5], &parsed[6], &parsed[7],
&parsed[8], &parsed[9], &parsed[10], &parsed[11],
diff --git a/src/shared/id128-print.c b/src/shared/id128-print.c
index 1b20b8f644..febe3635ba 100644
--- a/src/shared/id128-print.c
+++ b/src/shared/id128-print.c
@@ -33,7 +33,7 @@ int id128_pretty_print(sd_id128_t id, bool pretty) {
printf("As string:\n"
"%s" SD_ID128_FORMAT_STR "%s\n\n"
"As UUID:\n"
- "%s%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%s\n\n"
+ "%s" SD_ID128_UUID_FORMAT_STR "%s\n\n"
"As %s macro:\n"
"%s#define MESSAGE_XYZ SD_ID128_MAKE(",
on, SD_ID128_FORMAT_VAL(id), off,