deb: use overlayfs instead of copy
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user