summaryrefslogtreecommitdiffstats
path: root/src/shared/os-util.h
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-01-10 23:54:15 +0100
committerLennart Poettering <lennart@poettering.net>2021-01-19 13:41:42 +0100
commit6ddd05119383d998a69d8c9ce66e27dbb78c40cf (patch)
treedcf3091fe21f631b97879d5e148e07e1a2b12db4 /src/shared/os-util.h
parentsysext: add verity boilerplate (diff)
downloadsystemd-6ddd05119383d998a69d8c9ce66e27dbb78c40cf.tar.xz
systemd-6ddd05119383d998a69d8c9ce66e27dbb78c40cf.zip
os-release: add support for /usr/lib/extension-release.d/
Add helpers to look for extension-release.$NAME files in /usr/lib/extension-release.d/ following the same pattern as os-release.
Diffstat (limited to '')
-rw-r--r--src/shared/os-util.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/shared/os-util.h b/src/shared/os-util.h
index 1d9b0b146b..5b724eb7ac 100644
--- a/src/shared/os-util.h
+++ b/src/shared/os-util.h
@@ -5,9 +5,19 @@
int path_is_os_tree(const char *path);
-int open_os_release(const char *root, char **ret_path, int *ret_fd);
-int fopen_os_release(const char *root, char **ret_path, FILE **ret_file);
+/* The *_extension_release flavours will look for /usr/lib/extension-release/extension-release.NAME
+ * in accordance with the OS extension specification, rather than for /usr/lib/ or /etc/os-release. */
+int open_extension_release(const char *root, const char *extension, char **ret_path, int *ret_fd);
+static inline int open_os_release(const char *root, char **ret_path, int *ret_fd) {
+ return open_extension_release(root, NULL, ret_path, ret_fd);
+}
+int fopen_extension_release(const char *root, const char *extension, char **ret_path, FILE **ret_file);
+static inline int fopen_os_release(const char *root, char **ret_path, FILE **ret_file) {
+ return fopen_extension_release(root, NULL, ret_path, ret_file);
+}
+
+int parse_extension_release(const char *root, const char *extension, ...) _sentinel_;
int parse_os_release(const char *root, ...) _sentinel_;
int load_os_release_pairs(const char *root, char ***ret);
int load_os_release_pairs_with_prefix(const char *root, const char *prefix, char ***ret);