A %NULL-terminated array of #OstreeCollectionRef instances, designed to
be used with g_auto():
|[<!-- language="C" -->
g_auto(OstreeCollectionRefv) refs = NULL;
]|
A %NULL-terminated array of #OstreeRepoFinderResult instances, designed to
be used with g_auto():
|[<!-- language="C" -->
g_auto(OstreeRepoFinderResultv) results = NULL;
]|
A new progress object
Atomically copies all the state from @self to @dest, without invoking the
callback.
This is used for proxying progress objects across different #GMainContexts.
An #OstreeAsyncProgress to copy from
An #OstreeAsyncProgress to copy to
Process any pending signals, ensuring the main context is cleared
of sources used by this object. Also ensures that no further
events will be queued.
Self
Get the values corresponding to zero or more keys from the
#OstreeAsyncProgress. Each key is specified in @... as the key name, followed
by a #GVariant format string, followed by the necessary arguments for that
format string, just as for g_variant_get(). After those arguments is the
next key name. The varargs list must be %NULL-terminated.
Each format string must make deep copies of its value, as the values stored
in the #OstreeAsyncProgress may be freed from another thread after this
function returns.
This operation is thread-safe, and all the keys are queried atomically.
|[<!-- language="C" -->
guint32 outstanding_fetches;
guint64 bytes_received;
g_autofree gchar *status = NULL;
g_autoptr(GVariant) refs_variant = NULL;
ostree_async_progress_get (progress,
"outstanding-fetches", "u", &outstanding_fetches,
"bytes-received", "t", &bytes_received,
"status", "s", &status,
"refs", "@a{ss}", &refs_variant,
NULL);
]|
an #OstreeAsyncProgress
key name, format string, #GVariant return locations, …, followed by %NULL
Get the human-readable status string from the #OstreeAsyncProgress. This
operation is thread-safe. The retuned value may be %NULL if no status is
set.
This is a convenience function to get the well-known `status` key.
the current status, or %NULL if none is set
an #OstreeAsyncProgress
Look up a key in the #OstreeAsyncProgress and return the #GVariant associated
with it. The lookup is thread-safe.
value for the given @key, or %NULL if
it was not set
an #OstreeAsyncProgress
a key to look up
Set the values for zero or more keys in the #OstreeAsyncProgress. Each key is
specified in @... as the key name, followed by a #GVariant format string,
followed by the necessary arguments for that format string, just as for
g_variant_new(). After those arguments is the next key name. The varargs list
must be %NULL-terminated.
g_variant_ref_sink() will be called as appropriate on the #GVariant
parameters, so they may be floating.
This operation is thread-safe, and all the keys are set atomically.
|[<!-- language="C" -->
guint32 outstanding_fetches = 15;
guint64 bytes_received = 1000;
ostree_async_progress_set (progress,
"outstanding-fetches", "u", outstanding_fetches,
"bytes-received", "t", bytes_received,
"status", "s", "Updated status",
"refs", "@a{ss}", g_variant_new_parsed ("@a{ss} {}"),
NULL);
]|
an #OstreeAsyncProgress
key name, format string, #GVariant parameters, …, followed by %NULL
Set the human-readable status string for the #OstreeAsyncProgress. This
operation is thread-safe. %NULL may be passed to clear the status.
This is a convenience function to set the well-known `status` key.
an #OstreeAsyncProgress
new status string, or %NULL to clear the status
Assign a new @value to the given @key, replacing any existing value. The
operation is thread-safe. @value may be a floating reference;
g_variant_ref_sink() will be called on it.
Any watchers of the #OstreeAsyncProgress will be notified of the change if
@value differs from the existing value for @key.
an #OstreeAsyncProgress
a key to set
the value to assign to @key
Emitted when @self has been changed.
Whitespace separated set of features this libostree was configured with at build time.
Consult the source code in configure.ac (or the CLI `ostree --version`) for examples.
Copy of @self
Bootconfig to clone
Array of initrds or %NULL
if none are set.
Parser
Initialize a bootconfig from the given file.
Parser
Directory fd
File path
Cancellable
These are rendered as additional `initrd` keys in the final bootloader configs. The
base initrd is part of the primary keys.
Parser
Array of overlay
initrds or %NULL to unset.
Compile-time version checking. Evaluates to %TRUE if the version
of ostree is equal or greater than the required one.
required year version
required release version
GVariant type `s`. Intended to describe the CPU architecture. This is a freeform string, and some distributions
which have existing package managers might want to match that schema. If you
don't have a prior schema, it's recommended to use `uname -m` by default (i.e. the Linux kernel schema). In the future
ostree might include a builtin function to compare architectures.
GVariant type `s`. If this is added to a commit, `ostree_repo_pull()`
will enforce that the commit was retrieved from a repository which has
the same collection ID. See `ostree_repo_set_collection_id()`.
This is most useful in concert with `OSTREE_COMMIT_META_KEY_REF_BINDING`,
as it more strongly binds the commit to the repository and branch.
GVariant type `s`. This metadata key is used to display vendor's message
when an update stream for a particular branch ends. It usually provides
update instructions for the users.
GVariant type `s`. Should contain a refspec defining a new target branch;
`ostree admin upgrade` and `OstreeSysrootUpgrader` will automatically initiate
a rebase upon encountering this metadata key.
GVariant type `as`; each element is a branch name. If this is added to a
commit, `ostree_repo_pull()` will enforce that the commit was retrieved from
one of the branch names in this array. This prevents "sidegrade" attacks.
The rationale for having this support multiple branch names is that it helps
support a "promotion" model of taking a commit and moving it between development
and production branches.
GVariant type `s`. This should hold a relatively short single line value
containing a human-readable "source" for a commit, intended to be displayed
near the origin ref. This is particularly useful for systems that inject
content into an OSTree commit from elsewhere - for example, generating from
an OCI or qcow2 image. Or if generating from packages, the enabled repository
names and their versions.
Try to keep this key short (e.g. < 80 characters) and human-readable; if you
desire machine readable data, consider injecting separate metadata keys.
GVariant type `s`. This metadata key is used for version numbers. A freeform
string; the intention is that systems using ostree do not interpret this
semantically as traditional package managers do.
This is the only ostree-defined metadata key that does not start with `ostree.`.
Flags influencing checksumming logic.
Default checksumming without tweaks.
(Since: 2017.13.)
Ignore xattrs when checksumming.
(Since: 2017.13.)
Use canonical uid/gid/mode
values, for bare-user-only mode. (Since: 2021.4.)
A structure which globally uniquely identifies a ref as the tuple
(@collection_id, @ref_name). For backwards compatibility, @collection_id may be %NULL,
indicating a ref name which is not globally unique.
collection ID which provided the ref, or %NULL if there
is no associated collection
ref name
Create a new #OstreeCollectionRef containing (@collection_id, @ref_name). If
@collection_id is %NULL, this is equivalent to a plain ref name string (not a
refspec; no remote name is included), which can be used for non-P2P
operations.
a new #OstreeCollectionRef
a collection ID, or %NULL for a plain ref
a ref name
Create a copy of the given @ref.
a newly allocated copy of @ref
an #OstreeCollectionRef
Free the given @ref.
an #OstreeCollectionRef
Copy an array of #OstreeCollectionRefs, including deep copies of all its
elements. @refs must be %NULL-terminated; it may be empty, but must not be
%NULL.
a newly allocated copy of @refs
%NULL-terminated array of #OstreeCollectionRefs
Compare @ref1 and @ref2 and return %TRUE if they have the same collection ID and
ref name, and %FALSE otherwise. Both @ref1 and @ref2 must be non-%NULL.
%TRUE if @ref1 and @ref2 are equal, %FALSE otherwise
an #OstreeCollectionRef
another #OstreeCollectionRef
Free the given array of @refs, including freeing all its elements. @refs
must be %NULL-terminated; it may be empty, but must not be %NULL.
an array of #OstreeCollectionRefs
Hash the given @ref. This function is suitable for use with #GHashTable.
@ref must be non-%NULL.
hash value for @ref
an #OstreeCollectionRef
Structure representing an entry in the "ostree.sizes" commit metadata. Each
entry corresponds to an object in the associated commit.
object checksum
object type
unpacked object size
compressed object size
Create a new #OstreeCommitSizesEntry for representing an object in a
commit's "ostree.sizes" metadata.
a new #OstreeCommitSizesEntry
object checksum
object type
unpacked object size
compressed object size
Create a copy of the given @entry.
a new copy of @entry
an #OstreeCommitSizesEntry
Free given @entry.
an #OstreeCommitSizesEntry
Complete the object write and return the checksum.
Checksum, or %NULL on error
Writer
Cancellable
New deployment
Global index into the bootloader entries
"stateroot" for this deployment
OSTree commit that will be deployed
Unique counter
Kernel/initrd checksum
Unique index
The intention of an origin file is primarily describe the "inputs" that
resulted in a deployment, and it's commonly used to derive the new state. For
example, a key value (in pure libostree mode) is the "refspec". However,
libostree (or other applications) may want to store "transient" state that
should not be carried across upgrades.
This function just removes all members of the `libostree-transient` group.
The name of that group is available to all libostree users; best practice
would be to prefix values underneath there with a short identifier for your
software.
Additionally, this function will remove the `origin/unlocked` and
`origin/override-commit` members; these should be considered transient state
that should have been under an explicit group.
An origin
Description of state
New deep copy of @self
Deployment
%TRUE if deployments have the same osname, csum, and deployserial
A deployment
A deployment
Boot configuration
Deployment
The global index into the bootloader ordering
Deployment
Origin
Deployment
Note this function only returns a *relative* path - if you want to
access, it, you must either use fd-relative api such as openat(),
or concatenate it with the full ostree_sysroot_get_path().
Path to deployment root directory, relative to sysroot
A deployment
An integer suitable for use in a `GHashTable`
Deployment
See ostree_sysroot_deployment_set_pinned().
`TRUE` if deployment will not be subject to GC
Deployment
`TRUE` if deployment should be "finalized" at shutdown time
Deployment
Set or clear the bootloader configuration.
Deployment
Bootloader configuration object
Should never have been made public API; don't use this.
Deployment
Don't use this
Sets the global index into the bootloader ordering.
Deployment
Index into bootloader ordering
Replace the "origin", which is a description of the source
of the deployment and how to update to the next version.
Deployment
Set the origin for this deployment
An extensible options structure controlling diff dirs. Make sure
that owner_uid/gid is set to -1 when not used. This is used by
ostree_diff_dirs_with_options().
Errors returned by signature creation and verification operations in OSTree.
These may be returned by any API which creates or verifies signatures.
A signature was expected, but not found.
A signature was malformed.
A signature was found, but was created with a key not in the configured keyrings.
A signature was expired. Since: 2020.1.
A signature was found, but the key used to
sign it has expired. Since: 2020.1.
A signature was found, but the key used to
sign it has been revoked. Since: 2020.1.
Signature attributes available from an #OstreeGpgVerifyResult.
The attribute's #GVariantType is shown in brackets.
[#G_VARIANT_TYPE_BOOLEAN] Is the signature valid?
[#G_VARIANT_TYPE_BOOLEAN] Has the signature expired?
[#G_VARIANT_TYPE_BOOLEAN] Has the signing key expired?
[#G_VARIANT_TYPE_BOOLEAN] Has the signing key been revoked?
[#G_VARIANT_TYPE_BOOLEAN] Is the signing key missing?
[#G_VARIANT_TYPE_STRING] Fingerprint of the signing key
[#G_VARIANT_TYPE_INT64] Signature creation Unix timestamp
[#G_VARIANT_TYPE_INT64] Signature expiration Unix timestamp (0 if no
expiration)
[#G_VARIANT_TYPE_STRING] Name of the public key algorithm used to create
the signature
[#G_VARIANT_TYPE_STRING] Name of the hash algorithm used to create the
signature
[#G_VARIANT_TYPE_STRING] The name of the signing key's primary user
[#G_VARIANT_TYPE_STRING] The email address of the signing key's primary
user
[#G_VARIANT_TYPE_STRING] Fingerprint of the signing key's primary key
(will be the same as OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT if the
the signature is already from the primary key rather than a subkey,
and will be the empty string if the key is missing.)
[#G_VARIANT_TYPE_INT64] Key expiration Unix timestamp (0 if no
expiration or if the key is missing)
[#G_VARIANT_TYPE_INT64] Key expiration Unix timestamp of the signing key's
primary key (will be the same as OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP
if the signing key is the primary key and 0 if no expiration or if the key
is missing)
Formatting flags for ostree_gpg_verify_result_describe(). Currently
there's only one possible output format, but this enumeration allows
for future variations.
Use the default output format
Similar to ostree_gpg_verify_result_describe() but takes a #GVariant of
all attributes for a GPG signature instead of an #OstreeGpgVerifyResult
and signature index.
The @variant <emphasis>MUST</emphasis> have been created by
ostree_gpg_verify_result_get_all().
a #GVariant from ostree_gpg_verify_result_get_all()
a #GString to hold the description
optional line prefix string
flags to adjust the description format
Counts all the signatures in @result.
signature count
an #OstreeGpgVerifyResult
Counts only the valid signatures in @result.
valid signature count
an #OstreeGpgVerifyResult
Appends a brief, human-readable description of the GPG signature at
@signature_index in @result to the @output_buffer. The description
spans multiple lines. A @line_prefix string, if given, will precede
each line of the description.
The @flags argument is reserved for future variations to the description
format. Currently must be 0.
It is a programmer error to request an invalid @signature_index. Use
ostree_gpg_verify_result_count_all() to find the number of signatures in
@result.
an #OstreeGpgVerifyResult
which signature to describe
a #GString to hold the description
optional line prefix string
flags to adjust the description format
Builds a #GVariant tuple of requested attributes for the GPG signature at
@signature_index in @result. See the #OstreeGpgSignatureAttr description
for the #GVariantType of each available attribute.
It is a programmer error to request an invalid #OstreeGpgSignatureAttr or
an invalid @signature_index. Use ostree_gpg_verify_result_count_all() to
find the number of signatures in @result.
a new, floating, #GVariant tuple
an #OstreeGpgVerifyResult
which signature to get attributes from
Array of requested attributes
Length of the @attrs array
Builds a #GVariant tuple of all available attributes for the GPG signature
at @signature_index in @result.
The child values in the returned #GVariant tuple are ordered to match the
#OstreeGpgSignatureAttr enumeration, which means the enum values can be
used as index values in functions like g_variant_get_child(). See the
#OstreeGpgSignatureAttr description for the #GVariantType of each
available attribute.
<note>
<para>
The #OstreeGpgSignatureAttr enumeration may be extended in the future
with new attributes, which would affect the #GVariant tuple returned by
this function. While the position and type of current child values in
the #GVariant tuple will not change, to avoid backward-compatibility
issues <emphasis>please do not depend on the tuple's overall size or
type signature</emphasis>.
</para>
</note>
It is a programmer error to request an invalid @signature_index. Use
ostree_gpg_verify_result_count_all() to find the number of signatures in
@result.
a new, floating, #GVariant tuple
an #OstreeGpgVerifyResult
which signature to get attributes from
Searches @result for a signature signed by @key_id. If a match is found,
the function returns %TRUE and sets @out_signature_index so that further
signature details can be obtained through ostree_gpg_verify_result_get().
If no match is found, the function returns %FALSE and leaves
@out_signature_index unchanged.
%TRUE on success, %FALSE on failure
an #OstreeGpgVerifyResult
a GPG key ID or fingerprint
return location for the index of the signature
signed by @key_id, or %NULL
Checks if the result contains at least one signature from the
trusted keyring. You can call this function immediately after
ostree_repo_verify_summary() or ostree_repo_verify_commit_ext() -
it will handle the %NULL @result and filled @error too.
%TRUE if @result was not %NULL and had at least one
signature from trusted keyring, otherwise %FALSE
an #OstreeGpgVerifyResult
Appends @arg which is in the form of key=value pair to the hash table kargs->table
(appends to the value list if key is already in the hash table)
and appends key to kargs->order if it is not in the hash table already.
a OstreeKernelArgs instance
key or key/value pair to be added
Appends each value in @argv to the corresponding value array and
appends key to kargs->order if it is not in the hash table already.
a OstreeKernelArgs instance
an array of key=value argument pairs
Appends each argument that does not have one of the @prefixes as prefix to the @kargs
a OstreeKernelArgs instance
an array of key=value argument pairs
an array of prefix strings
Appends the command line arguments in the file "/proc/cmdline"
that does not have "BOOT_IMAGE=" and "initrd=" as prefixes to the @kargs
%TRUE on success, %FALSE on failure
a OstreeKernelArgs instance
optional GCancellable object, NULL to ignore
There are few scenarios being handled for deletion:
1: for input arg with a single key(i.e without = for split),
the key/value pair will be deleted if there is only
one value that is associated with the key
2: for input arg wth key/value pair, the specific key
value pair will be deleted from the pointer array
if those exist.
3: If the found key has only one value
associated with it, the key entry in the table will also
be removed, and the key will be removed from order table
Returns: %TRUE on success, %FALSE on failure
Since: 2019.3
a OstreeKernelArgs instance
key or key/value pair for deletion
This function removes the key entry from the hashtable
as well from the order pointer array inside kargs
Note: since both table and order inside kernel args
are with free function, no extra free functions are
being called as they are done automatically by GLib
%TRUE on success, %FALSE on failure
an OstreeKernelArgs instance
the key to remove
Frees the kargs structure
An OstreeKernelArgs that represents kernel arguments
Finds and returns the last element of value array
corresponding to the @key in @kargs hash table. Note that the application
will be terminated if the @key is found but the value array is empty
NULL if @key is not found in the @kargs hash table,
otherwise returns last element of value array corresponding to @key
a OstreeKernelArgs instance
a key to look for in @kargs hash table
This function implements the basic logic behind key/value pair
replacement. Do note that the arg need to be properly formatted
When replacing key with exact one value, the arg can be in
the form:
key, key=new_val, or key=old_val=new_val
The first one swaps the old_val with the key to an empty value
The second and third replace the old_val into the new_val
When replacing key with multiple values, the arg can only be
in the form of:
key=old_val=new_val. Unless there is a special case where
there is an empty value associated with the key, then
key=new_val will work because old_val is empty. The empty
val will be swapped with the new_val in that case
%TRUE on success, %FALSE on failure (and in some other instances such as:
1. key not found in @kargs
2. old value not found when @arg is in the form of key=old_val=new_val
3. multiple old values found when @arg is in the form of key=old_val)
OstreeKernelArgs instance
a string argument
Parses @options by separating it by whitespaces and appends each argument to @kargs
a OstreeKernelArgs instance
a string representing command line arguments
Finds and replaces the old key if @arg is already in the hash table,
otherwise adds @arg as new key and split_keyeq (arg) as value.
Note that when replacing old key value pair, the old values are freed.
a OstreeKernelArgs instance
key or key/value pair for replacement
Finds and replaces each non-null arguments of @argv in the hash table,
otherwise adds individual arg as new key and split_keyeq (arg) as value.
Note that when replacing old key value pair, the old values are freed.
a OstreeKernelArgs instance
an array of key or key/value pairs
Finds and replaces the old key if @arg is already in the hash table,
otherwise adds @arg as new key and split_keyeq (arg) as value.
Note that when replacing old key, the old values are freed.
a OstreeKernelArgs instance
key or key/value pair for replacement
Extracts all key value pairs in @kargs and appends to a temporary
GString in forms of "key=value" or "key" if value is NULL separated
by a single whitespace, and returns the temporary string with the
GString wrapper freed
Note: the application will be terminated if one of the values array
in @kargs is NULL
a string of "key=value" pairs or "key" if value is NULL,
separated by single whitespaces
a OstreeKernelArgs instance
Extracts all key value pairs in @kargs and appends to a temporary
array in forms of "key=value" or "key" if value is NULL, and returns
the temporary array with the GPtrArray wrapper freed
an array of "key=value" pairs or "key" if value is NULL
a OstreeKernelArgs instance
Frees the OstreeKernelArgs structure pointed by *loc
Address of an OstreeKernelArgs pointer
Initializes a new OstreeKernelArgs then parses and appends @options
to the empty OstreeKernelArgs
newly allocated #OstreeKernelArgs with @options appended
a string representing command line arguments
Initializes a new OstreeKernelArgs structure and returns it
A newly created #OstreeKernelArgs for kernel arguments
Zlib decompression
Default limit for maximum permitted size in bytes of metadata objects fetched
over HTTP (including repo/config files, refs, and commit/dirtree/dirmeta
objects). This is an arbitrary number intended to mitigate disk space
exhaustion attacks.
This variable is no longer meaningful, it is kept only for compatibility.
GVariant type `b`: Set if this commit is intended to be bootable
GVariant type `s`: Contains the Linux kernel release (i.e. `uname -r`)
GVariant type `s`. This key can be used in the repo metadata which is stored
in OSTREE_REPO_METADATA_REF as well as in the summary. The semantics of this
are that the remote repository wants clients to update their remote config
to add this collection ID (clients can't do P2P operations involving a
remote without a collection ID configured on it, even if one is configured
on the server side). Clients must never change or remove a collection ID
already set in their remote config.
Currently, OSTree does not implement changing a remote config based on this
key, but it may do so in a later release, and until then clients such as
Flatpak may implement it.
This is a replacement for the similar metadata key implemented by flatpak,
`xa.collection-id`, which is now deprecated as clients which supported it had
bugs with their P2P implementations.
Private instance structure.
A new tree
Creates a new OstreeMutableTree with the contents taken from the given repo
and checksums. The data will be loaded from the repo lazily as needed.
A new tree
The repo which contains the objects refered by the checksums.
dirtree checksum
dirmeta checksum
Creates a new OstreeMutableTree with the contents taken from the given commit.
The data will be loaded from the repo lazily as needed.
A new tree
The repo which contains the objects refered by the checksums.
ref or SHA-256 checksum
In some cases, a tree may be in a "lazy" state that loads
data in the background; if an error occurred during a non-throwing
API call, it will have been cached. This function checks for a
cached error. The tree remains in error state.
`TRUE` on success
Tree
Returns the subdirectory of self with filename @name, creating an empty one
it if it doesn't exist.
Tree
Name of subdirectory of self to retrieve/creates
the subdirectory
Create all parent trees necessary for the given @split_path to
exist.
Tree
File path components
SHA256 checksum for metadata
The parent tree
Merges @self with the tree given by @contents_checksum and
@metadata_checksum, but only if it's possible without writing new objects to
the @repo. We can do this if either @self is empty, the tree given by
@contents_checksum is empty or if both trees already have the same
@contents_checksum.
@TRUE if merge was successful, @FALSE if it was not possible.
This function enables optimisations when composing trees. The provided
checksums are not loaded or checked when this function is called. Instead
the contents will be loaded only when needed.
All children files (the value is a checksum)
All children directories
Tree
name
checksum
subdirectory
Remove the file or subdirectory named @name from the mutable tree @self.
Tree
Name of file or subdirectory to remove
If @FALSE, an error will be thrown if @name does not exist in the tree
Traverse @start number of elements starting from @split_path; the
child will be returned in @out_subdir.
Tree
Split pathname
Descend from this number of elements in @split_path
Target parent
An #OstreeObjectType
The name of a `GKeyFile` group for data that should not
be carried across upgrades. For more information,
see ostree_deployment_origin_remove_transient_state().
Enumeration for core object types; %OSTREE_OBJECT_TYPE_FILE is for
content, the other types are metadata.
Content; regular file, symbolic link
List of children (trees or files), and metadata
Directory metadata
Toplevel object, refers to tree and dirmeta for root
Toplevel object, refers to a deleted commit
Detached metadata for a commit
Symlink to a .file given its checksum on the payload only.
Detached xattrs content, for 'bare-split-xattrs' mode.
Hardlink to a .file-xattrs given the checksum of its .file object.
Filesystem path that is created on an ostree-booted system.
ostree release version component (e.g. 2 if %OSTREE_VERSION is 2017.2)
The name of a ref which is used to store metadata for the entire repository,
such as its expected update time (`ostree.summary.expires`), name, or new
GPG keys. Metadata is stored on contentless commits in the ref, and hence is
signed with the commits.
This supersedes the additional metadata dictionary in the `summary` file
(see ostree_repo_regenerate_summary()), as the use of a ref means that the
metadata for multiple upstream repositories can be included in a single mirror
repository, disambiguating the refs using collection IDs. In order to support
peer to peer redistribution of repository metadata, repositories must set a
collection ID (ostree_repo_set_collection_id()).
Users of OSTree may place arbitrary metadata in commits on this ref, but the
keys must be namespaced by product or developer. For example,
`exampleos.end-of-life`. The `ostree.` prefix is reserved.
This represents the configuration for a single remote repository. Currently,
remotes can only be passed around as (reference counted) opaque handles. In
future, more API may be added to create and interrogate them.
Get the human-readable name of the remote. This is what the user configured,
if the remote was explicitly configured; and will otherwise be a stable,
arbitrary, string.
remote’s name
an #OstreeRemote
Get the URL from the remote.
the remote's URL
an #OstreeRemote
Increase the reference count on the given @remote.
a copy of @remote, for convenience
an #OstreeRemote
Decrease the reference count on the given @remote and free it if the
reference count reaches 0.
an #OstreeRemote
An accessor object for an OSTree repository located at @path
Path to a repository
If the current working directory appears to be an OSTree
repository, create a new #OstreeRepo object for accessing it.
Otherwise use the path in the OSTREE_REPO environment variable
(if defined) or else the default system repository located at
/ostree/repo.
An accessor object for an OSTree repository located at /ostree/repo
Creates a new #OstreeRepo instance, taking the system root path explicitly
instead of assuming "/".
An accessor object for the OSTree repository located at @repo_path.
Path to a repository
Path to the system root
This is a file-descriptor relative version of ostree_repo_create().
Create the underlying structure on disk for the repository, and call
ostree_repo_open_at() on the result, preparing it for use.
If a repository already exists at @dfd + @path (defined by an `objects/`
subdirectory existing), then this function will simply call
ostree_repo_open_at(). In other words, this function cannot be used to change
the mode or configuration (`repo/config`) of an existing repo.
The @options dict may contain:
- collection-id: s: Set as collection ID in repo/config (Since 2017.9)
A new OSTree repository reference
Directory fd
Path
The mode to store the repository in
a{sv}: See below for accepted keys
Cancellable
a repo mode as a string
the corresponding #OstreeRepoMode
This combines ostree_repo_new() (but using fd-relative access) with
ostree_repo_open(). Use this when you know you should be operating on an
already extant repository. If you want to create one, use ostree_repo_create_at().
An accessor object for an OSTree repository located at @dfd + @path
Directory fd
Path
Convenient "changed" callback for use with
ostree_async_progress_new_and_connect() when pulling from a remote
repository.
Depending on the state of the #OstreeAsyncProgress, either displays a
custom status message, or else outstanding fetch progress in bytes/sec,
or else outstanding content or metadata writes to the repository in
number of objects.
Compatibility note: this function previously assumed that @user_data
was a pointer to a #GSConsole instance. This is no longer the case,
and @user_data is ignored.
Async progress
User data
This hash table is a mapping from #GVariant which can be accessed
via ostree_object_name_deserialize() to a #GVariant containing either
a similar #GVariant or and array of them, listing the parents of the key.
A new hash table
This hash table is a set of #GVariant which can be accessed via
ostree_object_name_deserialize().
A new hash table
Gets all the commits that a certain object belongs to, as recorded
by a parents table gotten from ostree_repo_traverse_commit_union_with_parents.
An array of checksums for
the commits the key belongs to.
Abort the active transaction; any staged objects and ref changes will be
discarded. You *must* invoke this if you have chosen not to invoke
ostree_repo_commit_transaction(). Calling this function when not in a
transaction will do nothing and return successfully.
An #OstreeRepo
Cancellable
Add a GPG signature to a summary file.
Self
NULL-terminated array of GPG keys.
GPG home directory, or %NULL
A #GCancellable
Append a GPG signature to a commit.
Self
SHA256 of given commit to sign
Signature data
A #GCancellable
Similar to ostree_repo_checkout_tree(), but uses directory-relative
paths for the destination, uses a new `OstreeRepoCheckoutAtOptions`,
and takes a commit checksum and optional subpath pair, rather than
requiring use of `GFile` APIs for the caller.
It also replaces ostree_repo_checkout_at() which was not safe to
use with GObject introspection.
Note in addition that unlike ostree_repo_checkout_tree(), the
default is not to use the repository-internal uncompressed objects
cache.
Repo
Options
Directory FD for destination
Directory for destination
Checksum for commit
Cancellable
Call this after finishing a succession of checkout operations; it
will delete any currently-unused uncompressed objects from the
cache.
Repo
Cancellable
Check out @source into @destination, which must live on the
physical filesystem. @source may be any subdirectory of a given
commit. The @mode and @overwrite_mode allow control over how the
files are checked out.
Repo
Options controlling all files
Whether or not to overwrite files
Place tree here
Source tree
Source info
Cancellable
Similar to ostree_repo_checkout_tree(), but uses directory-relative
paths for the destination, uses a new `OstreeRepoCheckoutAtOptions`,
and takes a commit checksum and optional subpath pair, rather than
requiring use of `GFile` APIs for the caller.
Note in addition that unlike ostree_repo_checkout_tree(), the
default is not to use the repository-internal uncompressed objects
cache.
This function is deprecated. Use ostree_repo_checkout_at() instead.
Repo
Options
Directory FD for destination
Directory for destination
Checksum for commit
Cancellable
Complete the transaction. Any refs set with
ostree_repo_transaction_set_ref() or
ostree_repo_transaction_set_refspec() will be written out.
Note that if multiple threads are performing writes, all such threads must
have terminated before this function is invoked.
Locking: Releases `shared` lock acquired by `ostree_repo_prepare_transaction()`
Multithreading: This function is *not* MT safe; only one transaction can be
active at a time.
An #OstreeRepo
A set of statistics of things
that happened during this transaction.
Cancellable
A newly-allocated copy of the repository config
Create the underlying structure on disk for the repository, and call
ostree_repo_open() on the result, preparing it for use.
Since version 2016.8, this function will succeed on an existing
repository, and finish creating any necessary files in a partially
created repository. However, this function cannot change the mode
of an existing repository, and will silently ignore an attempt to
do so.
Since 2017.9, "existing repository" is defined by the existence of an
`objects` subdirectory.
This function predates ostree_repo_create_at(). It is an error to call
this function on a repository initialized via ostree_repo_open_at().
An #OstreeRepo
The mode to store the repository in
Cancellable
Remove the object of type @objtype with checksum @sha256
from the repository. An error of type %G_IO_ERROR_NOT_FOUND
is thrown if the object does not exist.
Repo
Object type
Checksum
Cancellable
Check whether two opened repositories are the same on disk: if their root
directories are the same inode. If @a or @b are not open yet (due to
ostree_repo_open() not being called on them yet), %FALSE will be returned.
%TRUE if @a and @b are the same repository on disk, %FALSE otherwise
an #OstreeRepo
an #OstreeRepo
Import an archive file @archive into the repository, and write its
file structure to @mtree.
An #OstreeRepo
Options controlling conversion
An #OstreeRepoFile for the base directory
A `struct archive`, but specified as void to avoid a dependency on the libarchive headers
Cancellable
Find reachable remote URIs which claim to provide any of the given named
@refs. This will search for configured remotes (#OstreeRepoFinderConfig),
mounted volumes (#OstreeRepoFinderMount) and (if enabled at compile time)
local network peers (#OstreeRepoFinderAvahi). In order to use a custom
configuration of #OstreeRepoFinder instances, call
ostree_repo_finder_resolve_all_async() on them individually.
Any remote which is found and which claims to support any of the given @refs
will be returned in the results. It is possible that a remote claims to
support a given ref, but turns out not to — it is not possible to verify this
until ostree_repo_pull_from_remotes_async() is called.
The returned results will be sorted with the most useful first — this is
typically the remote which claims to provide the most of @refs, at the lowest
latency.
Each result contains a list of the subset of @refs it claims to provide. It
is possible for a non-empty list of results to be returned, but for some of
@refs to not be listed in any of the results. Callers must check for this.
Pass the results to ostree_repo_pull_from_remotes_async() to pull the given @refs
from those remotes.
The following @options are currently defined:
* `override-commit-ids` (`as`): Array of specific commit IDs to fetch. The nth
commit ID applies to the nth ref, so this must be the same length as @refs, if
provided.
* `n-network-retries` (`u`): Number of times to retry each download on
receiving a transient network error, such as a socket timeout; default is
5, 0 means return errors without retrying. Since: 2018.6
@finders must be a non-empty %NULL-terminated array of the #OstreeRepoFinder
instances to use, or %NULL to use the system default set of finders, which
will typically be all available finders using their default options (but
this is not guaranteed).
GPG verification of commits will be used unconditionally.
This will use the thread-default #GMainContext, but will not iterate it.
an #OstreeRepo
non-empty array of collection–ref pairs to find remotes for
a GVariant `a{sv}` with an extensible set of flags
non-empty array of
#OstreeRepoFinder instances to use, or %NULL to use the system defaults
an #OstreeAsyncProgress to update with the operation’s
progress, or %NULL
a #GCancellable, or %NULL
asynchronous completion callback
data to pass to @callback
Finish an asynchronous pull operation started with
ostree_repo_find_remotes_async().
a potentially empty array
of #OstreeRepoFinderResults, followed by a %NULL terminator element; or
%NULL on error
an #OstreeRepo
the asynchronous result
Verify consistency of the object; this performs checks only relevant to the
immediate object itself, such as checksumming. This API call will not itself
traverse metadata objects for example.
Repo
Object type
Checksum
Cancellable
Get the bootloader configured. See the documentation for the
"sysroot.bootloader" config key.
bootloader configuration for the sysroot
an #OstreeRepo
Get the collection ID of this repository. See [collection IDs][collection-ids].
collection ID for the repository
an #OstreeRepo
The repository configuration; do not modify
Get the set of default repo finders configured. See the documentation for
the "core.default-repo-finders" config key.
%NULL-terminated array of strings.
an #OstreeRepo
In some cases it's useful for applications to access the repository
directly; for example, writing content into `repo/tmp` ensures it's
on the same filesystem. Another case is detecting the mtime on the
repository (to see whether a ref was written).
File descriptor for repository root - owned by @self
Repo
For more information see ostree_repo_set_disable_fsync().
Whether or not fsync() is enabled for this repo.
An #OstreeRepo
Determine the number of bytes of free disk space that are reserved according
to the repo config and return that number in @out_reserved_bytes. See the
documentation for the core.min-free-space-size and
core.min-free-space-percent repo config options.
%TRUE on success, %FALSE otherwise.
Repo
Location to store the result
Before this function can be used, ostree_repo_init() must have been
called.
Parent repository, or %NULL if none
Repo
Note that since the introduction of ostree_repo_open_at(), this function may
return a process-specific path in `/proc` if the repository was created using
that API. In general, you should avoid use of this API.
Path to repo
Repo
OSTree remotes are represented by keyfile groups, formatted like:
`[remote "remotename"]`. This function returns a value named @option_name
underneath that group, and returns it as a boolean.
If the option is not set, @out_value will be set to @default_value. If an
error is returned, @out_value will be set to %FALSE.
%TRUE on success, otherwise %FALSE with @error set
A OstreeRepo
Name
Option
Value returned if @option_name is not present
location to store the result.
OSTree remotes are represented by keyfile groups, formatted like:
`[remote "remotename"]`. This function returns a value named @option_name
underneath that group, and returns it as a zero terminated array of strings.
If the option is not set, or if an error is returned, @out_value will be set
to %NULL.
%TRUE on success, otherwise %FALSE with @error set
A OstreeRepo
Name
Option
location to store the list
of strings. The list should be freed with
g_strfreev().
OSTree remotes are represented by keyfile groups, formatted like:
`[remote "remotename"]`. This function returns a value named @option_name
underneath that group, or @default_value if the remote exists but not the
option name. If an error is returned, @out_value will be set to %NULL.
%TRUE on success, otherwise %FALSE with @error set
A OstreeRepo
Name
Option
Value returned if @option_name is not present
Return location for value
Sign the given @data with the specified keys in @key_id. Similar to
ostree_repo_add_gpg_signature_summary() but can be used on any
data.
You can use ostree_repo_gpg_verify_data() to verify the signatures.
@TRUE if @data has been signed successfully,
@FALSE in case of error (@error will contain the reason).
Self
Data as a #GBytes
Existing signatures to append to (or %NULL)
NULL-terminated array of GPG keys.
GPG home directory, or %NULL
in case of success will contain signature
A #GCancellable
Verify @signatures for @data using GPG keys in the keyring for
@remote_name, and return an #OstreeGpgVerifyResult.
The @remote_name parameter can be %NULL. In that case it will do
the verifications using GPG keys in the keyrings of all remotes.
an #OstreeGpgVerifyResult, or %NULL on error
Repository
Name of remote
Data as a #GBytes
Signatures as a #GBytes
Path to directory GPG keyrings; overrides built-in default if given
Path to additional keyring file (not a directory)
Cancellable
Set @out_have_object to %TRUE if @self contains the given object;
%FALSE otherwise.
%FALSE if an unexpected error occurred, %TRUE otherwise
Repo
Object type
ASCII SHA256 checksum
%TRUE if repository contains object
Cancellable
Calculate a hash value for the given open repository, suitable for use when
putting it into a hash table. It is an error to call this on an #OstreeRepo
which is not yet open, as a persistent hash value cannot be calculated until
the repository is open and the inode of its root directory has been loaded.
This function does no I/O.
hash value for the #OstreeRepo
an #OstreeRepo
Import an archive file @archive into the repository, and write its
file structure to @mtree.
An #OstreeRepo
Options structure, ensure this is zeroed, then set specific variables
Really this is "struct archive*"
The #OstreeMutableTree to write to
Optional commit modifier
Cancellable
Copy object named by @objtype and @checksum into @self from the
source repository @source. If both repositories are of the same
type and on the same filesystem, this will simply be a fast Unix
hard link operation.
Otherwise, a copy will be performed.
Destination repo
Source repo
Object type
checksum
Cancellable
Copy object named by @objtype and @checksum into @self from the
source repository @source. If @trusted is %TRUE and both
repositories are of the same type and on the same filesystem,
this will simply be a fast Unix hard link operation.
Otherwise, a copy will be performed.
Destination repo
Source repo
Object type
checksum
If %TRUE, assume the source repo is valid and trusted
Cancellable
%TRUE if this repository is the root-owned system global repository
Repository
Returns whether the repository is writable by the current user.
If the repository is not writable, the @error indicates why.
%TRUE if this repository is writable
Repo
List all local, mirrored, and remote refs, mapping them to the commit
checksums they currently point to in @out_all_refs. If @match_collection_id
is specified, the results will be limited to those with an equal collection
ID.
#OstreeCollectionRefs are guaranteed to be returned with their collection ID
set to a non-%NULL value; so no refs from `refs/heads` will be listed if no
collection ID is configured for the repository
(ostree_repo_get_collection_id()).
If you want to exclude refs from `refs/remotes`, use
%OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES in @flags. Similarly use
%OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_MIRRORS to exclude refs from
`refs/mirrors`.
%TRUE on success, %FALSE otherwise
Repo
If non-%NULL, only list refs from this collection
Mapping from collection–ref to checksum
Options controlling listing behavior
Cancellable
This function synchronously enumerates all commit objects starting
with @start, returning data in @out_commits.
%TRUE on success, %FALSE on error, and @error will be set
Repo
List commits starting with this checksum
Map of serialized commit name to variant data
Cancellable
This function synchronously enumerates all objects in the
repository, returning data in @out_objects. @out_objects
maps from keys returned by ostree_object_name_serialize()
to #GVariant values of type %OSTREE_REPO_LIST_OBJECTS_VARIANT_TYPE.
%TRUE on success, %FALSE on error, and @error will be set
Repo
Flags controlling enumeration
Map of serialized object name to variant data
Cancellable
If @refspec_prefix is %NULL, list all local and remote refspecs,
with their current values in @out_all_refs. Otherwise, only list
refspecs which have @refspec_prefix as a prefix.
@out_all_refs will be returned as a mapping from refspecs (including the
remote name) to checksums. If @refspec_prefix is non-%NULL, it will be
removed as a prefix from the hash table keys.
Repo
Only list refs which match this prefix
Mapping from refspec to checksum
Cancellable
If @refspec_prefix is %NULL, list all local and remote refspecs,
with their current values in @out_all_refs. Otherwise, only list
refspecs which have @refspec_prefix as a prefix.
@out_all_refs will be returned as a mapping from refspecs (including the
remote name) to checksums. Differently from ostree_repo_list_refs(), the
@refspec_prefix will not be removed from the refspecs in the hash table.
Repo
Only list refs which match this prefix
Mapping from refspec to checksum
Options controlling listing behavior
Cancellable
This function synchronously enumerates all static delta indexes in the
repository, returning its result in @out_indexes.
Repo
String name of delta indexes (checksum)
Cancellable
This function synchronously enumerates all static deltas in the
repository, returning its result in @out_deltas.
Repo
String name of deltas (checksum-checksum.delta)
Cancellable
A version of ostree_repo_load_variant() specialized to commits,
capable of returning extended state information. Currently
the only extended state is %OSTREE_REPO_COMMIT_STATE_PARTIAL, which
means that only a sub-path of the commit is available.
Repo
Commit checksum
Commit
Commit state
Load content object, decomposing it into three parts: the actual
content (for regular files), the metadata, and extended attributes.
Repo
ASCII SHA256 checksum
File content
File information
Extended attributes
Cancellable
Load object as a stream; useful when copying objects between
repositories.
Repo
Object type
ASCII SHA256 checksum
Stream for object
Length of @out_input
Cancellable
Load the metadata object @sha256 of type @objtype, storing the
result in @out_variant.
Repo
Expected object type
Checksum string
Metadata object
Attempt to load the metadata object @sha256 of type @objtype if it
exists, storing the result in @out_variant. If it doesn't exist,
@out_variant will be set to %NULL and the function will still
return TRUE.
Repo
Object type
ASCII checksum
Metadata
Release a lock of type @lock_type from the lock state. If the lock state
becomes empty, the repository is unlocked. Otherwise, the lock state only
changes when transitioning from an exclusive lock back to a shared lock. The
requested @lock_type must be the same type that was requested in the call to
ostree_repo_lock_push(). It is a programmer error if these do not match and
the program may abort if the lock would reach an invalid state.
ostree_repo_lock_pop() waits for the lock depending on the repository's
lock-timeout-secs configuration. When lock-timeout-secs is -1, a blocking lock is
attempted. Otherwise, the lock is removed non-blocking and
ostree_repo_lock_pop() will sleep synchronously up to lock-timeout-secs seconds
attempting to remove the lock. If the lock cannot be removed within the
timeout, a %G_IO_ERROR_WOULD_BLOCK error is returned.
If @self is not writable by the user, then no unlocking is attempted and
%TRUE is returned.
%TRUE on success, otherwise %FALSE with @error set
a #OstreeRepo
the type of lock to release
a #GCancellable
Takes a lock on the repository and adds it to the lock state. If @lock_type
is %OSTREE_REPO_LOCK_SHARED, a shared lock is taken. If @lock_type is
%OSTREE_REPO_LOCK_EXCLUSIVE, an exclusive lock is taken. The actual lock
state is only changed when locking a previously unlocked repository or
upgrading the lock from shared to exclusive. If the requested lock type is
unchanged or would represent a downgrade (exclusive to shared), the lock
state is not changed.
ostree_repo_lock_push() waits for the lock depending on the repository's
lock-timeout-secs configuration. When lock-timeout-secs is -1, a blocking lock is
attempted. Otherwise, the lock is taken non-blocking and
ostree_repo_lock_push() will sleep synchronously up to lock-timeout-secs seconds
attempting to acquire the lock. If the lock cannot be acquired within the
timeout, a %G_IO_ERROR_WOULD_BLOCK error is returned.
If @self is not writable by the user, then no locking is attempted and
%TRUE is returned.
%TRUE on success, otherwise %FALSE with @error set
a #OstreeRepo
the type of lock to acquire
a #GCancellable
Commits in the "partial" state do not have all their child objects
written. This occurs in various situations, such as during a pull,
but also if a "subpath" pull is used, as well as "commit only"
pulls.
This function is used by ostree_repo_pull_with_options(); you
should use this if you are implementing a different type of transport.
Repo
Commit SHA-256
Whether or not this commit is partial
Allows the setting of a reason code for a partial commit. Presently
it only supports setting reason bitmask to
OSTREE_REPO_COMMIT_STATE_FSCK_PARTIAL, or
OSTREE_REPO_COMMIT_STATE_NORMAL. This will allow successive ostree
fsck operations to exit properly with an error code if the
repository has been truncated as a result of fsck trying to repair
it.
Repo
Commit SHA-256
Whether or not this commit is partial
Reason bitmask for partial commit
Starts or resumes a transaction. In order to write to a repo, you
need to start a transaction. You can complete the transaction with
ostree_repo_commit_transaction(), or abort the transaction with
ostree_repo_abort_transaction().
Currently, transactions may result in partial commits or data in the target
repository if interrupted during ostree_repo_commit_transaction(), and
further writing refs is also not currently atomic.
There can be at most one transaction active on a repo at a time per instance
of `OstreeRepo`; however, it is safe to have multiple threads writing objects
on a single `OstreeRepo` instance as long as their lifetime is bounded by the
transaction.
Locking: Acquires a `shared` lock; release via commit or abort
Multithreading: This function is *not* MT safe; only one transaction can be
active at a time.
An #OstreeRepo
Whether this transaction
is resuming from a previous one. This is a legacy state, now OSTree
pulls use per-commit `state/.commitpartial` files.
Cancellable
Delete content from the repository. By default, this function will
only delete "orphaned" objects not referred to by any commit. This
can happen during a local commit operation, when we have written
content objects but not saved the commit referencing them.
However, if %OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY is provided, instead
of traversing all commits, only refs will be used. Particularly
when combined with @depth, this is a convenient way to delete
history from the repository.
Use the %OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE to just determine
statistics on objects that would be deleted, without actually
deleting them.
Locking: exclusive
Repo
Options controlling prune process
Stop traversal after this many iterations (-1 for unlimited)
Number of objects found
Number of objects deleted
Storage size in bytes of objects deleted
Cancellable
Delete content from the repository. This function is the "backend"
half of the higher level ostree_repo_prune(). To use this function,
you determine the root set yourself, and this function finds all other
unreferenced objects and deletes them.
Use this API when you want to perform more selective pruning - for example,
retain all commits from a production branch, but just GC some history from
your dev branch.
The %OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE flag may be specified to just determine
statistics on objects that would be deleted, without actually deleting them.
Locking: exclusive
Repo
Options controlling prune process
Number of objects found
Number of objects deleted
Storage size in bytes of objects deleted
Cancellable
Prune static deltas, if COMMIT is specified then delete static delta files only
targeting that commit; otherwise any static delta of non existing commits are
deleted.
Locking: exclusive
Repo
ASCII SHA256 checksum for commit, or %NULL for each
non existing commit
Cancellable
Connect to the remote repository, fetching the specified set of
refs @refs_to_fetch. For each ref that is changed, download the
commit, all metadata, and all content objects, storing them safely
on disk in @self.
If @flags contains %OSTREE_REPO_PULL_FLAGS_MIRROR, and
the @refs_to_fetch is %NULL, and the remote repository contains a
summary file, then all refs will be fetched.
If @flags contains %OSTREE_REPO_PULL_FLAGS_COMMIT_ONLY, then only the
metadata for the commits in @refs_to_fetch is pulled.
Warning: This API will iterate the thread default main context,
which is a bug, but kept for compatibility reasons. If you want to
avoid this, use g_main_context_push_thread_default() to push a new
one around this call.
Repo
Name of remote
Optional list of refs; if %NULL, fetch all configured refs
Options controlling fetch behavior
Progress
Cancellable
Pull refs from multiple remotes which have been found using
ostree_repo_find_remotes_async().
@results are expected to be in priority order, with the best remotes to pull
from listed first. ostree_repo_pull_from_remotes_async() will generally pull
from the remotes in order, but may parallelise its downloads.
If an error is encountered when pulling from a given remote, that remote will
be ignored and another will be tried instead. If any refs have not been
downloaded successfully after all remotes have been tried, %G_IO_ERROR_FAILED
will be returned. The results of any successful downloads will remain cached
in the local repository.
If @cancellable is cancelled, %G_IO_ERROR_CANCELLED will be returned
immediately. The results of any successfully completed downloads at that
point will remain cached in the local repository.
GPG verification of commits will be used unconditionally.
The following @options are currently defined:
* `flags` (`i`): #OstreeRepoPullFlags to apply to the pull operation
* `inherit-transaction` (`b`): %TRUE to inherit an ongoing transaction on
the #OstreeRepo, rather than encapsulating the pull in a new one
* `depth` (`i`): How far in the history to traverse; default is 0, -1 means infinite
* `disable-static-deltas` (`b`): Do not use static deltas
* `http-headers` (`a(ss)`): Additional headers to add to all HTTP requests
* `subdirs` (`as`): Pull just these subdirectories
* `update-frequency` (`u`): Frequency to call the async progress callback in
milliseconds, if any; only values higher than 0 are valid
* `append-user-agent` (`s`): Additional string to append to the user agent
* `n-network-retries` (`u`): Number of times to retry each download on receiving
a transient network error, such as a socket timeout; default is 5, 0
means return errors without retrying. Since: 2018.6
* `ref-keyring-map` (`a(sss)`): Array of (collection ID, ref name, keyring
remote name) tuples specifying which remote's keyring should be used when
doing GPG verification of each collection-ref. This is useful to prevent a
remote from serving malicious updates to refs which did not originate from
it. This can be a subset or superset of the refs being pulled; any ref
not being pulled will be ignored and any ref without a keyring remote
will be verified with the keyring of the remote being pulled from.
Since: 2019.2
an #OstreeRepo
%NULL-terminated array of remotes to
pull from, including the refs to pull from each
A GVariant `a{sv}` with an extensible set of flags
an #OstreeAsyncProgress to update with the operation’s
progress, or %NULL
a #GCancellable, or %NULL
asynchronous completion callback
data to pass to @callback
Finish an asynchronous pull operation started with
ostree_repo_pull_from_remotes_async().
%TRUE on success, %FALSE otherwise
an #OstreeRepo
the asynchronous result
This is similar to ostree_repo_pull(), but only fetches a single
subpath.
Repo
Name of remote
Subdirectory path
Optional list of refs; if %NULL, fetch all configured refs
Options controlling fetch behavior
Progress
Cancellable
Like ostree_repo_pull(), but supports an extensible set of flags.
The following are currently defined:
* `refs` (`as`): Array of string refs
* `collection-refs` (`a(sss)`): Array of (collection ID, ref name, checksum) tuples to pull;
mutually exclusive with `refs` and `override-commit-ids`. Checksums may be the empty
string to pull the latest commit for that ref
* `flags` (`i`): An instance of #OstreeRepoPullFlags
* `subdir` (`s`): Pull just this subdirectory
* `subdirs` (`as`): Pull just these subdirectories
* `override-remote-name` (`s`): If local, add this remote to refspec
* `gpg-verify` (`b`): GPG verify commits
* `gpg-verify-summary` (`b`): GPG verify summary
* `disable-sign-verify` (`b`): Disable signapi verification of commits
* `disable-sign-verify-summary` (`b`): Disable signapi verification of the summary
* `depth` (`i`): How far in the history to traverse; default is 0, -1 means infinite
* `per-object-fsync` (`b`): Perform disk writes more slowly, avoiding a single large I/O sync
* `disable-static-deltas` (`b`): Do not use static deltas
* `require-static-deltas` (`b`): Require static deltas
* `override-commit-ids` (`as`): Array of specific commit IDs to fetch for refs
* `timestamp-check` (`b`): Verify commit timestamps are newer than current (when pulling via ref); Since: 2017.11
* `timestamp-check-from-rev` (`s`): Verify that all fetched commit timestamps are newer than timestamp of given rev; Since: 2020.4
* `metadata-size-restriction` (`t`): Restrict metadata objects to a maximum number of bytes; 0 to disable. Since: 2018.9
* `dry-run` (`b`): Only print information on what will be downloaded (requires static deltas)
* `override-url` (`s`): Fetch objects from this URL if remote specifies no metalink in options
* `inherit-transaction` (`b`): Don't initiate, finish or abort a transaction, useful to do multiple pulls in one transaction.
* `http-headers` (`a(ss)`): Additional headers to add to all HTTP requests
* `update-frequency` (`u`): Frequency to call the async progress callback in milliseconds, if any; only values higher than 0 are valid
* `localcache-repos` (`as`): File paths for local repos to use as caches when doing remote fetches
* `append-user-agent` (`s`): Additional string to append to the user agent
* `n-network-retries` (`u`): Number of times to retry each download on receiving
a transient network error, such as a socket timeout; default is 5, 0
means return errors without retrying. Since: 2018.6
* `ref-keyring-map` (`a(sss)`): Array of (collection ID, ref name, keyring
remote name) tuples specifying which remote's keyring should be used when
doing GPG verification of each collection-ref. This is useful to prevent a
remote from serving malicious updates to refs which did not originate from
it. This can be a subset or superset of the refs being pulled; any ref
not being pulled will be ignored and any ref without a keyring remote
will be verified with the keyring of the remote being pulled from.
Since: 2019.2
* `summary-bytes` (`ay'): Contents of the `summary` file to use. If this is
specified, `summary-sig-bytes` must also be specified. This is
useful if doing multiple pull operations in a transaction, using
ostree_repo_remote_fetch_summary_with_options() beforehand to download
the `summary` and `summary.sig` once for the entire transaction. If not
specified, the `summary` will be downloaded from the remote. Since: 2020.5
* `summary-sig-bytes` (`ay`): Contents of the `summary.sig` file. If this
is specified, `summary-bytes` must also be specified. Since: 2020.5
* `disable-verify-bindings` (`b`): Disable verification of commit bindings.
Since: 2020.9
Repo
Name of remote or file:// url
A GVariant a{sv} with an extensible set of flags.
Progress
Cancellable
Return the size in bytes of object with checksum @sha256, after any
compression has been applied.
Repo
Object type
Checksum
Size in bytes object occupies physically
Cancellable
Load the content for @rev into @out_root.
Repo
Ref or ASCII checksum
An #OstreeRepoFile corresponding to the root
The resolved commit checksum
Cancellable
OSTree commits can have arbitrary metadata associated; this
function retrieves them. If none exists, @out_metadata will be set
to %NULL.
Repo
ASCII SHA256 commit checksum
Metadata associated with commit in with format "a{sv}", or %NULL if none exists
Cancellable
An OSTree repository can contain a high level "summary" file that
describes the available branches and other metadata.
If the timetable for making commits and updating the summary file is fairly
regular, setting the `ostree.summary.expires` key in @additional_metadata
will aid clients in working out when to check for updates.
It is regenerated automatically after any ref is
added, removed, or updated if `core/auto-update-summary` is set.
If the `core/collection-id` key is set in the configuration, it will be
included as %OSTREE_SUMMARY_COLLECTION_ID in the summary file. Refs that
have associated collection IDs will be included in the generated summary
file, listed under the %OSTREE_SUMMARY_COLLECTION_MAP key. Collection IDs
and refs in %OSTREE_SUMMARY_COLLECTION_MAP are guaranteed to be in
lexicographic order.
Locking: shared (Prior to 2021.7, this was exclusive)
Repo
A GVariant of type a{sv}, or %NULL
Cancellable
By default, an #OstreeRepo will cache the remote configuration and its
own repo/config data. This API can be used to reload it.
repo
cancellable
Create a new remote named @name pointing to @url. If @options is
provided, then it will be mapped to #GKeyFile entries, where the
GVariant dictionary key is an option string, and the value is
mapped as follows:
* s: g_key_file_set_string()
* b: g_key_file_set_boolean()
* as: g_key_file_set_string_list()
Repo
Name of remote
URL for remote (if URL begins with metalink=, it will be used as such)
GVariant of type a{sv}
Cancellable
A combined function handling the equivalent of
ostree_repo_remote_add(), ostree_repo_remote_delete(), with more
options.
Repo
System root
Operation to perform
Name of remote
URL for remote (if URL begins with metalink=, it will be used as such)
GVariant of type a{sv}
Cancellable
Delete the remote named @name. It is an error if the provided
remote does not exist.
Repo
Name of remote
Cancellable
Tries to fetch the summary file and any GPG signatures on the summary file
over HTTP, and returns the binary data in @out_summary and @out_signatures
respectively.
If no summary file exists on the remote server, @out_summary is set to
@NULL. Likewise if the summary file is not signed, @out_signatures is
set to @NULL. In either case the function still returns %TRUE.
This method does not verify the signature of the downloaded summary file.
Use ostree_repo_verify_summary() for that.
Parse the summary data into a #GVariant using g_variant_new_from_bytes()
with #OSTREE_SUMMARY_GVARIANT_FORMAT as the format string.
%TRUE on success, %FALSE on failure
Self
name of a remote
return location for raw summary data, or
%NULL
return location for raw summary
signature data, or %NULL
a #GCancellable
Like ostree_repo_remote_fetch_summary(), but supports an extensible set of flags.
The following are currently defined:
- override-url (s): Fetch summary from this URL if remote specifies no metalink in options
- http-headers (a(ss)): Additional headers to add to all HTTP requests
- append-user-agent (s): Additional string to append to the user agent
- n-network-retries (u): Number of times to retry each download on receiving
a transient network error, such as a socket timeout; default is 5, 0
means return errors without retrying
%TRUE on success, %FALSE on failure
Self
name of a remote
A GVariant a{sv} with an extensible set of flags
return location for raw summary data, or
%NULL
return location for raw summary
signature data, or %NULL
a #GCancellable
Enumerate the trusted GPG keys for the remote @name. If @name is
%NULL, the global GPG keys will be returned. The keys will be
returned in the @out_keys #GPtrArray. Each element in the array is a
#GVariant of format %OSTREE_GPG_KEY_GVARIANT_FORMAT. The @key_ids
array can be used to limit which keys are included. If @key_ids is
%NULL, then all keys are included.
%TRUE if the GPG keys could be enumerated, %FALSE otherwise
an #OstreeRepo
name of the remote or %NULL
a %NULL-terminated array of GPG key IDs to include, or %NULL
return location for a #GPtrArray of the remote's trusted GPG keys, or
%NULL
a #GCancellable, or %NULL
Return whether GPG verification is enabled for the remote named @name
through @out_gpg_verify. It is an error if the provided remote does
not exist.
%TRUE on success, %FALSE on failure
Repo
Name of remote
Remote's GPG option
Return whether GPG verification of the summary is enabled for the remote
named @name through @out_gpg_verify_summary. It is an error if the provided
remote does not exist.
%TRUE on success, %FALSE on failure
Repo
Name of remote
Remote's GPG option
Return the URL of the remote named @name through @out_url. It is an
error if the provided remote does not exist.
%TRUE on success, %FALSE on failure
Repo
Name of remote
Remote's URL
Imports one or more GPG keys from the open @source_stream, or from the
user's personal keyring if @source_stream is %NULL. The @key_ids array
can optionally restrict which keys are imported. If @key_ids is %NULL,
then all keys are imported.
The imported keys will be used to conduct GPG verification when pulling
from the remote named @name.
%TRUE on success, %FALSE on failure
Self
name of a remote
a #GInputStream, or %NULL
a %NULL-terminated array of GPG key IDs, or %NULL
return location for the number of imported
keys, or %NULL
a #GCancellable
List available remote names in an #OstreeRepo. Remote names are sorted
alphabetically. If no remotes are available the function returns %NULL.
a %NULL-terminated
array of remote names
Repo
Number of remotes available
List refs advertised by @remote_name, including refs which are part of
collections. If the repository at @remote_name has a collection ID set, its
refs will be returned with that collection ID; otherwise, they will be returned
with a %NULL collection ID in each #OstreeCollectionRef key in @out_all_refs.
Any refs for other collections stored in the repository will also be returned.
No filtering is performed.
Repo
Name of the remote.
Mapping from collection–ref to checksum
Cancellable
Repo
Name of the remote.
Mapping from ref to checksum
Cancellable
Look up the checksum for the given collection–ref, returning it in @out_rev.
This will search through the mirrors and remote refs.
If @allow_noent is %TRUE and the given @ref cannot be found, %TRUE will be
returned and @out_rev will be set to %NULL. If @allow_noent is %FALSE and
the given @ref cannot be found, a %G_IO_ERROR_NOT_FOUND error will be
returned.
If you want to check only local refs, not remote or mirrored ones, use the
flag %OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY. This is analogous to using
ostree_repo_resolve_rev_ext() but for collection-refs.
%TRUE on success, %FALSE on failure
an #OstreeRepo
a collection–ref to resolve
%TRUE to not throw an error if @ref doesn’t exist
options controlling behaviour
return location for
the checksum corresponding to @ref, or %NULL if @allow_noent is %TRUE and
the @ref could not be found
a #GCancellable, or %NULL
Find the GPG keyring for the given @collection_id, using the local
configuration from the given #OstreeRepo. This will search the configured
remotes for ones whose `collection-id` key matches @collection_id, and will
return the first matching remote.
If multiple remotes match and have different keyrings, a debug message will
be emitted, and the first result will be returned. It is expected that the
keyrings should match.
If no match can be found, a %G_IO_ERROR_NOT_FOUND error will be returned.
#OstreeRemote containing the GPG keyring for
@collection_id
an #OstreeRepo
the collection ID to look up a keyring for
a #GCancellable, or %NULL
Look up the given refspec, returning the checksum it references in
the parameter @out_rev. Will fall back on remote directory if cannot
find the given refspec in local.
Repo
A refspec
Do not throw an error if refspec does not exist
A checksum,or %NULL if @allow_noent is true and it does not exist
Look up the given refspec, returning the checksum it references in
the parameter @out_rev. Differently from ostree_repo_resolve_rev(),
this will not fall back to searching through remote repos if a
local ref is specified but not found.
The flag %OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY is implied so
using it has no effect.
Repo
A refspec
Do not throw an error if refspec does not exist
Options controlling behavior
A checksum,or %NULL if @allow_noent is true and it does not exist
This function is deprecated in favor of using ostree_repo_devino_cache_new(),
which allows a precise mapping to be built up between hardlink checkout files
and their checksums between `ostree_repo_checkout_at()` and
`ostree_repo_write_directory_to_mtree()`.
When invoking ostree_repo_write_directory_to_mtree(), it has to compute the
checksum of all files. If your commit contains hardlinks from a checkout,
this functions builds a mapping of device numbers and inodes to their
checksum.
There is an upfront cost to creating this mapping, as this will scan the
entire objects directory. If your commit is composed of mostly hardlinks to
existing ostree objects, then this will speed up considerably, so call it
before you call ostree_repo_write_directory_to_mtree() or similar. However,
ostree_repo_devino_cache_new() is better as it avoids scanning all objects.
Multithreading: This function is *not* MT safe.
An #OstreeRepo
Cancellable
Like ostree_repo_set_ref_immediate(), but creates an alias.
An #OstreeRepo
A remote for the ref
The ref to write
The ref target to point it to, or %NULL to unset
GCancellable
Set a custom location for the cache directory used for e.g.
per-remote summary caches. Setting this manually is useful when
doing operations on a system repo as a user because you don't have
write permissions in the repo, where the cache is normally stored.
An #OstreeRepo
directory fd
subpath in @dfd
a #GCancellable
Set or clear the collection ID of this repository. See [collection IDs][collection-ids].
The update will be made in memory, but must be written out to the repository
configuration on disk using ostree_repo_write_config().
%TRUE on success, %FALSE otherwise
an #OstreeRepo
new collection ID, or %NULL to unset it
This is like ostree_repo_transaction_set_collection_ref(), except it may be
invoked outside of a transaction. This is presently safe for the
case where we're creating or overwriting an existing ref.
%TRUE on success, %FALSE otherwise
An #OstreeRepo
The collection–ref to write
The checksum to point it to, or %NULL to unset
GCancellable
Disable requests to fsync() to stable storage during commits. This
option should only be used by build system tools which are creating
disposable virtual machines, or have higher level mechanisms for
ensuring data consistency.
An #OstreeRepo
If %TRUE, do not fsync
This is like ostree_repo_transaction_set_ref(), except it may be
invoked outside of a transaction. This is presently safe for the
case where we're creating or overwriting an existing ref.
Multithreading: This function is MT safe.
An #OstreeRepo
A remote for the ref
The ref to write
The checksum to point it to, or %NULL to unset
GCancellable
Add a GPG signature to a commit.
Self
SHA256 of given commit to sign
Use this GPG key id
GPG home directory, or %NULL
A #GCancellable
This function is deprecated, sign the summary file instead.
Add a GPG signature to a static delta.
Self
From commit
To commit
key id
homedir
cancellable
Validate the commit data using the commit metadata which must
contain at least one valid signature. If GPG and signapi are
both enabled, then both must find at least one valid signature.
Repo
Name of remote
Commit object data (GVariant)
Commit metadata (GVariant `a{sv}`), must contain at least one valid signature
Optionally disable GPG or signapi
Textual description of results
Given a directory representing an already-downloaded static delta
on disk, apply it, generating a new commit. The directory must be
named with the form "FROM-TO", where both are checksums, and it
must contain a file named "superblock", along with at least one part.
Repo
Path to a directory containing static delta data, or directly to the superblock
If %TRUE, assume data integrity
Cancellable
Given a directory representing an already-downloaded static delta
on disk, apply it, generating a new commit.
If sign is passed, the static delta signature is verified.
If sign-verify-deltas configuration option is set and static delta is signed,
signature verification will be mandatory before apply the static delta.
The directory must be named with the form "FROM-TO", where both are
checksums, and it must contain a file named "superblock", along with at least
one part.
Repo
Path to a directory containing static delta data, or directly to the superblock
Signature engine used to check superblock
If %TRUE, assume data integrity
Cancellable
Generate a lookaside "static delta" from @from (%NULL means
from-empty) which can generate the objects in @to. This delta is
an optimization over fetching individual objects, and can be
conveniently stored and applied offline.
The @params argument should be an a{sv}. The following attributes
are known:
- min-fallback-size: u: Minimum uncompressed size in megabytes to use fallback, 0 to disable fallbacks
- max-chunk-size: u: Maximum size in megabytes of a delta part
- max-bsdiff-size: u: Maximum size in megabytes to consider bsdiff compression
for input files
- compression: y: Compression type: 0=none, x=lzma, g=gzip
- bsdiff-enabled: b: Enable bsdiff compression. Default TRUE.
- inline-parts: b: Put part data in header, to get a single file delta. Default FALSE.
- verbose: b: Print diagnostic messages. Default FALSE.
- endianness: b: Deltas use host byte order by default; this option allows choosing (G_BIG_ENDIAN or G_LITTLE_ENDIAN)
- filename: ay: Save delta superblock to this filename, and parts in the same directory. Default saves to repository.
- sign-name: ay: Signature type to use.
- sign-key-ids: as: Array of keys used to sign delta superblock.
Repo
High level optimization choice
ASCII SHA256 checksum of origin, or %NULL
ASCII SHA256 checksum of target
Optional metadata
Parameters, see below
Cancellable
The delta index for a particular commit lists all the existing deltas that can be used
when downloading that commit. This operation regenerates these indexes, either for
a particular commit (if @opt_to_commit is non-%NULL), or for all commits that
are reachable by an existing delta (if @opt_to_commit is %NULL).
This is normally called automatically when the summary is updated in ostree_repo_regenerate_summary().
Locking: shared
Repo
Flags affecting the indexing operation
ASCII SHA256 checksum of target commit, or %NULL to index all targets
Cancellable
Verify static delta file signature.
TRUE if the signature of static delta file is valid using the
signature engine provided, FALSE otherwise.
Repo
delta path
Signature engine used to check superblock
success message
If @checksum is not %NULL, then record it as the target of local ref named
@ref.
Otherwise, if @checksum is %NULL, then record that the ref should
be deleted.
The change will not be written out immediately, but when the transaction
is completed with ostree_repo_commit_transaction(). If the transaction
is instead aborted with ostree_repo_abort_transaction(), no changes will
be made to the repository.
Multithreading: Since v2017.15 this function is MT safe.
An #OstreeRepo
The collection–ref to write
The checksum to point it to
If @checksum is not %NULL, then record it as the target of ref named
@ref; if @remote is provided, the ref will appear to originate from that
remote.
Otherwise, if @checksum is %NULL, then record that the ref should
be deleted.
The change will be written when the transaction is completed with
ostree_repo_commit_transaction(); that function takes care of writing all of
the objects (such as the commit referred to by @checksum) before updating the
refs. If the transaction is instead aborted with
ostree_repo_abort_transaction(), no changes to the ref will be made to the
repository.
Note however that currently writing *multiple* refs is not truly atomic; if
the process or system is terminated during
ostree_repo_commit_transaction(), it is possible that just some of the refs
will have been updated. Your application should take care to handle this
case.
Multithreading: Since v2017.15 this function is MT safe.
An #OstreeRepo
A remote for the ref
The ref to write
The checksum to point it to
Like ostree_repo_transaction_set_ref(), but takes concatenated
@refspec format as input instead of separate remote and name
arguments.
Multithreading: Since v2017.15 this function is MT safe.
An #OstreeRepo
The refspec to write
The checksum to point it to
Create a new set @out_reachable containing all objects reachable
from @commit_checksum, traversing @maxdepth parent commits.
Repo
ASCII SHA256 checksum
Traverse this many parent commits, -1 for unlimited
Set of reachable objects
Cancellable
Update the set @inout_reachable containing all objects reachable
from @commit_checksum, traversing @maxdepth parent commits.
Repo
ASCII SHA256 checksum
Traverse this many parent commits, -1 for unlimited
Set of reachable objects
Cancellable
Update the set @inout_reachable containing all objects reachable
from @commit_checksum, traversing @maxdepth parent commits.
Additionally this constructs a mapping from each object to the parents
of the object, which can be used to track which commits an object
belongs to.
Repo
ASCII SHA256 checksum
Traverse this many parent commits, -1 for unlimited
Set of reachable objects
Map from object to parent object
Cancellable
Update the set @inout_reachable containing all objects reachable
from @commit_checksum, traversing @maxdepth parent commits.
Additionally this constructs a mapping from each object to the parents
of the object, which can be used to track which commits an object
belongs to.
Repo
change traversal behaviour according to these flags
ASCII SHA256 checksum
Traverse this many parent commits, -1 for unlimited
Set of reachable objects
Map from object to parent object
Cancellable
Add all commit objects directly reachable via a ref to @reachable.
Locking: shared
Repo
Depth of traversal
Set of reachable objects (will be modified)
Cancellable
Check for a valid GPG signature on commit named by the ASCII
checksum @commit_checksum.
%TRUE if there was a GPG signature from a trusted keyring, otherwise %FALSE
Repository
ASCII SHA256 checksum
Path to directory GPG keyrings; overrides built-in default if given
Path to additional keyring file (not a directory)
Cancellable
Read GPG signature(s) on the commit named by the ASCII checksum
@commit_checksum and return detailed results.
an #OstreeGpgVerifyResult, or %NULL on error
Repository
ASCII SHA256 checksum
Path to directory GPG keyrings; overrides built-in default if given
Path to additional keyring file (not a directory)
Cancellable
Read GPG signature(s) on the commit named by the ASCII checksum
@commit_checksum and return detailed results, based on the keyring
configured for @remote.
an #OstreeGpgVerifyResult, or %NULL on error
Repository
ASCII SHA256 checksum
OSTree remote to use for configuration
Cancellable
Verify @signatures for @summary data using GPG keys in the keyring for
@remote_name, and return an #OstreeGpgVerifyResult.
an #OstreeGpgVerifyResult, or %NULL on error
Repo
Name of remote
Summary data as a #GBytes
Summary signatures as a #GBytes
Cancellable
Import an archive file @archive into the repository, and write its
file structure to @mtree.
An #OstreeRepo
A path to an archive file
The #OstreeMutableTree to write to
Optional commit modifier
Autocreate parent directories
Cancellable
Read an archive from @fd and import it into the repository, writing
its file structure to @mtree.
An #OstreeRepo
A file descriptor to read the archive from
The #OstreeMutableTree to write to
Optional commit modifier
Autocreate parent directories
Cancellable
Write a commit metadata object, referencing @root_contents_checksum
and @root_metadata_checksum.
This uses the current time as the commit timestamp, but it can be
overridden with an explicit timestamp via the
[standard](https://reproducible-builds.org/specs/source-date-epoch/)
`SOURCE_DATE_EPOCH` environment flag.
Repo
ASCII SHA256 checksum for parent, or %NULL for none
Subject
Body
GVariant of type a{sv}, or %NULL for none
The tree to point the commit to
Resulting ASCII SHA256 checksum for commit
Cancellable
Replace any existing metadata associated with commit referred to by
@checksum with @metadata. If @metadata is %NULL, then existing
data will be deleted.
Repo
ASCII SHA256 commit checksum
Metadata to associate with commit in with format "a{sv}", or %NULL to delete
Cancellable
Write a commit metadata object, referencing @root_contents_checksum
and @root_metadata_checksum.
Repo
ASCII SHA256 checksum for parent, or %NULL for none
Subject
Body
GVariant of type a{sv}, or %NULL for none
The tree to point the commit to
The time to use to stamp the commit
Resulting ASCII SHA256 checksum for commit
Cancellable
Save @new_config in place of this repository's config file.
Repo
Overwrite the config file with this data
Store the content object streamed as @object_input,
with total length @length. The actual checksum will
be returned as @out_csum.
Repo
If provided, validate content against this checksum
Content object stream
Length of @object_input
Binary checksum
Cancellable
Asynchronously store the content object @object. If provided, the
checksum @expected_checksum will be verified.
Repo
If provided, validate content against this checksum
Input
Length of @object
Cancellable
Invoked when content is writed
User data for @callback
Completes an invocation of ostree_repo_write_content_async().
a #OstreeRepo
a #GAsyncResult
A binary SHA256 checksum of the content object
Store the content object streamed as @object_input, with total
length @length. The given @checksum will be treated as trusted.
This function should be used when importing file objects from local
disk, for example.
Repo
Store content using this ASCII SHA256 checksum
Content stream
Length of @object_input
Cancellable
Store as objects all contents of the directory referred to by @dfd
and @path all children into the repository @self, overlaying the
resulting filesystem hierarchy into @mtree.
Repo
Directory file descriptor
Path
Overlay directory contents into this tree
Optional modifier
Cancellable
Store objects for @dir and all children into the repository @self,
overlaying the resulting filesystem hierarchy into @mtree.
Repo
Path to a directory
Overlay directory contents into this tree
Optional modifier
Cancellable
Store the metadata object @object. Return the checksum
as @out_csum.
If @expected_checksum is not %NULL, verify it against the
computed checksum.
Repo
Object type
If provided, validate content against this checksum
Metadata
Binary checksum
Cancellable
Asynchronously store the metadata object @variant. If provided,
the checksum @expected_checksum will be verified.
Repo
Object type
If provided, validate content against this checksum
Metadata
Cancellable
Invoked when metadata is writed
Data for @callback
Complete a call to ostree_repo_write_metadata_async().
Repo
Result
Binary checksum value
Store the metadata object @variant; the provided @checksum is
trusted.
Repo
Object type
Store object with this ASCII SHA256 checksum
Metadata object stream
Length, may be 0 for unknown
Cancellable
Store the metadata object @variant; the provided @checksum is
trusted.
Repo
Object type
Store object with this ASCII SHA256 checksum
Metadata object
Cancellable
Write all metadata objects for @mtree to repo; the resulting
@out_file points to the %OSTREE_OBJECT_TYPE_DIR_TREE object that
the @mtree represented.
Repo
Mutable tree
An #OstreeRepoFile representing @mtree's root.
Cancellable
Create an `OstreeContentWriter` that allows streaming output into
the repository.
A new writer, or %NULL on error
Repo,
Expected checksum (SHA-256 hex string)
user id
group id
Unix file mode
Expected content length
Extended attributes (GVariant type `(ayay)`)
Synchronously create a file object from the provided content. This API
is intended for small files where it is reasonable to buffer the entire
content in memory.
Unlike `ostree_repo_write_content()`, if @expected_checksum is provided,
this function will not check for the presence of the object beforehand.
Checksum (as a hex string) of the committed file
repo
The expected checksum
User id
Group id
File mode
Extended attributes, GVariant of type (ayay)
File contents
Cancellable
Synchronously create a symlink object.
Unlike `ostree_repo_write_content()`, if @expected_checksum is provided,
this function will not check for the presence of the object beforehand.
Checksum (as a hex string) of the committed file
repo
The expected checksum
User id
Group id
Extended attributes, GVariant of type (ayay)
Target of the symbolic link
Cancellable
Path to repository. Note that if this repository was created
via `ostree_repo_new_at()`, this value will refer to a value in
the Linux kernel's `/proc/self/fd` directory. Generally, you
should avoid using this property at all; you can gain a reference
to the repository's directory fd via `ostree_repo_get_dfd()` and
use file-descriptor relative operations.
Path to directory containing remote definitions. The default is `NULL`.
If a `sysroot-path` property is defined, this value will default to
`${sysroot_path}/etc/ostree/remotes.d`.
This value will only be used for system repositories.
A system using libostree for the host has a "system" repository; this
property will be set for repositories referenced via
`ostree_sysroot_repo()` for example.
You should avoid using this property; if your code is operating
on a system repository, use `OstreeSysroot` and access the repository
object via `ostree_sysroot_repo()`.
Emitted during a pull operation upon GPG verification (if enabled).
Applications can connect to this signal to output the verification
results if desired.
The signal will be emitted from whichever #GMainContext is the
thread-default at the point when ostree_repo_pull_with_options()
is called.
checksum of the signed object
an #OstreeGpgVerifyResult
An extensible options structure controlling checkout. Ensure that
you have entirely zeroed the structure, then set just the desired
options. This is used by ostree_repo_checkout_at() which
supercedes previous separate enumeration usage in
ostree_repo_checkout_tree() and ostree_repo_checkout_tree_at().
This function simply assigns @cache to the `devino_to_csum_cache` member of
@opts; it's only useful for introspection.
Note that cache does *not* have its refcount incremented - the lifetime of
@cache must be equal to or greater than that of @opts.
Checkout options
Devino cache
#OstreeRepoCheckoutFilterResult saying whether or not to checkout this file
Repo
Path to file
File information
User data
Do checkout this object
Ignore this object
No special options
Ignore uid/gid of files
An extensible options structure controlling checkout. Ensure that
you have entirely zeroed the structure, then set just the desired
options. This is used by ostree_repo_checkout_tree_at() which
supercedes previous separate enumeration usage in
ostree_repo_checkout_tree().
No special options
When layering checkouts, unlink() and replace existing files, but do not modify existing directories (unless whiteouts are enabled, then directories are replaced)
Only add new files/directories
Like UNION_FILES, but error if files are not identical (requires hardlink checkouts)
#OstreeRepoCommitFilterResult saying whether or not to commit this file
Repo
Path to file
File information
User data
Do commit this object
Ignore this object
A structure allowing control over commits.
A new commit modifier.
Control options for filter
Function that can inspect individual files
User data
A #GDestroyNotify
See the documentation for
`ostree_repo_devino_cache_new()`. This function can
then be used for later calls to
`ostree_repo_write_directory_to_mtree()` to optimize commits.
Note if your process has multiple writers, you should use separate
`OSTreeRepo` instances if you want to also use this API.
This function will add a reference to @cache without copying - you
should avoid further mutation of the cache.
Modifier
A hash table caching device,inode to checksums
If @policy is non-%NULL, use it to look up labels to use for
"security.selinux" extended attributes.
Note that any policy specified this way operates in addition to any
extended attributes provided via
ostree_repo_commit_modifier_set_xattr_callback(). However if both
specify a value for "security.selinux", then the one from the
policy wins.
An #OstreeRepoCommitModifier
Policy to use for labeling
In many cases, one wants to create a "derived" commit from base commit.
SELinux policy labels are part of that base commit. This API allows
one to easily set up SELinux labeling from a base commit.
Commit modifier
OSTree repo containing @rev
Find SELinux policy from this base commit
If set, this function should return extended attributes to use for
the given path. This is useful for things like ACLs and SELinux,
where a build system can label the files as it's committing to the
repository.
An #OstreeRepoCommitModifier
Function to be invoked, should return extended attributes for path
Destroy notification
Data for @callback:
Flags modifying commit behavior. In bare-user-only mode, @OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CANONICAL_PERMISSIONS
and @OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SKIP_XATTRS are automatically enabled.
No special flags
Do not process extended attributes
Generate size information.
Canonicalize permissions.
Emit an error if configured SELinux policy does not provide a label
Delete added files/directories after commit; Since: 2017.13
If a devino cache hit is found, skip modifier filters (non-directories only); Since: 2017.14
Flags representing the state of a commit in the local repository, as returned
by ostree_repo_load_commit().
Commit is complete. This is the default.
(Since: 2017.14.)
One or more objects are missing from the
local copy of the commit, but metadata is present. (Since: 2015.7.)
One or more objects are missing from the
local copy of the commit, due to an fsck --delete. (Since: 2019.4.)
No special options for traverse
Traverse and retrieve only commit objects. (Since: 2022.2)
Return information on the current directory. This function may
only be called if %OSTREE_REPO_COMMIT_ITER_RESULT_DIR was returned
from ostree_repo_commit_traverse_iter_next().
An iter
Name of current dir
Checksum of current content
Checksum of current metadata
Return information on the current file. This function may only be
called if %OSTREE_REPO_COMMIT_ITER_RESULT_FILE was returned from
ostree_repo_commit_traverse_iter_next().
An iter
Name of current file
Checksum of current file
Initialize (in place) an iterator over the root of a commit object.
An iter
A repo
Variant of type %OSTREE_OBJECT_TYPE_COMMIT
Flags
Initialize (in place) an iterator over a directory tree.
An iter
A repo
Variant of type %OSTREE_OBJECT_TYPE_DIR_TREE
Flags
Step the interator to the next item. Files will be returned first,
then subdirectories. Call this in a loop; upon encountering
%OSTREE_REPO_COMMIT_ITER_RESULT_END, there will be no more files or
directories. If %OSTREE_REPO_COMMIT_ITER_RESULT_DIR is returned,
then call ostree_repo_commit_traverse_iter_get_dir() to retrieve
data for that directory. Similarly, if
%OSTREE_REPO_COMMIT_ITER_RESULT_FILE is returned, call
ostree_repo_commit_traverse_iter_get_file().
If %OSTREE_REPO_COMMIT_ITER_RESULT_ERROR is returned, it is a
program error to call any further API on @iter except for
ostree_repo_commit_traverse_iter_clear().
An iter
Cancellable
OSTree has support for pairing ostree_repo_checkout_tree_at() using
hardlinks in combination with a later
ostree_repo_write_directory_to_mtree() using a (normally modified)
directory. In order for OSTree to optimally detect just the new
files, use this function and fill in the `devino_to_csum_cache`
member of `OstreeRepoCheckoutAtOptions`, then call
ostree_repo_commit_set_devino_cache().
Newly allocated cache
An extensible options structure controlling archive creation. Ensure that
you have entirely zeroed the structure, then set just the desired
options. This is used by ostree_repo_export_tree_to_archive().
Repository
The root directory for the commit referenced by this file
#OstreeRepoFile
the extended attributes
Cancellable
#OstreeRepoFile
name of the child
#OstreeRepoFile
Cancellable
A version of ostree_repo_finder_resolve_async() which queries one or more
@finders in parallel and combines the results.
non-empty array of #OstreeRepoFinders
non-empty array of collection–ref pairs to find remotes for
the local repository which the refs are being resolved for,
which provides configuration information and GPG keys
a #GCancellable, or %NULL
asynchronous completion callback
data to pass to @callback
Get the results from a ostree_repo_finder_resolve_all_async() operation.
array of zero
or more results
#GAsyncResult from the callback
Find reachable remote URIs which claim to provide any of the given @refs. The
specific method for finding the remotes depends on the #OstreeRepoFinder
implementation.
Any remote which is found and which claims to support any of the given @refs
will be returned in the results. It is possible that a remote claims to
support a given ref, but turns out not to — it is not possible to verify this
until ostree_repo_pull_from_remotes_async() is called.
The returned results will be sorted with the most useful first — this is
typically the remote which claims to provide the most @refs, at the lowest
latency.
Each result contains a mapping of @refs to the checksums of the commits
which the result provides. If the result provides the latest commit for a ref
across all of the results, the checksum will be set. Otherwise, if the
result provides an outdated commit, or doesn’t provide a given ref at all,
the checksum will not be set. Results which provide none of the requested
@refs may be listed with an empty refs map.
Pass the results to ostree_repo_pull_from_remotes_async() to pull the given
@refs from those remotes.
an #OstreeRepoFinder
non-empty array of collection–ref pairs to find remotes for
the local repository which the refs are being resolved for,
which provides configuration information and GPG keys
a #GCancellable, or %NULL
asynchronous completion callback
data to pass to @callback
Get the results from a ostree_repo_finder_resolve_async() operation.
array of zero
or more results
an #OstreeRepoFinder
#GAsyncResult from the callback
Find reachable remote URIs which claim to provide any of the given @refs. The
specific method for finding the remotes depends on the #OstreeRepoFinder
implementation.
Any remote which is found and which claims to support any of the given @refs
will be returned in the results. It is possible that a remote claims to
support a given ref, but turns out not to — it is not possible to verify this
until ostree_repo_pull_from_remotes_async() is called.
The returned results will be sorted with the most useful first — this is
typically the remote which claims to provide the most @refs, at the lowest
latency.
Each result contains a mapping of @refs to the checksums of the commits
which the result provides. If the result provides the latest commit for a ref
across all of the results, the checksum will be set. Otherwise, if the
result provides an outdated commit, or doesn’t provide a given ref at all,
the checksum will not be set. Results which provide none of the requested
@refs may be listed with an empty refs map.
Pass the results to ostree_repo_pull_from_remotes_async() to pull the given
@refs from those remotes.
an #OstreeRepoFinder
non-empty array of collection–ref pairs to find remotes for
the local repository which the refs are being resolved for,
which provides configuration information and GPG keys
a #GCancellable, or %NULL
asynchronous completion callback
data to pass to @callback
Get the results from a ostree_repo_finder_resolve_async() operation.
array of zero
or more results
an #OstreeRepoFinder
#GAsyncResult from the callback
Create a new #OstreeRepoFinderAvahi instance. It is intended that one such
instance be created per process, and it be used to answer all resolution
requests from #OstreeRepos.
The calling code is responsible for ensuring that @context is iterated while
the #OstreeRepoFinderAvahi is running (after ostree_repo_finder_avahi_start()
is called). This may be done from any thread.
If @context is %NULL, the current thread-default #GMainContext is used.
a new #OstreeRepoFinderAvahi
a #GMainContext for processing Avahi
events in, or %NULL to use the current thread-default
Start monitoring the local network for peers who are advertising OSTree
repositories, using Avahi. In order for this to work, the #GMainContext
passed to @self at construction time must be iterated (so it will typically
be the global #GMainContext, or be a separate #GMainContext in a worker
thread).
This will return an error (%G_IO_ERROR_FAILED) if initialisation fails, or if
Avahi support is not available (%G_IO_ERROR_NOT_SUPPORTED). In either case,
the #OstreeRepoFinderAvahi instance is useless afterwards and should be
destroyed.
Call ostree_repo_finder_avahi_stop() to stop the repo finder.
It is an error to call this function multiple times on the same
#OstreeRepoFinderAvahi instance, or to call it after
ostree_repo_finder_avahi_stop().
an #OstreeRepoFinderAvahi
Stop monitoring the local network for peers who are advertising OSTree
repositories. If any resolve tasks (from ostree_repo_finder_resolve_async())
are in progress, they will be cancelled and will return %G_IO_ERROR_CANCELLED.
Call ostree_repo_finder_avahi_start() to start the repo finder.
It is an error to call this function multiple times on the same
#OstreeRepoFinderAvahi instance, or to call it before
ostree_repo_finder_avahi_start().
an #OstreeRepoFinderAvahi
Create a new #OstreeRepoFinderConfig.
a new #OstreeRepoFinderConfig
an #OstreeRepoFinder
non-empty array of collection–ref pairs to find remotes for
the local repository which the refs are being resolved for,
which provides configuration information and GPG keys
a #GCancellable, or %NULL
asynchronous completion callback
data to pass to @callback
array of zero
or more results
an #OstreeRepoFinder
#GAsyncResult from the callback
Create a new #OstreeRepoFinderMount, using the given @monitor to look up
volumes. If @monitor is %NULL, the monitor from g_volume_monitor_get() will
be used.
a new #OstreeRepoFinderMount
volume monitor to use, or %NULL to use
the system default
Volume monitor to use to look up mounted volumes when queried.
Create a new #OstreeRepoFinderOverride.
a new #OstreeRepoFinderOverride
Add the given @uri to the set of URIs which the repo finder will search for
matching refs when ostree_repo_finder_resolve_async() is called on it.
URI to add to the repo finder
#OstreeRepoFinderResult gives a single result from an
ostree_repo_finder_resolve_async() or ostree_repo_finder_resolve_all_async()
operation. This represents a single remote which provides none, some or all
of the refs being resolved. The structure includes various bits of metadata
which allow ostree_repo_pull_from_remotes_async() (for example) to prioritise
how to pull the refs.
An #OstreeRepoFinderResult is immutable after construction.
The @priority is used as one input of many to ordering functions like
ostree_repo_finder_result_compare().
@ref_to_checksum indicates which refs (out of the ones queried for as inputs
to ostree_repo_finder_resolve_async()) are provided by this remote. The refs
are present as keys (of type #OstreeCollectionRef), and the corresponding values
are the checksums of the commits the remote currently has for those refs. (These
might not be the latest commits available out of all results.) A
checksum may be %NULL if the remote does not advertise the corresponding ref.
After ostree_repo_finder_resolve_async() has been called, the commit metadata
should be available locally, so the details for each checksum can be looked
up using ostree_repo_load_commit().
@ref_to_timestamp provides timestamps for the set of refs in
@ref_to_checksum. The refs are keys (of type #OstreeCollectionRef) and the
values are guint64 pointers with the timestamp associated with the checksum
provided in @ref_to_checksum. @ref_to_timestamp can be %NULL, and when it's
not, the timestamps are zero when any of the following conditions are met:
(1) the override-commit-ids option was used on
ostree_repo_find_remotes_async (2) there was an error in trying to get the
commit metadata (3) the checksum for this ref is %NULL in @ref_to_checksum.
#OstreeRemote which contains the transport details for the result,
such as its URI and GPG key
the #OstreeRepoFinder instance which produced this result
static priority of the result, where higher numbers indicate lower
priority
map of collection–ref
pairs to checksums provided by this remote; values may be %NULL to
indicate this remote doesn’t provide that ref
Unix timestamp (seconds since the epoch, UTC) when
the summary file on the remote was last modified, or `0` if unknown
map of
collection–ref pairs to timestamps; values may be 0 for various reasons
Create a new #OstreeRepoFinderResult instance. The semantics for the arguments
are as described in the #OstreeRepoFinderResult documentation.
a new #OstreeRepoFinderResult
an #OstreeRemote containing the transport details
for the result
the #OstreeRepoFinder instance which produced the
result
static priority of the result, where higher numbers indicate lower
priority
map of collection–ref pairs to checksums provided by this result
map of collection–ref pairs to timestamps provided by this
result
Unix timestamp (seconds since the epoch, UTC) when
the summary file for the result was last modified, or `0` if this is unknown
Compare two #OstreeRepoFinderResult instances to work out which one is better
to pull from, and hence needs to be ordered before the other.
<0 if @a is ordered before @b, 0 if they are ordered equally,
>0 if @b is ordered before @a
an #OstreeRepoFinderResult
an #OstreeRepoFinderResult
Copy an #OstreeRepoFinderResult.
a newly allocated copy of @result
an #OstreeRepoFinderResult to copy
Free the given @result.
an #OstreeRepoFinderResult
Free the given @results array, freeing each element and the container.
an #OstreeRepoFinderResult
An extensible options structure controlling archive import. Ensure that
you have entirely zeroed the structure, then set just the desired
options. This is used by ostree_repo_import_archive_to_mtree().
Possibly change a pathname while importing an archive. If %NULL is returned,
then @src_path will be used unchanged. Otherwise, return a new pathname which
will be freed via `g_free()`.
This pathname translation will be performed *before* any processing from an
active `OstreeRepoCommitModifier`. Will be invoked for all directory and file
types, first with outer directories, then their sub-files and directories.
Note that enabling pathname translation will always override the setting for
`use_ostree_convention`.
Repo
Stat buffer
Path in the archive
User data
List only loose (plain file) objects
List only packed (compacted into blobs) objects
List all objects
Only list objects in this repo, not parents
No flags.
Only list aliases. Since: 2017.10
Exclude remote refs. Since: 2017.11
Exclude mirrored refs. Since: 2019.2
Flags controlling repository locking.
A "read only" lock; multiple readers are allowed.
A writable lock at most one writer can be active, and zero readers.
See the documentation of #OstreeRepo for more information about the
possible modes.
Files are stored as themselves; checkouts are hardlinks; can only be written as root
Files are compressed, should be owned by non-root. Can be served via HTTP. Since: 2017.12
Legacy alias for `OSTREE_REPO_MODE_ARCHIVE`
Files are stored as themselves, except ownership; can be written by user. Hardlinks work only in user checkouts.
Same as BARE_USER, but all metadata is not stored, so it can only be used for user checkouts. Does not need xattrs.
Same as BARE_USER, but xattrs are stored separately from file content, with dedicated object types.
No special options for pruning
Don't actually delete objects
Do not traverse individual commit objects, only follow refs
Only traverse commit objects. (Since 2022.2)
No special options for pull
Write out refs suitable for mirrors and fetch all refs if none requested
Fetch only the commit metadata
Do verify checksums of local (filesystem-accessible) repositories (defaults on for HTTP)
Since 2017.7. Reject writes of content objects with modes outside of 0775.
Don't verify checksums of objects HTTP repositories (Since: 2017.12)
The remote change operation.
Add a remote
Like above, but do nothing if the remote exists
Delete a remote
Delete a remote, do nothing if the remote does not exist
Add or replace a remote (Since: 2019.2)
No flags.
Exclude remote and mirrored refs. Since: 2019.2
A list of statistics for each transaction that may be
interesting for reporting purposes.
The total number of metadata objects
in the repository after this transaction has completed.
The number of metadata objects that
were written to the repository in this transaction.
The total number of content objects
in the repository after this transaction has completed.
The number of content objects that
were written to the repository in this transaction.
The amount of data added to the repository,
in bytes, counting only content objects.
reserved
reserved
reserved
reserved
No flags
Skip GPG verification
Skip all other signature verification methods
Length of a sha256 digest when expressed as raw bytes
Length of a sha256 digest when expressed as a hexadecimal string
The name of the default ed25519 signing type.
An accessor object for SELinux policy in root located at @path
Path to a root directory
Cancellable
An accessor object for SELinux policy in root located at @rootfs_dfd
Directory fd for rootfs (will not be cloned)
Cancellable
Extract the SELinux policy from a commit object via a partial checkout. This is useful
for labeling derived content as separate commits.
This function is the backend of `ostree_repo_commit_modifier_set_sepolicy_from_commit()`.
A new policy
The repo
ostree ref or checksum
Cancellable
Cleanup function for ostree_sepolicy_setfscreatecon().
Not used, just in case you didn't infer that from the parameter name
Checksum of current policy
Store in @out_label the security context for the given @relpath and
mode @unix_mode. If the policy does not specify a label, %NULL
will be returned.
Self
Path
Unix mode
Return location for security context
Cancellable
Type of current policy
This API should be considered deprecated, because it's supported for
policy objects to be created from file-descriptor relative paths, which
may not be globally accessible.
Path to rootfs
A SePolicy object
Reset the security context of @target based on the SELinux policy.
Self
Path string to use for policy lookup
File attributes
Physical path to target file
Flags controlling behavior
New label, or %NULL if unchanged
Cancellable
Policy
Use this path to determine a label
Used along with @path
Return an array with newly allocated instances of all available
signing engines; they will not be initialized.
an array of signing engines
Create a new instance of a signing engine.
New signing engine, or %NULL if the engine is not known
the name of desired signature engine
Add the public key for verification. Could be called multiple times for
adding all needed keys to be used for verification.
The @public_key argument depends of the particular engine implementation.
@TRUE in case if the key could be added successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
single public key to be added
Clear all previously preloaded secret and public keys.
@TRUE in case if no errors, @FALSE in case of error
an #OstreeSign object
Sign the given @data with pre-loaded secret key.
Depending of the signing engine used you will need to load
the secret key with #ostree_sign_set_sk.
@TRUE if @data has been signed successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
the raw data to be signed with pre-loaded secret key
in case of success will contain signature
A #GCancellable
Verify given data against signatures with pre-loaded public keys.
Depending of the signing engine used you will need to load
the public key(s) with #ostree_sign_set_pk, #ostree_sign_add_pk
or #ostree_sign_load_pk.
@TRUE if @data has been signed at least with any single valid key,
@FALSE in case of error or no valid keys are available (@error will contain the reason).
an #OstreeSign object
the raw data to check
the signatures to be checked
success message returned by the signing engine
Return the pointer to the name of currently used/selected signing engine.
pointer to the name
@NULL in case of error (unlikely).
an #OstreeSign object
Load public keys for verification from anywhere.
It is expected that all keys would be added to already pre-loaded keys.
The @options argument depends of the particular engine implementation.
For example, @ed25515 engine could use following string-formatted options:
- @filename -- single file to use to load keys from
- @basedir -- directory containing subdirectories
'trusted.ed25519.d' and 'revoked.ed25519.d' with appropriate
public keys. Used for testing and re-definition of system-wide
directories if defaults are not suitable for any reason.
@TRUE in case if at least one key could be load successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
any options
Return the pointer to the string with format used in (detached) metadata for
current signing engine.
pointer to the metadata format,
@NULL in case of error (unlikely).
an #OstreeSign object
Return the pointer to the name of the key used in (detached) metadata for
current signing engine.
pointer to the metadata key name,
@NULL in case of error (unlikely).
an #OstreeSign object
Set the public key for verification. It is expected what all
previously pre-loaded public keys will be dropped.
The @public_key argument depends of the particular engine implementation.
@TRUE in case if the key could be set successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
single public key to be added
Set the secret key to be used for signing data, commits and summary.
The @secret_key argument depends of the particular engine implementation.
@TRUE in case if the key could be set successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
secret key to be added
Add the public key for verification. Could be called multiple times for
adding all needed keys to be used for verification.
The @public_key argument depends of the particular engine implementation.
@TRUE in case if the key could be added successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
single public key to be added
Clear all previously preloaded secret and public keys.
@TRUE in case if no errors, @FALSE in case of error
an #OstreeSign object
Add a signature to a commit.
Depending of the signing engine used you will need to load
the secret key with #ostree_sign_set_sk.
@TRUE if commit has been signed successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
an #OsreeRepo object
SHA256 of given commit to sign
A #GCancellable
Verify if commit is signed with known key.
Depending of the signing engine used you will need to load
the public key(s) for verification with #ostree_sign_set_pk,
#ostree_sign_add_pk and/or #ostree_sign_load_pk.
@TRUE if commit has been verified successfully,
@FALSE in case of error or no valid keys are available (@error will contain the reason).
an #OstreeSign object
an #OsreeRepo object
SHA256 of given commit to verify
success message returned by the signing engine
A #GCancellable
Sign the given @data with pre-loaded secret key.
Depending of the signing engine used you will need to load
the secret key with #ostree_sign_set_sk.
@TRUE if @data has been signed successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
the raw data to be signed with pre-loaded secret key
in case of success will contain signature
A #GCancellable
Verify given data against signatures with pre-loaded public keys.
Depending of the signing engine used you will need to load
the public key(s) with #ostree_sign_set_pk, #ostree_sign_add_pk
or #ostree_sign_load_pk.
@TRUE if @data has been signed at least with any single valid key,
@FALSE in case of error or no valid keys are available (@error will contain the reason).
an #OstreeSign object
the raw data to check
the signatures to be checked
success message returned by the signing engine
Return the pointer to the name of currently used/selected signing engine.
pointer to the name
@NULL in case of error (unlikely).
an #OstreeSign object
Load public keys for verification from anywhere.
It is expected that all keys would be added to already pre-loaded keys.
The @options argument depends of the particular engine implementation.
For example, @ed25515 engine could use following string-formatted options:
- @filename -- single file to use to load keys from
- @basedir -- directory containing subdirectories
'trusted.ed25519.d' and 'revoked.ed25519.d' with appropriate
public keys. Used for testing and re-definition of system-wide
directories if defaults are not suitable for any reason.
@TRUE in case if at least one key could be load successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
any options
Return the pointer to the string with format used in (detached) metadata for
current signing engine.
pointer to the metadata format,
@NULL in case of error (unlikely).
an #OstreeSign object
Return the pointer to the name of the key used in (detached) metadata for
current signing engine.
pointer to the metadata key name,
@NULL in case of error (unlikely).
an #OstreeSign object
Set the public key for verification. It is expected what all
previously pre-loaded public keys will be dropped.
The @public_key argument depends of the particular engine implementation.
@TRUE in case if the key could be set successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
single public key to be added
Set the secret key to be used for signing data, commits and summary.
The @secret_key argument depends of the particular engine implementation.
@TRUE in case if the key could be set successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
secret key to be added
Add a signature to a summary file.
Based on ostree_repo_add_gpg_signature_summary implementation.
@TRUE if summary file has been signed with all provided keys
Self
ostree repository
keys -- GVariant containing keys as GVarints specific to signature type.
A #GCancellable
pointer to the name
@NULL in case of error (unlikely).
an #OstreeSign object
@TRUE if @data has been signed successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
the raw data to be signed with pre-loaded secret key
in case of success will contain signature
A #GCancellable
@TRUE if @data has been signed at least with any single valid key,
@FALSE in case of error or no valid keys are available (@error will contain the reason).
an #OstreeSign object
the raw data to check
the signatures to be checked
success message returned by the signing engine
pointer to the metadata key name,
@NULL in case of error (unlikely).
an #OstreeSign object
pointer to the metadata format,
@NULL in case of error (unlikely).
an #OstreeSign object
@TRUE in case if no errors, @FALSE in case of error
an #OstreeSign object
@TRUE in case if the key could be set successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
secret key to be added
@TRUE in case if the key could be set successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
single public key to be added
@TRUE in case if the key could be added successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
single public key to be added
@TRUE in case if at least one key could be load successfully,
@FALSE in case of error (@error will contain the reason).
an #OstreeSign object
any options
Parameters controlling optimization of static deltas.
Optimize for speed of delta creation over space
Optimize for delta size (may be very slow)
Flags controlling static delta index generation.
No special flags
Create a new #OstreeSysroot object for the sysroot at @path. If @path is %NULL,
the current visible root file system is used, equivalent to
ostree_sysroot_new_default().
An accessor object for an system root located at @path
Path to a system root directory, or %NULL to use the
current visible root file system
An accessor for the current visible root / filesystem
Path to deployment origin file
A deployment path
Delete any state that resulted from a partially completed
transaction, such as incomplete deployments.
Sysroot
Cancellable
Prune the system repository. This is a thin wrapper
around ostree_repo_prune_from_reachable(); the primary
addition is that this function automatically gathers
all deployed commits into the reachable set.
You generally want to at least set the `OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY`
flag in @options. A commit traversal depth of `0` is assumed.
Locking: exclusive
Sysroot
Flags controlling pruning
Number of objects found
Number of objects deleted
Storage size in bytes of objects deleted
Cancellable
Older version of ostree_sysroot_stage_tree_with_options().
Sysroot
osname to use for merge deployment
Checksum to add
Origin to use for upgrades
Use this deployment for merge path
Use these as kernel arguments; if %NULL, inherit options from provided_merge_deployment
The new deployment path
Cancellable
Check out deployment tree with revision @revision, performing a 3
way merge with @provided_merge_deployment for configuration.
When booted into the sysroot, you should use the
ostree_sysroot_stage_tree() API instead.
Sysroot
osname to use for merge deployment
Checksum to add
Origin to use for upgrades
Use this deployment for merge path
Options
The new deployment path
Cancellable
Entirely replace the kernel arguments of @deployment with the
values in @new_kargs.
Sysroot
A deployment
Replace deployment's kernel arguments
Cancellable
By default, deployment directories are not mutable. This function
will allow making them temporarily mutable, for example to allow
layering additional non-OSTree content.
Sysroot
A deployment
Whether or not deployment's files can be changed
Cancellable
By default, deployments may be subject to garbage collection. Typical uses of
libostree only retain at most 2 deployments. If @is_pinned is `TRUE`, a
metadata bit will be set causing libostree to avoid automatic GC of the
deployment. However, this is really an "advisory" note; it's still possible
for e.g. older versions of libostree unaware of pinning to GC the deployment.
This function does nothing and returns successfully if the deployment
is already in the desired pinning state. It is an error to try to pin
the staged deployment (as it's not in the bootloader entries).
Sysroot
A deployment
Whether or not deployment will be automatically GC'd
Configure the target deployment @deployment such that it
is writable. There are multiple modes, essentially differing
in whether or not any changes persist across reboot.
The `OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX` state is persistent
across reboots.
Sysroot
Deployment
Transition to this unlocked state
Cancellable
Ensure that @self is set up as a valid rootfs, by creating
/ostree/repo, among other things.
Sysroot
Cancellable
This function may only be called if the sysroot is loaded.
The currently booted deployment, or %NULL if none
Sysroot
Path to deployment root directory
Sysroot
A deployment
Note this function only returns a *relative* path - if you want
to access, it, you must either use fd-relative api such as openat(),
or concatenate it with the full ostree_sysroot_get_path().
Path to deployment root directory, relative to sysroot
Repo
A deployment
Ordered list of deployments
Sysroot
Access a file descriptor that refers to the root directory of this sysroot.
ostree_sysroot_initialize() (or ostree_sysroot_load()) must have been invoked
prior to calling this function.
A file descriptor valid for the lifetime of @self
Sysroot
Find the deployment to use as a configuration merge source; this is
the first one in the current deployment list which matches osname.
Configuration merge deployment
Sysroot
Operating system group
Path to rootfs
Sysroot
Retrieve the OSTree repository in sysroot @self. The repo is guaranteed to be open
(see ostree_repo_open()).
%TRUE on success, %FALSE otherwise
Sysroot
Repository in sysroot @self
Cancellable
The currently staged deployment, or %NULL if none
Sysroot
Initialize the directory structure for an "osname", which is a
group of operating system deployments, with a shared `/var`. One
is required for generating a deployment.
Sysroot
Name group of operating system checkouts
Cancellable
Subset of ostree_sysroot_load(); performs basic initialization. Notably, one
can invoke `ostree_sysroot_get_fd()` after calling this function.
It is not necessary to call this function if ostree_sysroot_load() is
invoked.
sysroot
Can only be invoked after `ostree_sysroot_initialize()`.
%TRUE iff the sysroot points to a booted deployment
Sysroot
Load deployment list, bootversion, and subbootversion from the
rootfs @self.
Sysroot
Cancellable
#OstreeSysroot
Cancellable
Acquire an exclusive multi-process write lock for @self. This call
blocks until the lock has been acquired. The lock is not
reentrant.
Release the lock with ostree_sysroot_unlock(). The lock will also
be released if @self is deallocated.
Self
An asynchronous version of ostree_sysroot_lock().
Self
Cancellable
Callback
User data
Call when ostree_sysroot_lock_async() is ready.
Self
Result
A new config file which sets @refspec as an origin
Sysroot
A refspec
Like ostree_sysroot_cleanup() in that it cleans up incomplete deployments
and old boot versions, but does NOT prune the repository.
Sysroot
Cancellable
Find the pending and rollback deployments for @osname. Pass %NULL for @osname
to use the booted deployment's osname. By default, pending deployment is the
first deployment in the order that matches @osname, and @rollback will be the
next one after the booted deployment, or the deployment after the pending if
we're not looking at the booted deployment.
Sysroot
"stateroot" name
The pending deployment
The rollback deployment
This function is a variant of ostree_sysroot_get_repo() that cannot fail, and
returns a cached repository. Can only be called after ostree_sysroot_initialize()
or ostree_sysroot_load() has been invoked successfully.
The OSTree repository in sysroot @self.
Sysroot
Find the booted deployment, or return an error if not booted via OSTree.
The currently booted deployment, or an error
Sysroot
If this function is invoked, then libostree will assume that
a private Linux mount namespace has been created by the process.
The primary use case for this is to have e.g. /sysroot mounted
read-only by default.
If this function has been called, then when a function which requires
writable access is invoked, libostree will automatically remount as writable
any mount points on which it operates. This currently is just `/sysroot` and
`/boot`.
If you invoke this function, it must be before ostree_sysroot_load(); it may
be invoked before or after ostree_sysroot_initialize().
Prepend @new_deployment to the list of deployments, commit, and
cleanup. By default, all other deployments for the given @osname
except the merge deployment and the booted deployment will be
garbage collected.
If %OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN is
specified, then all current deployments will be kept.
If %OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_PENDING is
specified, then pending deployments will be kept.
If %OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_ROLLBACK is
specified, then rollback deployments will be kept.
If %OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NOT_DEFAULT is
specified, then instead of prepending, the new deployment will be
added right after the booted or merge deployment, instead of first.
If %OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN is
specified, then no cleanup will be performed after adding the
deployment. Make sure to call ostree_sysroot_cleanup() sometime
later, instead.
Sysroot
OS name
Prepend this deployment to the list
Use this deployment for configuration merge
Flags controlling behavior
Cancellable
Stage an overlay initrd to be used in an upcoming deployment. Returns a checksum which
can be passed to ostree_sysroot_deploy_tree_with_options() or
ostree_sysroot_stage_tree_with_options() via the `overlay_initrds` array option.
Sysroot
File descriptor to overlay initrd
Overlay initrd checksum
Cancellable
Older version of ostree_sysroot_stage_tree_with_options().
Sysroot
osname to use for merge deployment
Checksum to add
Origin to use for upgrades
Use this deployment for merge path
Use these as kernel arguments; if %NULL, inherit options from provided_merge_deployment
The new deployment path
Cancellable
Like ostree_sysroot_deploy_tree(), but "finalization" only occurs at OS
shutdown time.
Sysroot
osname to use for merge deployment
Checksum to add
Origin to use for upgrades
Use this deployment for merge path
Options
The new deployment path
Cancellable
Try to acquire an exclusive multi-process write lock for @self. If
another process holds the lock, this function will return
immediately, setting @out_acquired to %FALSE, and returning %TRUE
(and no error).
Release the lock with ostree_sysroot_unlock(). The lock will also
be released if @self is deallocated.
Self
Whether or not the lock has been acquired
Release any resources such as file descriptors referring to the
root directory of this sysroot. Normally, those resources are
cleared by finalization, but in garbage collected languages that
may not be predictable.
This undoes the effect of `ostree_sysroot_load()`.
Sysroot
Clear the lock previously acquired with ostree_sysroot_lock(). It
is safe to call this function if the lock has not been previously
acquired.
Self
Older version of ostree_sysroot_write_deployments_with_options(). This
version will perform post-deployment cleanup by default.
Sysroot
List of new deployments
Cancellable
Assuming @new_deployments have already been deployed in place on disk via
ostree_sysroot_deploy_tree(), atomically update bootloader configuration. By
default, no post-transaction cleanup will be performed. You should invoke
ostree_sysroot_cleanup() at some point after the transaction, or specify
`do_postclean` in @opts. Skipping the post-transaction cleanup is useful
if for example you want to control pruning of the repository.
Sysroot
List of new deployments
Options
Cancellable
Immediately replace the origin file of the referenced @deployment
with the contents of @new_origin. If @new_origin is %NULL,
this function will write the current origin of @deployment.
System root
Deployment
Origin content
Cancellable
libostree will log to the journal various events, such as the /etc merge
status, and transaction completion. Connect to this signal to also
synchronously receive the text for those messages. This is intended to be
used by command line tools which link to libostree as a library.
Currently, the structured data is only available via the systemd journal.
Human-readable string (should not contain newlines)
An upgrader
An #OstreeSysroot
Cancellable
An upgrader
An #OstreeSysroot
Operating system name
Cancellable
An upgrader
An #OstreeSysroot
Operating system name
Flags
Cancellable
Check that the timestamp on @to_rev is equal to or newer than
@from_rev. This protects systems against man-in-the-middle
attackers which provide a client with an older commit.
Repo
From revision
To revision
Write the new deployment to disk, perform a configuration merge
with /etc, and update the bootloader configuration.
Self
Cancellable
A copy of the origin file, or %NULL if unknown
Sysroot
The origin file, or %NULL if unknown
Sysroot
A one-line descriptive summary of the origin, or %NULL if unknown
Upgrader
Perform a pull from the origin. First check if the ref has
changed, if so download the linked objects, and store the updated
ref locally. Then @out_changed will be %TRUE.
If the origin remote is unchanged, @out_changed will be set to
%FALSE.
Upgrader
Flags controlling pull behavior
Flags controlling upgrader behavior
Progress
Whether or not the origin changed
Cancellable
Like ostree_sysroot_upgrader_pull(), but allows retrieving just a
subpath of the tree. This can be used to download metadata files
from inside the tree such as package databases.
Upgrader
Subdirectory path (should include a leading /)
Flags controlling pull behavior
Flags controlling upgrader behavior
Progress
Whether or not the origin changed
Cancellable
Replace the origin with @origin.
Sysroot
The new origin
Cancellable
Flags controlling operation of an #OstreeSysrootUpgrader.
Do not error if the origin has an unconfigured-state key
Enable "staging" (finalization at shutdown); recommended
(Since: 2021.4)
The mtime used for stored files. This was originally 0, changed to 1 for
a few releases, then was reverted due to regressions it introduced from
users who had been using zero before.
ostree version.
ostree version, encoded as a string, useful for printing and
concatenation.
ostree year version component (e.g. 2017 if %OSTREE_VERSION is 2017.2)
#OstreeBloom is an implementation of a bloom filter which supports writing to
and loading from a #GBytes bit array. The caller must store metadata about
the bloom filter (its hash function and `k` parameter value) separately, as
the same values must be used when reading from a serialised bit array as were
used to build the array in the first place.
This is a standard implementation of a bloom filter, and background reading
on the theory can be
[found on Wikipedia](https://en.wikipedia.org/wiki/Bloom_filter). In
particular, a bloom filter is parameterised by `m` and `k` parameters: the
size of the bit array (in bits) is `m`, and the number of hash functions
applied to each element is `k`. Bloom filters require a universal hash
function which can be parameterised by `k`. We have #OstreeBloomHashFunc,
with ostree_str_bloom_hash() being an implementation for strings.
The serialised output from a bloom filter is guaranteed to be stable across
versions of libostree as long as the same values for `k` and the hash
function are used.
#OstreeBloom is mutable when constructed with ostree_bloom_new(), and elements
can be added to it using ostree_bloom_add_element(), until ostree_bloom_seal()
is called to serialise it and make it immutable. After then, the bloom filter
can only be queried using ostree_bloom_maybe_contains().
If constructed with ostree_bloom_new_from_bytes(), the bloom filter is
immutable from construction, and can only be queried.
Reference:
- https://en.wikipedia.org/wiki/Bloom_filter
- https://llimllib.github.io/bloomfilter-tutorial/
In many cases using libostree, a program may need to "break"
hardlinks by performing a copy. For example, in order to
logically append to a file.
This function performs full copying, including e.g. extended
attributes and permissions of both regular files and symbolic links.
If the file is not hardlinked, this function does nothing and
returns successfully.
This function does not perform synchronization via `fsync()` or
`fdatasync()`; the idea is this will commonly be done as part
of an `ostree_repo_commit_transaction()`, which itself takes
care of synchronization.
Directory fd
Path relative to @dfd
Do not copy extended attributes
%TRUE if current libostree has at least the requested version, %FALSE otherwise
Major/year required
Release version required
Modified base64 encoding of @csum
The "modified" term refers to the fact that instead of '/', the '_'
character is used.
An binary checksum of length 32
Overwrite the contents of @buf with modified base64 encoding of @csum.
The "modified" term refers to the fact that instead of '/', the '_'
character is used.
An binary checksum of length 32
Output location, must be at least 44 bytes in length
Overwrite the contents of @buf with stringified version of @csum.
An binary checksum of length 32
Output location, must be at least 45 bytes in length
Binary version of @checksum.
An ASCII checksum
Binary checksum data in @bytes; do not free. If @bytes does not have the correct length, return %NULL.
#GVariant of type ay
Like ostree_checksum_bytes_peek(), but also throws @error.
Binary checksum data
#GVariant of type ay
Compute the OSTree checksum for a given file.
File path
Object type
Return location for binary checksum
Cancellable
Asynchronously compute the OSTree checksum for a given file;
complete with ostree_checksum_file_async_finish().
File path
Object type
Priority for operation, see %G_IO_PRIORITY_DEFAULT
Cancellable
Invoked when operation is complete
Data for @callback
Finish computing the OSTree checksum for a given file; see
ostree_checksum_file_async().
File path
Async result
Return location for binary checksum
Compute the OSTree checksum for a given file. This is an fd-relative version
of ostree_checksum_file() which also takes flags and fills in a caller
allocated buffer.
Directory file descriptor
Subpath
@stbuf (allow-none): Optional stat buffer
Object type
Flags
@out_checksum (out) (transfer full): Return location for hex checksum
Cancellable
Compute the OSTree checksum for a given input.
File information
Optional extended attributes
File content, should be %NULL for symbolic links
Object type
Return location for binary checksum
Cancellable
String form of @csum
An binary checksum of length 32
String form of @csum_bytes
#GVariant of type ay
Overwrite the contents of @buf with stringified version of @csum.
An binary checksum of length 32
Output location, must be at least OSTREE_SHA256_STRING_LEN+1 bytes in length
Convert @checksum from a string to binary in-place, without
allocating memory. Use this function in hot code paths.
a SHA256 string
Output buffer with at least 32 bytes of space
Binary checksum from @checksum of length 32; free with g_free().
An ASCII checksum
New #GVariant of type ay with length 32
An ASCII checksum
Compare two binary checksums, using memcmp().
A binary checksum
A binary checksum
Copy an array of #OstreeCollectionRefs, including deep copies of all its
elements. @refs must be %NULL-terminated; it may be empty, but must not be
%NULL.
a newly allocated copy of @refs
%NULL-terminated array of #OstreeCollectionRefs
Compare @ref1 and @ref2 and return %TRUE if they have the same collection ID and
ref name, and %FALSE otherwise. Both @ref1 and @ref2 must be non-%NULL.
%TRUE if @ref1 and @ref2 are equal, %FALSE otherwise
an #OstreeCollectionRef
another #OstreeCollectionRef
Free the given array of @refs, including freeing all its elements. @refs
must be %NULL-terminated; it may be empty, but must not be %NULL.
an array of #OstreeCollectionRefs
Hash the given @ref. This function is suitable for use with #GHashTable.
@ref must be non-%NULL.
hash value for @ref
an #OstreeCollectionRef
There are use cases where one wants a checksum just of the content of a
commit. OSTree commits by default capture the current timestamp, and may have
additional metadata, which means that re-committing identical content
often results in a new checksum.
By comparing checksums of content, it's possible to easily distinguish
cases where nothing actually changed.
The content checksums is simply defined as `SHA256(root dirtree_checksum || root_dirmeta_checksum)`,
i.e. the SHA-256 of the root "dirtree" object's checksum concatenated with the
root "dirmeta" checksum (both in binary form, not hexadecimal).
A SHA-256 hex string, or %NULL if @commit_variant is not well-formed
A commit object
Reads a commit's "ostree.sizes" metadata and returns an array of
#OstreeCommitSizesEntry in @out_sizes_entries. Each element
represents an object in the commit. If the commit does not contain
the "ostree.sizes" metadata, a %G_IO_ERROR_NOT_FOUND error will be
returned.
variant of type %OSTREE_OBJECT_TYPE_COMMIT
return location for an array of object size entries
Checksum of the parent commit of @commit_variant, or %NULL
if none
Variant of type %OSTREE_OBJECT_TYPE_COMMIT
timestamp in seconds since the Unix epoch, UTC
Commit object
Update provided @dict with standard metadata for bootable OSTree commits.
Root filesystem to be committed
Dictionary to update
A thin wrapper for ostree_content_stream_parse(); this function
converts an object content stream back into components.
Whether or not the stream is zlib-compressed
Path to file containing content
If %TRUE, assume the content has been validated
The raw file content stream
Normal metadata
Extended attributes
Cancellable
A thin wrapper for ostree_content_stream_parse(); this function
converts an object content stream back into components.
Whether or not the stream is zlib-compressed
Directory file descriptor
Subpath
If %TRUE, assume the content has been validated
The raw file content stream
Normal metadata
Extended attributes
Cancellable
The reverse of ostree_raw_file_to_content_stream(); this function
converts an object content stream back into components.
Whether or not the stream is zlib-compressed
Object content stream
Length of stream
If %TRUE, assume the content has been validated
The raw file content stream
Normal metadata
Extended attributes
Cancellable
A new #GVariant containing %OSTREE_OBJECT_TYPE_DIR_META
a #GFileInfo containing directory information
Optional extended attributes
Compute the difference between directory @a and @b as 3 separate
sets of #OstreeDiffItem in @modified, @removed, and @added.
Flags
First directory path, or %NULL
First directory path
Modified files
Removed files
Added files
Cancellable
Compute the difference between directory @a and @b as 3 separate
sets of #OstreeDiffItem in @modified, @removed, and @added.
Flags
First directory path, or %NULL
First directory path
Modified files
Removed files
Added files
Options
Cancellable
Print the contents of a diff to stdout.
First directory path
First directory path
Modified files
Removed files
Added files
Use this function with #GHashTable and ostree_object_name_serialize().
A #GVariant containing a serialized object
Frees the OstreeKernelArgs structure pointed by *loc
Address of an OstreeKernelArgs pointer
Initializes a new OstreeKernelArgs then parses and appends @options
to the empty OstreeKernelArgs
newly allocated #OstreeKernelArgs with @options appended
a string representing command line arguments
Initializes a new OstreeKernelArgs structure and returns it
A newly created #OstreeKernelArgs for kernel arguments
Reverse ostree_object_to_string().
An ASCII checksum
Parsed checksum
Parsed object type
Reverse ostree_object_name_serialize(). Note that @out_checksum is
only valid for the lifetime of @variant, and must not be freed.
A #GVariant of type (su)
Pointer into string memory of @variant with checksum
Return object type
A new floating #GVariant containing checksum string and objtype
An ASCII checksum
An object type
A string containing both @checksum and a stringifed version of @objtype
An ASCII checksum
Object type
The reverse of ostree_object_type_to_string().
A stringified version of #OstreeObjectType
Serialize @objtype to a string; this is used for file extensions.
an #OstreeObjectType
For many asynchronous operations, it's desirable for callers to be
able to watch their status as they progress. For example, an user
interface calling an asynchronous download operation will want to
be able to see the total number of bytes downloaded.
This class provides a mechanism for callees of asynchronous
operations to communicate back with callers. It transparently
handles thread safety, ensuring that the progress change
notification occurs in the thread-default context of the calling
operation.
The ostree_async_progress_get_status() and ostree_async_progress_set_status()
methods get and set a well-known `status` key of type %G_VARIANT_TYPE_STRING.
This key may be accessed using the other #OstreeAsyncProgress methods, but it
must always have the correct type.
These functions implement repository-independent algorithms for
operating on the core OSTree data formats, such as converting
#GFileInfo into a #GVariant.
There are 4 types of objects; file, dirmeta, tree, and commit. The
last 3 are metadata, and the file object is the only content object
type.
All metadata objects are stored as #GVariant (big endian). The
rationale for this is the same as that of the ext{2,3,4} family of
filesystems; most developers will be using LE, and so it's better
to continually test the BE->LE swap.
The file object is a custom format in order to support streaming.
#OstreeGpgVerifyResult contains verification details for GPG signatures
read from a detached #OstreeRepo metadata object.
Use ostree_gpg_verify_result_count_all() and
ostree_gpg_verify_result_count_valid() to quickly check overall signature
validity.
Use ostree_gpg_verify_result_lookup() to find a signature by the key ID
or fingerprint of the signing key.
For more in-depth inspection, such as presenting signature details to the
user, pass an array of attribute values to ostree_gpg_verify_result_get()
or get all signature details with ostree_gpg_verify_result_get_all().
An implementation of #GConverter that compresses data using
LZMA.
An implementation of #GConverter that decompresses data using
LZMA.
In order to commit content into an #OstreeRepo, it must first be
imported into an #OstreeMutableTree. There are several high level
APIs to create an initiable #OstreeMutableTree from a physical
filesystem directory, but they may also be computed
programmatically.
The #OstreeRepo is like git, a content-addressed object store.
Unlike git, it records uid, gid, and extended attributes.
There are four possible "modes" for an #OstreeRepo; %OSTREE_REPO_MODE_BARE
is very simple - content files are represented exactly as they are, and
checkouts are just hardlinks. %OSTREE_REPO_MODE_BARE_USER is similar, except
the uid/gids are not set on the files, and checkouts as hardlinks work only
for user checkouts. %OSTREE_REPO_MODE_BARE_USER_ONLY is the same as
BARE_USER, but all metadata is not stored, so it can only be used for user
checkouts. This mode does not require xattrs. A %OSTREE_REPO_MODE_ARCHIVE
(also known as %OSTREE_REPO_MODE_ARCHIVE_Z2) repository in contrast stores
content files zlib-compressed. It is suitable for non-root-owned
repositories that can be served via a static HTTP server.
Creating an #OstreeRepo does not invoke any file I/O, and thus needs
to be initialized, either from existing contents or as a new
repository. If you have an existing repo, use ostree_repo_open()
to load it from disk and check its validity. To initialize a new
repository in the given filepath, use ostree_repo_create() instead.
To store content in the repo, first start a transaction with
ostree_repo_prepare_transaction(). Then create a
#OstreeMutableTree, and apply functions such as
ostree_repo_write_directory_to_mtree() to traverse a physical
filesystem and write content, possibly multiple times.
Once the #OstreeMutableTree is complete, write all of its metadata
with ostree_repo_write_mtree(), and finally create a commit with
ostree_repo_write_commit().
## Collection IDs
A collection ID is a globally unique identifier which, if set, is used to
identify refs from a repository which are mirrored elsewhere, such as in
mirror repositories or peer to peer networks.
This is separate from the `collection-id` configuration key for a remote, which
is used to store the collection ID of the repository that remote points to.
The collection ID should only be set on an #OstreeRepo if it is the canonical
collection for some refs.
A collection ID must be a reverse DNS name, where the domain name is under the
control of the curator of the collection, so they can demonstrate ownership
of the collection. The later elements in the reverse DNS name can be used to
disambiguate between multiple collections from the same curator. For example,
`org.exampleos.Main` and `org.exampleos.Apps`. For the complete format of
collection IDs, see ostree_validate_collection_id().
#OstreeRepoFinderAvahi is an implementation of #OstreeRepoFinder which looks
for refs being hosted by peers on the local network.
Any ref which matches by collection ID and ref name is returned as a result,
with no limitations on the peers which host them, as long as they are
accessible over the local network, and their adverts reach this machine via
DNS-SD/mDNS.
For each repository which is found, a result will be returned for the
intersection of the refs being searched for, and the refs in `refs/mirrors`
in the remote repository.
DNS-SD resolution is performed using Avahi, which will continue to scan for
matching peers throughout the lifetime of the process. It’s recommended that
ostree_repo_finder_avahi_start() be called early on in the process’ lifetime,
and the #GMainContext which is passed to ostree_repo_finder_avahi_new()
continues to be iterated until ostree_repo_finder_avahi_stop() is called.
The values stored in DNS-SD TXT records are stored as big-endian whenever
endianness is relevant.
Internally, #OstreeRepoFinderAvahi has an Avahi client, browser and resolver
which work in the background to track all available peers on the local
network. Whenever a resolve request is made using
ostree_repo_finder_resolve_async(), the request is blocked until the
background tracking is in a consistent state (typically this only happens at
startup), and is then answered using the current cache of background data.
The Avahi client tracks the #OstreeRepoFinderAvahi’s connection with the
Avahi D-Bus service. The browser looks for DNS-SD peers on the local network;
and the resolver is used to retrieve information about services advertised by
each peer, including the services’ TXT records.
#OstreeRepoFinderConfig is an implementation of #OstreeRepoFinder which looks
refs up in locally configured remotes and returns remote URIs.
Duplicate remote URIs are combined into a single #OstreeRepoFinderResult
which lists multiple refs.
For all the locally configured remotes which have an `collection-id` specified
(see [ostree.repo-config(5)](man:ostree.repo-config(5))), it finds the
intersection of their refs and the set of refs to resolve. If the
intersection is non-empty, that remote is returned as a result. Remotes which
do not have their `collection-id` key configured are ignored.
#OstreeRepoFinderMount is an implementation of #OstreeRepoFinder which looks
refs up in well-known locations on any mounted removable volumes.
For each mounted removable volume, the directory `.ostree/repos.d` will be
enumerated, and all OSTree repositories below it will be searched, in lexical
order, for the requested #OstreeCollectionRefs. The names of the directories
below `.ostree/repos.d` are irrelevant, apart from their lexical ordering.
The directories `.ostree/repo`, `ostree/repo` and `var/lib/flatpak/repo`
will be searched after the others, if they exist.
Non-removable volumes are ignored.
For each repository which is found, a result will be returned for the
intersection of the refs being searched for, and the refs in `refs/heads` and
`refs/mirrors` in the repository on the removable volume.
Symlinks are followed when listing the repositories, so a volume might
contain a single OSTree at some arbitrary path, with a symlink from
`.ostree/repos.d`. Any symlink which points outside the volume’s file
system will be ignored. Repositories are deduplicated in the results.
The volume monitor used to find mounted volumes can be overridden by setting
#OstreeRepoFinderMount:monitor. By default, g_volume_monitor_get() is used.
#OstreeRepoFinderOverride is an implementation of #OstreeRepoFinder which
looks refs up in a list of remotes given by their URI, and returns the URIs
which contain the refs. Duplicate remote URIs are combined into a single
#OstreeRepoFinderResult which lists multiple refs.
Each result is given an #OstreeRepoFinderResult.priority value of 20, which
ranks its results above those from the other default #OstreeRepoFinder
implementations.
Results can only be returned for a ref if a remote and keyring are configured
locally for the collection ID of that ref, otherwise there would be no keys
available to verify signatures on commits for that ref.
This is intended to be used for user-provided overrides and testing software
which uses #OstreeRepoFinder. For production use, #OstreeRepoFinderConfig is
recommended instead.
A #OstreeSePolicy object can load the SELinux policy from a given
root and perform labeling.
An #OstreeSign interface allows to select and use any available engine
for signing or verifying the commit object or summary file.
A #OstreeSysroot object represents a physical root filesystem,
which in particular should contain a toplevel /ostree directory.
Inside this directory is an #OstreeRepo in /ostree/repo, plus a set
of deployments in /ostree/deploy.
This class is not by default safe against concurrent use by threads
or external processes. You can use ostree_sysroot_lock() to
perform locking externally.
The #OstreeSysrootUpgrader class allows performing simple upgrade
operations.
ostree provides macros to check the version of the library
at compile-time
Split a refspec like `gnome-ostree:gnome-ostree/buildmain` or just
`gnome-ostree/buildmain` into two parts. In the first case, @out_remote
will be set to `gnome-ostree`, and @out_ref to `gnome-ostree/buildmain`.
In the second case (a local ref), @out_remote will be %NULL, and @out_ref
will be `gnome-ostree/buildmain`. In both cases, %TRUE will be returned.
%TRUE on successful parsing, %FALSE otherwise
A "refspec" string
Return location for the remote name,
or %NULL if the refspec refs to a local ref
Return location for the ref name
Convert from a "bare" file representation into an
OSTREE_OBJECT_TYPE_FILE stream suitable for ostree pull.
File raw content stream
A file info
Optional extended attributes
Serialized object stream
Cancellable
Like ostree_raw_file_to_archive_z2_stream(), but supports an extensible set
of flags. The following flags are currently defined:
- `compression-level` (`i`): Level of compression to use, 0–9, with 0 being
the least compression, and <0 giving the default level (currently 6).
File raw content stream
A file info
Optional extended attributes
A GVariant `a{sv}` with an extensible set of flags
Serialized object stream
Cancellable
Convert from a "bare" file representation into an
OSTREE_OBJECT_TYPE_FILE stream. This is a fundamental operation
for writing data to an #OstreeRepo.
File raw content stream
A file info
Optional extended attributes
Serialized object stream
Length of stream
Cancellable
The #OstreeRemote structure represents the configuration for a single remote
repository. Currently, all configuration is handled internally, and
#OstreeRemote objects are represented by their textual name handle, or by an
opaque pointer (which can be reference counted if needed).
#OstreeRemote provides configuration for accessing a remote, but does not
provide the results of accessing a remote, such as information about what
refs are currently on a remote, or the commits they currently point to. Use
#OstreeRepo in combination with an #OstreeRemote to query that information.
A version of ostree_repo_finder_resolve_async() which queries one or more
@finders in parallel and combines the results.
non-empty array of #OstreeRepoFinders
non-empty array of collection–ref pairs to find remotes for
the local repository which the refs are being resolved for,
which provides configuration information and GPG keys
a #GCancellable, or %NULL
asynchronous completion callback
data to pass to @callback
Get the results from a ostree_repo_finder_resolve_all_async() operation.
array of zero
or more results
#GAsyncResult from the callback
Free the given @results array, freeing each element and the container.
an #OstreeRepoFinderResult
Return an array with newly allocated instances of all available
signing engines; they will not be initialized.
an array of signing engines
Create a new instance of a signing engine.
New signing engine, or %NULL if the engine is not known
the name of desired signature engine
Use this function to see if input strings are checksums.
%TRUE if @sha256 is a valid checksum string, %FALSE otherwise
SHA256 hex string
Check whether the given @collection_id is valid. Return an error if it is
invalid or %NULL.
Valid collection IDs are reverse DNS names:
* They are composed of 1 or more elements separated by a period (`.`) character.
All elements must contain at least one character.
* Each element must only contain the ASCII characters `[A-Z][a-z][0-9]_` and must not
begin with a digit.
* They must contain at least one `.` (period) character (and thus at least two elements).
* They must not begin with a `.` (period) character.
* They must not exceed 255 characters in length.
(This makes their format identical to D-Bus interface names, for consistency.)
%TRUE if @collection_id is a valid collection ID, %FALSE if it is invalid
or %NULL
A collection ID
%TRUE if @remote_name is a valid remote name
A remote name
%TRUE if @rev is a valid ref string
A revision string
%TRUE if @checksum is a valid ASCII SHA256 checksum
an ASCII string
Use this to validate the basic structure of @commit, independent of
any other objects it references.
%TRUE if @commit is structurally valid
A commit object, %OSTREE_OBJECT_TYPE_COMMIT
%TRUE if @checksum is a valid binary SHA256 checksum
a #GVariant of type "ay"
Use this to validate the basic structure of @dirmeta.
%TRUE if @dirmeta is structurally valid
A dirmeta object, %OSTREE_OBJECT_TYPE_DIR_META
Use this to validate the basic structure of @dirtree, independent of
any other objects it references.
%TRUE if @dirtree is structurally valid
A dirtree object, %OSTREE_OBJECT_TYPE_DIR_TREE
%TRUE if @mode represents a valid file type and permissions
A Unix filesystem mode
%TRUE if @objtype represents a valid object type