pyplugins.core.live_image module

LiveImage Plugin

Generates a guest filesystem live by creating a setup script that runs on boot. This version uses a tarball for file deployment and a single, batched hypercall for patching.

Overview

  • Stages files and directories for deployment using a tarball.

  • Supports various file actions: delete, move, shim, dir, host_file, inline_file, binary_patch, dev, symlink.

  • Efficient setup script generation using hyp_file_op for file transfer.

  • Batch processing of binary patches via a single hypercall.

  • Handles permissions, symlinks, device nodes, and error reporting.

Usage

The plugin is loaded by the Penguin framework and manages guest filesystem setup and patching.

Arguments

  • proj_dir: Project directory for resolving host files.

  • conf: Configuration dictionary specifying static files and actions.

Classes

  • LiveImage: Main plugin class for guest filesystem setup and patching.

class pyplugins.core.live_image.LiveImage[source]

Bases: Plugin

Generates a guest filesystem live by creating a setup script that runs on boot. This version uses a tarball for file deployment and a single, batched hypercall for patching.

fs_init(func=None)[source]

Decorator for registering fs init callbacks. Can be used as @plugins.live_image.fs_init

Parameters:

func (Callable | None)

portalcall_get(path_ptr, offset, chunk_size, buffer_ptr)[source]
portalcall_get_perm(path_ptr)[source]
portalcall_getsize(path_ptr)[source]
portalcall_put(path_ptr, offset, chunk_size, buffer_ptr)[source]