feat(arje-incarnate): A5 — pivot_root + OverlayFS

Dos ChildPreExec nuevos en el hook declarativo pre-execve:
- MountOverlay { target, options } — monta OverlayFS (capa base RO +
  capa de sesión RW + workdir).
- PivotRoot { new_root, put_old, old_root_after } — bind-mount de
  new_root sobre sí mismo + pivot_root + chdir("/") + umount2 lazy
  (MNT_DETACH) del root viejo.

Builders ergonómicos en ChildSetup:
- with_overlay(lower, upper, work, merged)
- with_pivot_root(new_root, put_old_name)

Ambas ops corren en el hijo post-clone, dentro del mount namespace,
async-signal-safe (solo libc, sin allocator). Las consumirán mirada
(compositor Wayland) y matilda Ghost para rootfs aislados.

19 tests arje-incarnate verdes (3 nuevos: builders overlay/pivot).
cargo check --workspace verde. Pendiente: integration test en entorno
con namespaces reales.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
sergio
2026-05-20 00:35:31 +00:00
parent 545dd59c72
commit f8a2547b45
3 changed files with 194 additions and 3 deletions
+3
View File
@@ -31,6 +31,9 @@ pub enum IncarnateError {
#[error("invalid argv: contains NUL byte")]
InvalidArgv,
#[error("rootfs path contains NUL byte (pivot_root / overlayfs)")]
InvalidRootfsPath,
}
/// Cuando `strict_caps = false`, errores no-fatales se reportan como