summaryrefslogtreecommitdiff
path: root/src/sysupdate/sysupdate-transfer.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-12-28 15:17:54 +0100
committerLennart Poettering <lennart@poettering.net>2022-03-19 00:13:55 +0100
commit43cc7a3ef4f6a89946e7ffd6a3112a0c1740b1ef (patch)
tree719c7e2eeba27fbfbf45141fa1f65e2d41b4e9e7 /src/sysupdate/sysupdate-transfer.h
parent40f35786b0030f1f7c4b88828776ada1dd74d03e (diff)
downloadsystemd-43cc7a3ef4f6a89946e7ffd6a3112a0c1740b1ef.tar.gz
sysupdate: add new component "sysupdate"
Diffstat (limited to 'src/sysupdate/sysupdate-transfer.h')
-rw-r--r--src/sysupdate/sysupdate-transfer.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/sysupdate/sysupdate-transfer.h b/src/sysupdate/sysupdate-transfer.h
new file mode 100644
index 0000000000..b0c2a6e455
--- /dev/null
+++ b/src/sysupdate/sysupdate-transfer.h
@@ -0,0 +1,62 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include <inttypes.h>
+#include <stdbool.h>
+#include <sys/types.h>
+
+#include "sd-id128.h"
+
+/* Forward declare this type so that the headers below can use it */
+typedef struct Transfer Transfer;
+
+#include "sysupdate-partition.h"
+#include "sysupdate-resource.h"
+
+struct Transfer {
+ char *definition_path;
+ char *min_version;
+ char **protected_versions;
+ char *current_symlink;
+ bool verify;
+
+ Resource source, target;
+
+ uint64_t instances_max;
+ bool remove_temporary;
+
+ /* When creating a new partition/file, optionally override these attributes explicitly */
+ sd_id128_t partition_uuid;
+ bool partition_uuid_set;
+ uint64_t partition_flags;
+ bool partition_flags_set;
+ mode_t mode;
+ uint64_t tries_left, tries_done;
+ int no_auto;
+ int read_only;
+ int growfs;
+
+ /* If we create a new file/dir/subvol in the fs, the temporary and final path we create it under, as well as the read-only flag for it */
+ char *temporary_path;
+ char *final_path;
+ int install_read_only;
+
+ /* If we write to a partition in a partition table, the metrics of it */
+ PartitionInfo partition_info;
+ PartitionChange partition_change;
+};
+
+Transfer *transfer_new(void);
+
+Transfer *transfer_free(Transfer *t);
+DEFINE_TRIVIAL_CLEANUP_FUNC(Transfer*, transfer_free);
+
+int transfer_read_definition(Transfer *t, const char *path);
+
+int transfer_resolve_paths(Transfer *t, const char *root, const char *node);
+
+int transfer_vacuum(Transfer *t, uint64_t space, const char *extra_protected_version);
+
+int transfer_acquire_instance(Transfer *t, Instance *i);
+
+int transfer_install_instance(Transfer *t, Instance *i, const char *root);