Skip to content

Commit

Permalink
Proxy across write deployment flags
Browse files Browse the repository at this point in the history
Signed-off-by: Rafael Fonseca <[email protected]>
  • Loading branch information
r4f4 committed May 20, 2021
1 parent 1d26bbd commit 0cf7080
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/libostree/ostree-sysroot-deploy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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))
Expand Down
6 changes: 5 additions & 1 deletion src/libostree/ostree-sysroot.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 0cf7080

Please sign in to comment.