Merge pull request #3077 from cgwalters/debug-finalization-lock

deploy: Remove lock when re-staging
This commit is contained in:
Joseph Marrero Corchado 2023-10-13 16:05:44 -04:00 committed by GitHub
commit 5d92407ba9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -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. */

View File

@ -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)