diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index e52fc6064d..c5741ea6e0 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -3121,6 +3121,11 @@ ostree_sysroot_stage_tree_with_options (OstreeSysroot *self, g_variant_builder_add (builder, "{sv}", "overlay-initrds", g_variant_new_strv ((const char *const*)opts->overlay_initrds, -1)); + /* Proxy across any flags */ + if (opts && opts->finalization_flags) + g_variant_builder_add (builder, "{sv}", "write-deployment-flags", + g_variant_new_uint32 ((guint32)opts->finalization_flags)); + const char *parent = dirname (strdupa (_OSTREE_SYSROOT_RUNSTATE_STAGED)); if (!glnx_shutil_mkdir_p_at (AT_FDCWD, parent, 0755, cancellable, error)) return FALSE; @@ -3240,14 +3245,15 @@ _ostree_sysroot_finalize_staged (OstreeSysroot *self, staged->staged = FALSE; g_ptr_array_remove_index (self->deployments, 0); - /* TODO: Proxy across flags too? - * - * But note that we always use NO_CLEAN to avoid adding more latency at + OstreeSysrootSimpleWriteDeploymentFlags flags = 0; + g_variant_lookup (self->staged_deployment_data, "write-deployment-flags", "u", &flags); + /* + * Note that we always use NO_CLEAN to avoid adding more latency at * shutdown, and also because e.g. rpm-ostree wants to own the cleanup * process. */ - OstreeSysrootSimpleWriteDeploymentFlags flags = - OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN; + flags |= OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN; + if (!ostree_sysroot_simple_write_deployment (self, ostree_deployment_get_osname (staged), staged, merge_deployment, flags, cancellable, error)) diff --git a/src/libostree/ostree-sysroot.h b/src/libostree/ostree-sysroot.h index 036b81e8ea..560303e7b4 100644 --- a/src/libostree/ostree-sysroot.h +++ b/src/libostree/ostree-sysroot.h @@ -196,9 +196,13 @@ gboolean ostree_sysroot_stage_overlay_initrd (OstreeSysroot *self, GCancellable *cancellable, GError **error); +/** + * finalization_flags: only used in the staging path + */ typedef struct { gboolean unused_bools[8]; - int unused_ints[8]; + int unused_ints[7]; + int finalization_flags; char **override_kernel_argv; char **overlay_initrds; gpointer unused_ptrs[6];