deb: use overlayfs instead of copy
CI / build (push) Failing after 14m44s
CI / snap (push) Has been skipped

This commit is contained in:
2026-08-12 15:44:13 +02:00
parent e25645b3bb
commit 317dbcd062
3 changed files with 158 additions and 7 deletions
+10
View File
@@ -337,6 +337,16 @@ impl EphemeralContextGuard {
impl Drop for EphemeralContextGuard {
fn drop(&mut self) {
log::debug!("Cleaning up ephemeral context ({:?})...", self.chroot_path);
// Clean up any overlay mounts before resetting the context.
// This must happen while the ephemeral context is still current so its
// driver is accessible. The actual unmount commands run via the parent
// (base) context, so they work regardless.
let ephemeral_ctx = context::current();
if let Err(e) = ephemeral_ctx.cleanup() {
log::warn!("Failed to clean up overlay mounts: {}", e);
}
// Reset to normal context
if let Err(e) = context::manager().set_current(&self.previous_context) {
log::error!("Failed to restore context {}: {}", self.previous_context, e);