Skip to main content

Module rootfs

Module rootfs 

Source
Expand description

Guest rootfs management module.

This module handles preparation and management of guest rootfs for MicroVM instances. The rootfs contains the minimal filesystem required to boot the guest agent.

Two rootfs providers are available:

  • CopyProvider — full recursive copy (works everywhere)
  • OverlayProvider — Linux overlayfs mount (near-instant CoW)

Structs§

AttachedRootfs
A temporarily attached persistent rootfs.
CopyProvider
Full recursive copy provider — works on all platforms.
GuestLayout
Guest filesystem layout.
OverlayProvider
Overlayfs provider — near-instant CoW mounts (Linux only).
RootfsBuilder
Builder for creating guest rootfs.
RootfsFileInfo
Minimal file metadata needed to classify filesystem changes.

Constants§

DIFF_BASELINE_FILE
Filename stored beside each box rootfs.
GUEST_WORKDIR
Working directory inside the guest VM.

Traits§

RootfsProvider
Abstracts how a rootfs directory is prepared for a box from a cached lower layer.

Functions§

attach_persistent_rootfs
Attach an existing platform-backed persistent rootfs for offline access.
create_diff_baseline_if_absent
Persist the first pristine baseline for a box without ever replacing it.
default_provider
Auto-detect the best available rootfs provider for the current platform.
read_persisted_exit_code
Read the exit code persisted by guest-init from the active writable rootfs.
stage_box_terminal_rootfs_metadata
Invalidate the last clean-shutdown metadata generation before launching a box, retaining it at the one-shot replay path used by guest-init.
unmount_box_overlay
Unmount a box’s overlayfs merged view — best-effort and idempotent.
unmount_box_rootfs
Unmount a platform-specific writable rootfs mount.
walk_rootfs
Capture a rootfs tree while excluding runtime-owned control files.