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