summaryrefslogtreecommitdiff
path: root/src/shared/dissect-image.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-11-14 23:22:46 +0100
committerLennart Poettering <lennart@poettering.net>2017-11-20 16:43:15 +0100
commit3b925504172e2c3ca8bb071fb8b6849520abd118 (patch)
tree280f2c19b79cdfabd30a0179e761a23eb47ca410 /src/shared/dissect-image.h
parentb302a50d852b33efe018cd7cd3d47799b1ec094b (diff)
downloadsystemd-3b925504172e2c3ca8bb071fb8b6849520abd118.tar.gz
dissect: add an API that can read various metadata bits out of a dissected image
We focus on four kinds of metadata: 1. /etc/hostname 2. /etc/machine-id 3. /etc/machine-info 4. /etc/os-release or /usr/lib/os-release This makes dissected images nicely self-contained as we can figure out what they are just by dissecting them.
Diffstat (limited to 'src/shared/dissect-image.h')
-rw-r--r--src/shared/dissect-image.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shared/dissect-image.h b/src/shared/dissect-image.h
index 20afbb5bf6..30a12cb540 100644
--- a/src/shared/dissect-image.h
+++ b/src/shared/dissect-image.h
@@ -77,7 +77,13 @@ struct DissectedImage {
bool encrypted:1;
bool verity:1; /* verity available and usable */
bool can_verity:1; /* verity available, but not necessarily used */
+
DissectedPartition partitions[_PARTITION_DESIGNATOR_MAX];
+
+ char *hostname;
+ sd_id128_t machine_id;
+ char **machine_info;
+ char **os_release;
};
int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectImageFlags flags, DissectedImage **ret);
@@ -89,6 +95,8 @@ int dissected_image_decrypt(DissectedImage *m, const char *passphrase, const voi
int dissected_image_decrypt_interactively(DissectedImage *m, const char *passphrase, const void *root_hash, size_t root_hash_size, DissectImageFlags flags, DecryptedImage **ret);
int dissected_image_mount(DissectedImage *m, const char *dest, DissectImageFlags flags);
+int dissected_image_acquire_metadata(DissectedImage *m);
+
DecryptedImage* decrypted_image_unref(DecryptedImage *p);
DEFINE_TRIVIAL_CLEANUP_FUNC(DecryptedImage*, decrypted_image_unref);
int decrypted_image_relinquish(DecryptedImage *d);