## ostree-deployment

ostree-deployment

## Functions

guint | ostree_deployment_hash ()
gboolean | ostree_deployment_equal ()
OstreeDeployment * | ostree_deployment_new ()
int | ostree_deployment_get_index ()
const char * | ostree_deployment_get_osname ()
int | ostree_deployment_get_deployserial ()
const char * | ostree_deployment_get_csum ()
const char * | ostree_deployment_get_bootcsum ()
int | ostree_deployment_get_bootserial ()
OstreeBootconfigParser * | ostree_deployment_get_bootconfig ()
GKeyFile * | ostree_deployment_get_origin ()
char * | ostree_deployment_get_origin_relpath ()
OstreeDeploymentUnlockedState | ostree_deployment_get_unlocked ()
gboolean | ostree_deployment_is_pinned ()
gboolean | ostree_deployment_is_staged ()
gboolean | ostree_deployment_is_finalization_locked ()
void | ostree_deployment_set_index ()
void | ostree_deployment_set_bootserial ()
void | ostree_deployment_set_bootconfig ()
void | ostree_deployment_set_origin ()
void | ostree_deployment_origin_remove_transient_state ()
OstreeDeployment * | ostree_deployment_clone ()
const char * | ostree_deployment_unlocked_state_to_string ()

## Types and Values

| OstreeDeployment

## Description

## Functions

### ostree_deployment_hash ()

    guint
    ostree_deployment_hash (gconstpointer v);

#### Parameters

v | Deployment. | [type OstreeDeployment]

#### Returns

An integer suitable for use in a `GHashTable`

### ostree_deployment_equal ()

    gboolean
    ostree_deployment_equal (gconstpointer ap,
                             gconstpointer bp);

#### Parameters

ap | A deployment. | [type OstreeDeployment]
bp | A deployment. | [type OstreeDeployment]

#### Returns

`TRUE` if deployments have the same osname, csum, and deployserial

### ostree_deployment_new ()

    OstreeDeployment *
    ostree_deployment_new (int index,
                           const char *osname,
                           const char *csum,
                           int deployserial,
                           const char *bootcsum,
                           int bootserial);

#### Parameters

index | Global index into the bootloader entries |
osname | "stateroot" for this deployment |
csum | OSTree commit that will be deployed |
deployserial | Unique counter |
bootcsum | Kernel/initrd checksum. | [nullable]
bootserial | Unique index |

#### Returns

New deployment.

[transfer full][not nullable]

### ostree_deployment_get_index ()

    int
    ostree_deployment_get_index (OstreeDeployment *self);

#### Parameters

self | Deployment |

#### Returns

The global index into the bootloader ordering

### ostree_deployment_get_osname ()

    const char *
    ostree_deployment_get_osname (OstreeDeployment *self);

### ostree_deployment_get_deployserial ()

    int
    ostree_deployment_get_deployserial (OstreeDeployment *self);

### ostree_deployment_get_csum ()

    const char *
    ostree_deployment_get_csum (OstreeDeployment *self);

### ostree_deployment_get_bootcsum ()

    const char *
    ostree_deployment_get_bootcsum (OstreeDeployment *self);

### ostree_deployment_get_bootserial ()

    int
    ostree_deployment_get_bootserial (OstreeDeployment *self);

### ostree_deployment_get_bootconfig ()

    OstreeBootconfigParser *
    ostree_deployment_get_bootconfig (OstreeDeployment *self);

#### Parameters

self | Deployment |

#### Returns

Boot configuration.

[transfer none][nullable]

### ostree_deployment_get_origin ()

    GKeyFile *
    ostree_deployment_get_origin (OstreeDeployment *self);

#### Parameters

self | Deployment |

#### Returns

Origin.

[transfer none][nullable]

