/src/rauc/include/artifacts_composefs.h
Line | Count | Source |
1 | | #pragma once |
2 | | |
3 | | #include <glib.h> |
4 | | |
5 | | #include "artifacts.h" |
6 | | |
7 | | #if ENABLE_COMPOSEFS |
8 | | /** |
9 | | * Scan the composefs repo on disk for installed artifacts and load their |
10 | | * information. |
11 | | * |
12 | | * This also scans the object store. |
13 | | * |
14 | | * @param repo RArtifactRepo to prepare |
15 | | * @param error a GError, or NULL |
16 | | * |
17 | | * @return TRUE if the preparation was successful, otherwise FALSE |
18 | | * |
19 | | */ |
20 | | gboolean r_composefs_artifact_repo_prepare(RArtifactRepo *repo, GError **error) |
21 | | G_GNUC_WARN_UNUSED_RESULT; |
22 | | |
23 | | /** |
24 | | * Remove unreferenced artifacts and inconsistent data such as partial |
25 | | * downloads. |
26 | | * |
27 | | * This also removes unused objects from the object store. |
28 | | * |
29 | | * @param repo RArtifactRepo to prune |
30 | | * @param error a GError, or NULL |
31 | | * |
32 | | * @return TRUE if the pruning was successful, otherwise FALSE |
33 | | */ |
34 | | gboolean r_composefs_artifact_repo_prune(RArtifactRepo *repo, GError **error) |
35 | | G_GNUC_WARN_UNUSED_RESULT; |
36 | | |
37 | | /** |
38 | | * Install a composefs artifact from the bundle into the repo. |
39 | | * |
40 | | * This also copies missing objects from the bundle into the local object store. |
41 | | * |
42 | | * @param artifact RArtifact to install to |
43 | | * @param image RaucImage to install from |
44 | | * @param name the converted directory name in the bundle |
45 | | * @param error a GError, or NULL |
46 | | * |
47 | | * @return TRUE if the installation was successful, otherwise FALSE |
48 | | */ |
49 | | gboolean r_composefs_artifact_install(const RArtifact *artifact, const RaucImage *image, const gchar *name, GError **error) |
50 | | G_GNUC_WARN_UNUSED_RESULT; |
51 | | #else |
52 | | static inline gboolean r_composefs_artifact_repo_prepare(RArtifactRepo *repo, GError **error) |
53 | 0 | { |
54 | 0 | g_error("composefs support not enabled at compile time"); |
55 | 0 | return FALSE; |
56 | 0 | } |
57 | | |
58 | | static inline gboolean r_composefs_artifact_repo_prune(RArtifactRepo *repo, GError **error) |
59 | 0 | { |
60 | 0 | g_error("composefs support not enabled at compile time"); |
61 | 0 | return FALSE; |
62 | 0 | } |
63 | | |
64 | | static inline gboolean r_composefs_artifact_install(const RArtifact *artifact, const RaucImage *image, const gchar *name, GError **error) |
65 | 0 | { |
66 | 0 | g_error("composefs support not enabled at compile time"); |
67 | 0 | return FALSE; |
68 | 0 | } |
69 | | #endif |