diff options
author | Lennart Poettering <lennart@poettering.net> | 2024-01-23 11:48:55 +0100 |
---|---|---|
committer | Mike Yuan <me@yhndnzj.com> | 2024-01-23 18:33:48 +0100 |
commit | 9603fd29f866e45d33b5c5856f531bf17683b06c (patch) | |
tree | 912b60b22a60837e5b39b4765b64ba196ffb3e86 /src/dissect | |
parent | unit: systemd-creds.socket is statically enabled, hence drop [Install] (diff) | |
download | systemd-9603fd29f866e45d33b5c5856f531bf17683b06c.tar.xz systemd-9603fd29f866e45d33b5c5856f531bf17683b06c.zip |
dissect: show image name separately from filename
If the image name is different from the filename then show it in the
output, since it's relevant for finding sysext/confext release files.
(Image name is typically the filename without the ".raw" suffix and
similar).
Diffstat (limited to 'src/dissect')
-rw-r--r-- | src/dissect/dissect.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index f6a8161d40..4e44a23793 100644 --- a/src/dissect/dissect.c +++ b/src/dissect/dissect.c @@ -829,7 +829,7 @@ static int action_dissect(DissectedImage *m, LoopDevice *d) { pager_open(arg_pager_flags); if (arg_json_format_flags & JSON_FORMAT_OFF) { - printf(" Name: %s%s%s\n", + printf(" File Name: %s%s%s\n", ansi_highlight(), bn, ansi_normal()); printf(" Size: %s\n", @@ -860,6 +860,9 @@ static int action_dissect(DissectedImage *m, LoopDevice *d) { return log_error_errno(r, "Failed to acquire image metadata: %m"); else if (arg_json_format_flags & JSON_FORMAT_OFF) { + if (m->image_name && !streq(m->image_name, bn)) + printf("Image Name: %s\n", m->image_name); + if (!sd_id128_is_null(m->image_uuid)) printf("Image UUID: %s\n", SD_ID128_TO_UUID_STRING(m->image_uuid)); |