Simple upgrade class

Simple upgrade class — Upgrade OSTree systems

Synopsis

typedef             OstreeSysrootUpgrader;
OstreeSysrootUpgrader * ostree_sysroot_upgrader_new     (OstreeSysroot *sysroot,
                                                         GCancellable *cancellable,
                                                         GError **error);
OstreeSysrootUpgrader * ostree_sysroot_upgrader_new_for_os
                                                        (OstreeSysroot *sysroot,
                                                         const char *osname,
                                                         GCancellable *cancellable,
                                                         GError **error);
enum                OstreeSysrootUpgraderFlags;
OstreeSysrootUpgrader * ostree_sysroot_upgrader_new_for_os_with_flags
                                                        (OstreeSysroot *sysroot,
                                                         const char *osname,
                                                         OstreeSysrootUpgraderFlags flags,
                                                         GCancellable *cancellable,
                                                         GError **error);
GKeyFile *          ostree_sysroot_upgrader_get_origin  (OstreeSysrootUpgrader *self);
gboolean            ostree_sysroot_upgrader_set_origin  (OstreeSysrootUpgrader *self,
                                                         GKeyFile *origin,
                                                         GCancellable *cancellable,
                                                         GError **error);
char *              ostree_sysroot_upgrader_get_origin_description
                                                        (OstreeSysrootUpgrader *self);
gboolean            ostree_sysroot_upgrader_check_timestamps
                                                        (OstreeRepo *repo,
                                                         const char *from_rev,
                                                         const char *to_rev,
                                                         GError **error);
enum                OstreeSysrootUpgraderPullFlags;
gboolean            ostree_sysroot_upgrader_pull        (OstreeSysrootUpgrader *self,
                                                         OstreeRepoPullFlags flags,
                                                         OstreeSysrootUpgraderPullFlags upgrader_flags,
                                                         OstreeAsyncProgress *progress,
                                                         gboolean *out_changed,
                                                         GCancellable *cancellable,
                                                         GError **error);
gboolean            ostree_sysroot_upgrader_pull_one_dir
                                                        (OstreeSysrootUpgrader *self,
                                                         const char *dir_to_pull,
                                                         OstreeRepoPullFlags flags,
                                                         OstreeSysrootUpgraderPullFlags upgrader_flags,
                                                         OstreeAsyncProgress *progress,
                                                         gboolean *out_changed,
                                                         GCancellable *cancellable,
                                                         GError **error);
gboolean            ostree_sysroot_upgrader_deploy      (OstreeSysrootUpgrader *self,
                                                         GCancellable *cancellable,
                                                         GError **error);

Description

The OstreeSysrootUpgrader class allows performing simple upgrade operations.

Details

OstreeSysrootUpgrader

typedef struct OstreeSysrootUpgrader OstreeSysrootUpgrader;

ostree_sysroot_upgrader_new ()

OstreeSysrootUpgrader * ostree_sysroot_upgrader_new     (OstreeSysroot *sysroot,
                                                         GCancellable *cancellable,
                                                         GError **error);

sysroot :

An OstreeSysroot

Returns :

An upgrader. [transfer full]

ostree_sysroot_upgrader_new_for_os ()

OstreeSysrootUpgrader * ostree_sysroot_upgrader_new_for_os
                                                        (OstreeSysroot *sysroot,
                                                         const char *osname,
                                                         GCancellable *cancellable,
                                                         GError **error);

sysroot :

An OstreeSysroot

osname :

Operating system name. [allow-none]

Returns :

An upgrader. [transfer full]

enum OstreeSysrootUpgraderFlags

typedef enum {
  OSTREE_SYSROOT_UPGRADER_FLAGS_NONE = (1 << 0),
  OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED = (1 << 1),
} OstreeSysrootUpgraderFlags;

Flags controlling operation of an OstreeSysrootUpgrader.

OSTREE_SYSROOT_UPGRADER_FLAGS_NONE

No options

OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED

Do not error if the origin has an unconfigured-state key

ostree_sysroot_upgrader_new_for_os_with_flags ()

OstreeSysrootUpgrader * ostree_sysroot_upgrader_new_for_os_with_flags
                                                        (OstreeSysroot *sysroot,
                                                         const char *osname,
                                                         OstreeSysrootUpgraderFlags flags,
                                                         GCancellable *cancellable,
                                                         GError **error);

sysroot :

An OstreeSysroot

osname :

Operating system name. [allow-none]

flags :

Flags

Returns :

An upgrader. [transfer full]

ostree_sysroot_upgrader_get_origin ()

GKeyFile *          ostree_sysroot_upgrader_get_origin  (OstreeSysrootUpgrader *self);

self :

Sysroot

Returns :

The origin file, or NULL if unknown. [transfer none]

ostree_sysroot_upgrader_set_origin ()

gboolean            ostree_sysroot_upgrader_set_origin  (OstreeSysrootUpgrader *self,
                                                         GKeyFile *origin,
                                                         GCancellable *cancellable,
                                                         GError **error);

Replace the origin with origin.

self :

Sysroot

origin :

The new origin. [allow-none]

cancellable :

Cancellable

error :

Error

ostree_sysroot_upgrader_get_origin_description ()

char *              ostree_sysroot_upgrader_get_origin_description
                                                        (OstreeSysrootUpgrader *self);

self :

Upgrader

Returns :

A one-line descriptive summary of the origin, or NULL if unknown

ostree_sysroot_upgrader_check_timestamps ()

gboolean            ostree_sysroot_upgrader_check_timestamps
                                                        (OstreeRepo *repo,
                                                         const char *from_rev,
                                                         const char *to_rev,
                                                         GError **error);

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 :

Repo

from_rev :

From revision

to_rev :

To revision

error :

Error

enum OstreeSysrootUpgraderPullFlags

typedef enum {
  OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_NONE = 0,
  OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_ALLOW_OLDER = (1 << 0)
} OstreeSysrootUpgraderPullFlags;

OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_NONE

OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_ALLOW_OLDER


ostree_sysroot_upgrader_pull ()

gboolean            ostree_sysroot_upgrader_pull        (OstreeSysrootUpgrader *self,
                                                         OstreeRepoPullFlags flags,
                                                         OstreeSysrootUpgraderPullFlags upgrader_flags,
                                                         OstreeAsyncProgress *progress,
                                                         gboolean *out_changed,
                                                         GCancellable *cancellable,
                                                         GError **error);

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.

self :

Upgrader

flags :

Flags controlling pull behavior

upgrader_flags :

Flags controlling upgrader behavior

progress :

Progress. [allow-none]

out_changed :

Whether or not the origin changed. [out]

cancellable :

Cancellable

error :

Error

ostree_sysroot_upgrader_pull_one_dir ()

gboolean            ostree_sysroot_upgrader_pull_one_dir
                                                        (OstreeSysrootUpgrader *self,
                                                         const char *dir_to_pull,
                                                         OstreeRepoPullFlags flags,
                                                         OstreeSysrootUpgraderPullFlags upgrader_flags,
                                                         OstreeAsyncProgress *progress,
                                                         gboolean *out_changed,
                                                         GCancellable *cancellable,
                                                         GError **error);

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.


ostree_sysroot_upgrader_deploy ()

gboolean            ostree_sysroot_upgrader_deploy      (OstreeSysrootUpgrader *self,
                                                         GCancellable *cancellable,
                                                         GError **error);

Write the new deployment to disk, perform a configuration merge with /etc, and update the bootloader configuration.

self :

Self

cancellable :

Cancellable

error :

Error