Skip to content

Commit

Permalink
fixup! WIP: Add concept of "staged" deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
cgwalters committed Mar 26, 2018
1 parent 2814ca0 commit 08cb290
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/libostree/ostree-sysroot-deploy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2438,6 +2438,7 @@ sysroot_initialize_deployment (OstreeSysroot *self,
static gboolean
sysroot_finalize_deployment (OstreeSysroot *self,
OstreeDeployment *deployment,
char **override_kernel_argv,
OstreeDeployment *merge_deployment,
GCancellable *cancellable,
GError **error)
Expand All @@ -2447,7 +2448,8 @@ sysroot_finalize_deployment (OstreeSysroot *self,
if (!glnx_opendirat (self->sysroot_fd, deployment_path, TRUE, &deployment_dfd, error))
return FALSE;

if (merge_deployment)
/* Only use the merge if we didn't get an override */
if (!override_kernel_argv && merge_deployment)
{
/* Override the bootloader arguments */
OstreeBootconfigParser *merge_bootconfig = ostree_deployment_get_bootconfig (merge_deployment);
Expand Down Expand Up @@ -2522,7 +2524,8 @@ ostree_sysroot_deploy_tree (OstreeSysroot *self,
&deployment, cancellable, error))
return FALSE;

if (!sysroot_finalize_deployment (self, deployment, provided_merge_deployment,
if (!sysroot_finalize_deployment (self, deployment, override_kernel_argv,
provided_merge_deployment,
cancellable, error))
return FALSE;

Expand Down Expand Up @@ -2694,15 +2697,16 @@ _ostree_sysroot_deploy_staged (OstreeSysroot *self,
if (!merge_deployment)
return FALSE;
}
g_autofree char **kargs = NULL;
g_variant_lookup (self->staged_deployment_data, "kargs", "^a&s", &kargs);

/* Unlink the staged state now; if we're interrupted in the middle,
* we don't want e.g. deal with the partially written /etc merge.
*/
if (!glnx_unlinkat (AT_FDCWD, _OSTREE_SYSROOT_RUNSTATE_STAGED, 0, error))
return FALSE;

if (!sysroot_finalize_deployment (self, self->staged_deployment,
merge_deployment,
if (!sysroot_finalize_deployment (self, self->staged_deployment, NULL, merge_deployment,
cancellable, error))
return FALSE;

Expand Down

0 comments on commit 08cb290

Please sign in to comment.