Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy: Remove lock when re-staging #3077

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/libostree/ostree-sysroot-deploy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3676,6 +3676,9 @@ ostree_sysroot_stage_tree_with_options (OstreeSysroot *self, const char *osname,
{
if (!_ostree_sysroot_rmrf_deployment (self, self->staged_deployment, cancellable, error))
return FALSE;
// Also remove the lock; xref https://github.com/ostreedev/ostree/issues/3025
if (!ot_ensure_unlinked_at (AT_FDCWD, _OSTREE_SYSROOT_RUNSTATE_STAGED_LOCKED, error))
return FALSE;
}

/* Bump mtime so external processes know something changed, and then reload. */
Expand Down
8 changes: 8 additions & 0 deletions tests/kolainst/destructive/staged-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ EOF
test ! -f /run/ostree/staged-deployment-locked
echo "ok cleanup staged"

# And verify that re-staging cleans the previous lock
test '!' -f /run/ostree/staged-deployment
ostree admin deploy --stage staged-deploy
test -f /run/ostree/staged-deployment
test '!' -f /run/ostree/staged-deployment-locked
ostree admin undeploy 0
echo "ok restage unlocked"

# Upgrade with staging
ostree admin deploy --stage staged-deploy
origcommit=$(ostree rev-parse staged-deploy)
Expand Down
Loading