OSTree.Deployment

g GObject.Object GObject.Object OSTree.Deployment OSTree.Deployment GObject.Object->OSTree.Deployment

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (index, osname, csum, deployserial, bootcsum, bootserial)

class

origin_remove_transient_state (origin)

class

unlocked_state_to_string (state)

clone ()

equal (bp)

get_bootconfig ()

get_bootcsum ()

get_bootserial ()

get_csum ()

get_deployserial ()

get_index ()

get_origin ()

get_origin_relpath ()

get_osname ()

get_unlocked ()

hash ()

is_finalization_locked ()

is_pinned ()

is_staged ()

set_bootconfig (bootconfig)

set_bootserial (index)

set_index (index)

set_origin (origin)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class OSTree.Deployment(**kwargs)
Bases:

GObject.Object

Abstract:

No

classmethod new(index, osname, csum, deployserial, bootcsum, bootserial)
Parameters:
  • index (int) – Global index into the bootloader entries

  • osname (str) – “stateroot” for this deployment

  • csum (str) – OSTree commit that will be deployed

  • deployserial (int) – Unique counter

  • bootcsum (str or None) – Kernel/initrd checksum

  • bootserial (int) – Unique index

Returns:

New deployment

Return type:

OSTree.Deployment

classmethod origin_remove_transient_state(origin)
Parameters:

origin (GLib.KeyFile) – An 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.

New in version 2018.3.

classmethod unlocked_state_to_string(state)
Parameters:

state (OSTree.DeploymentUnlockedState) –

Returns:

Description of state

Return type:

str

New in version 2016.4.

clone()
Returns:

New deep copy of self

Return type:

OSTree.Deployment

equal(bp)
Parameters:

bp (OSTree.Deployment) – A deployment

Returns:

True if deployments have the same osname, csum, and deployserial

Return type:

bool

get_bootconfig()
Returns:

Boot configuration

Return type:

OSTree.BootconfigParser or None

get_bootcsum()
Return type:

str

get_bootserial()
Return type:

int

get_csum()
Return type:

str

get_deployserial()
Return type:

int

get_index()
Returns:

The global index into the bootloader ordering

Return type:

int

get_origin()
Returns:

Origin

Return type:

GLib.KeyFile or None

get_origin_relpath()
Returns:

Path to deployment root directory, relative to sysroot

Return type:

str

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

get_osname()
Return type:

str

get_unlocked()
Return type:

OSTree.DeploymentUnlockedState

New in version 2016.4.

hash()
Returns:

An integer suitable for use in a GHashTable

Return type:

int

is_finalization_locked()
Returns:

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

Return type:

bool

New in version 2023.8.

is_pinned()
Returns:

TRUE if deployment will not be subject to GC

Return type:

bool

See OSTree.Sysroot.deployment_set_pinned().

New in version 2018.3.

is_staged()
Returns:

TRUE if deployment should be “finalized” at shutdown time

Return type:

bool

New in version 2018.3.

set_bootconfig(bootconfig)
Parameters:

bootconfig (OSTree.BootconfigParser or None) – Bootloader configuration object

Set or clear the bootloader configuration.

set_bootserial(index)
Parameters:

index (int) – Don’t use this

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

set_index(index)
Parameters:

index (int) – Index into bootloader ordering

Sets the global index into the bootloader ordering.

set_origin(origin)
Parameters:

origin (GLib.KeyFile or None) – Set the origin for this deployment

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