### ostree_deployment_get_origin_relpath ()

    char *
    ostree_deployment_get_origin_relpath (OstreeDeployment *self);

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()`.

#### Parameters

self | A deployment |

#### Returns

Path to deployment root directory, relative to sysroot.

[not nullable][transfer full]

### ostree_deployment_get_unlocked ()

    OstreeDeploymentUnlockedState
    ostree_deployment_get_unlocked (OstreeDeployment *self);

Since: 2016.4

### ostree_deployment_is_pinned ()

    gboolean
    ostree_deployment_is_pinned (OstreeDeployment *self);

See `ostree_sysroot_deployment_set_pinned()`.

#### Parameters

self | Deployment |

#### Returns

`TRUE` if deployment will not be subject to GC

Since: 2018.3

### ostree_deployment_is_staged ()

    gboolean
    ostree_deployment_is_staged (OstreeDeployment *self);

#### Parameters

self | Deployment |

#### Returns

`TRUE` if deployment should be "finalized" at shutdown time

Since: 2018.3

### ostree_deployment_is_finalization_locked ()

    gboolean
    ostree_deployment_is_finalization_locked
                                   (OstreeDeployment *self);

#### Parameters

self | Deployment |

#### Returns

`TRUE` if deployment is queued to be "finalized" at shutdown time, but requires additional action.

Since: 2023.8

### ostree_deployment_set_index ()

    void
    ostree_deployment_set_index (OstreeDeployment *self,
                                 int index);

Sets the global index into the bootloader ordering.

#### Parameters

self | Deployment |
index | Index into bootloader ordering |

### ostree_deployment_set_bootserial ()

    void
    ostree_deployment_set_bootserial (OstreeDeployment *self,
                                      int index);

Should never have been made public API; don't use this.

#### Parameters

self | Deployment |
index | Don't use this |

### ostree_deployment_set_bootconfig ()

    void
    ostree_deployment_set_bootconfig (OstreeDeployment *self,
                                      OstreeBootconfigParser *bootconfig);

Set or clear the bootloader configuration.

#### Parameters

self | Deployment |
bootconfig | Bootloader configuration object. | [nullable]

### ostree_deployment_set_origin ()

    void
    ostree_deployment_set_origin (OstreeDeployment *self,
                                  GKeyFile *origin);

Replace the "origin", which is a description of the source of the deployment and how to update to the next version.

#### Parameters

self | Deployment |
origin | Set the origin for this deployment. | [nullable]

### ostree_deployment_origin_remove_transient_state ()

    void
    ostree_deployment_origin_remove_transient_state
                                   (GKeyFile *origin);

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.

#### Parameters

origin | An origin |

Since: 2018.3

### ostree_deployment_clone ()

    OstreeDeployment *
    ostree_deployment_clone (OstreeDeployment *self);

#### Parameters

self | Deployment |

#### Returns

New deep copy of `self` .

[not nullable][transfer full]

### ostree_deployment_unlocked_state_to_string ()

    const char *
    ostree_deployment_unlocked_state_to_string
                                   (OstreeDeploymentUnlockedState state);

#### Returns

Description of state.

[not nullable]

Since: 2016.4

## Types and Values

### OstreeDeployment

    typedef struct {
      GObject parent_instance;

      int index;
      char *osname;
      char *csum;
      int deployserial;
      char *bootcsum;
      int bootserial;
      OstreeBootconfigParser *bootconfig;
      GKeyFile *origin;
      OstreeDeploymentUnlockedState unlocked;
      gboolean staged;
      gboolean finalization_locked;
      char **overlay_initrds;
      char *overlay_initrds_id;
    } OstreeDeployment;

#### Members

int `index`; | Global offset |
char *`osname`; |  |
char *`csum`; | OSTree checksum of tree |
int `deployserial`; | How many times this particular csum appears in deployment list |
char *`bootcsum`; | Checksum of kernel+initramfs |
int `bootserial`; | An integer assigned to this tree per its ${bootcsum} |
OstreeBootconfigParser *`bootconfig`; | Bootloader configuration |
GKeyFile *`origin`; | How to construct an upgraded version of this tree |
OstreeDeploymentUnlockedState `unlocked`; | The unlocked state |
gboolean `staged`; | TRUE iff this deployment is staged |
gboolean `finalization_locked`; |  |
char **`overlay_initrds`; | Checksums of staged additional initrds for this deployment |
char *`overlay_initrds_id`; | Unique ID generated from initrd checksums; used to compare deployments |