pyplugins.core.core module¶
core.py - Core plugin for Penguin¶
This module provides the Core plugin, which performs basic sanity checks, configuration management, and core logic for the penguin emulation environment. It is responsible for:
Validating required arguments at initialization.
Writing configuration and loaded plugin information to the output directory.
Handling SIGUSR1 for graceful shutdown of emulation.
Creating a .ran file in the output directory after a non-crash shutdown.
Optionally enforcing a timeout for emulation and shutting down after the specified period.
Setting up environment variables for features like root shell, graphics, shared directory, strace, ltrace, and forced WWW.
Logging information about available services (e.g., root shell, VNC) based on configuration and environment.
Arguments¶
timeout (int, optional): Timeout in seconds for automatic shutdown.
Plugin Interface¶
This plugin does not provide a direct interface for other plugins, but it writes configuration and plugin information to files in the output directory, which other plugins or tools may read. It also sets environment variables in the configuration dictionary that may be used by other components or plugins.
Overall Purpose¶
The Core plugin ensures the emulation environment is correctly set up, manages shutdown procedures, and records essential information for reproducibility and debugging.
- class pyplugins.core.core.Core[source]¶
Bases:
PluginCore plugin for PyPlugins.
Performs sanity checks, manages configuration, handles shutdown signals, and enforces optional timeouts for the emulation environment.
- graceful_shutdown(sig, frame)[source]¶
Handle SIGUSR1 for graceful shutdown.
- Args:
sig (int): Signal number. frame: Current stack frame.
- Parameters:
sig (int)
- Return type:
None
- shutdown_after_timeout(timeout, shutdown_event)[source]¶
Shutdown the emulation after a specified timeout.
- Args:
panda (Panda): The Panda emulation object. timeout (int): Timeout in seconds before shutdown. shutdown_event (threading.Event): Event to signal early shutdown.
- Parameters:
timeout (int)
shutdown_event (Event)
- Return type:
None