summaryrefslogtreecommitdiff
path: root/src/shared/dissect-image.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-12-15 17:17:43 +0100
committerLennart Poettering <lennart@poettering.net>2016-12-21 19:09:30 +0100
commitbe30ad41ffd796ba40a5026b4963c17f04cc334d (patch)
tree56f7744a8d8fc0d3cf6bfdcc1223199f5cbfc94a /src/shared/dissect-image.c
parent01af8c019a33eb3882f17e3b65e30c4a924fed2a (diff)
dissect: return the GPT partition UUID, too
This is useful as we can match up the EFI UUID with the one the firmware supposedly used.
Diffstat (limited to 'src/shared/dissect-image.c')
-rw-r--r--src/shared/dissect-image.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c
index 10d53eab45..5b6e78dd3d 100644
--- a/src/shared/dissect-image.c
+++ b/src/shared/dissect-image.c
@@ -95,6 +95,7 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectI
_cleanup_blkid_free_probe_ blkid_probe b = NULL;
_cleanup_udev_unref_ struct udev *udev = NULL;
_cleanup_free_ char *generic_node = NULL;
+ sd_id128_t generic_uuid = SD_ID128_NULL;
const char *pttype = NULL;
struct udev_list_entry *first, *item;
blkid_partlist pl;
@@ -427,6 +428,7 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectI
else {
generic_nr = nr;
generic_rw = !(pflags & GPT_FLAG_READ_ONLY);
+ generic_uuid = id;
generic_node = strdup(node);
if (!generic_node)
return -ENOMEM;
@@ -457,6 +459,7 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectI
.architecture = architecture,
.node = n,
.fstype = t,
+ .uuid = id,
};
n = t = NULL;
@@ -507,6 +510,7 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectI
.partno = generic_nr,
.architecture = _ARCHITECTURE_INVALID,
.node = generic_node,
+ .uuid = generic_uuid,
};
generic_node = NULL;