summaryrefslogtreecommitdiff
path: root/src/ostree/ot-admin-builtin-upgrade.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2021-09-02 16:59:15 -0400
committerColin Walters <walters@verbum.org>2021-09-07 16:12:43 -0400
commit8821ec6e569c8e77712f964da6d886fcb665a0cc (patch)
tree1e25703b99c52c632b93c0feeb7027245c7e3c0c /src/ostree/ot-admin-builtin-upgrade.c
parent55a7e74fee369a22f9154b66136c7935fd3129f8 (diff)
downloadostree-8821ec6e569c8e77712f964da6d886fcb665a0cc.tar.gz
upgrade: Stabilize deployment staging
We're waaay overdue for this, it's been the default in rpm-ostree for years, and solves several important bugs around not capturing `/etc` while things are running. Also, `ostree admin upgrade --stage` (should) become idempotent. Closes: https://github.com/ostreedev/ostree/issues/2389
Diffstat (limited to 'src/ostree/ot-admin-builtin-upgrade.c')
-rw-r--r--src/ostree/ot-admin-builtin-upgrade.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ostree/ot-admin-builtin-upgrade.c b/src/ostree/ot-admin-builtin-upgrade.c
index eafe8bce..2c0149c1 100644
--- a/src/ostree/ot-admin-builtin-upgrade.c
+++ b/src/ostree/ot-admin-builtin-upgrade.c
@@ -37,6 +37,7 @@ static gboolean opt_reboot;
static gboolean opt_allow_downgrade;
static gboolean opt_pull_only;
static gboolean opt_deploy_only;
+static gboolean opt_stage;
static char *opt_osname;
static char *opt_override_commit;
@@ -47,6 +48,7 @@ static GOptionEntry options[] = {
{ "override-commit", 0, 0, G_OPTION_ARG_STRING, &opt_override_commit, "Deploy CHECKSUM instead of the latest tree", "CHECKSUM" },
{ "pull-only", 0, 0, G_OPTION_ARG_NONE, &opt_pull_only, "Do not create a deployment, just download", NULL },
{ "deploy-only", 0, 0, G_OPTION_ARG_NONE, &opt_deploy_only, "Do not pull, only deploy", NULL },
+ { "stage", 0, 0, G_OPTION_ARG_NONE, &opt_stage, "Enable staging (finalization at reboot time)", NULL },
{ NULL }
};
@@ -74,9 +76,13 @@ ot_admin_builtin_upgrade (int argc, char **argv, OstreeCommandInvocation *invoca
return FALSE;
}
+ OstreeSysrootUpgraderFlags flags = 0;
+ if (opt_stage)
+ flags |= OSTREE_SYSROOT_UPGRADER_FLAGS_STAGE;
+
g_autoptr(OstreeSysrootUpgrader) upgrader =
- ostree_sysroot_upgrader_new_for_os (sysroot, opt_osname,
- cancellable, error);
+ ostree_sysroot_upgrader_new_for_os_with_flags (sysroot, opt_osname, flags,
+ cancellable, error);
if (!upgrader)
return FALSE;