Skip to content

Core Components

Luiys edited this page Jul 23, 2026 · 1 revision

Core Components

Melina is built upon three isolated pillars that work in tandem.

1. The ALPM Hook (00-melina-shield.hook)

Located at /etc/pacman.d/hooks/, this configuration file acts as the tripwire. It monitors pacman transactions for specific structural packages.

[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Package
Target = linux
Target = systemd
Target = mkinitcpio
Target = amd-ucode
Target = intel-ucode

When any of these targets are queued for modification, the hook intercepts the process and executes the Bash Engine.

2. The Bash Engine (melina-shield)

Located at /usr/local/bin/melina-shield, this is a silent, idempotent script.

Execution Flow:

  1. Resolves the ESP mount point via bootctl -p.

  2. Evaluates the architecture: looks for .conf files in loader/entries for Standard deployments, or .efi binaries in EFI/Linux for Unified Kernel Images (UKI).

  3. Purges deprecated -safe artifacts.

  4. Performs a cp -p (preserving attributes) of the current working binaries.

  5. Generates the melina-fallback.conf entry for systemd-boot. It only writes to disk if the configuration has changed, reducing I/O wear on the ESP.


3. The CLI Orchestrator (melina)

Located at /usr/local/bin/melina, this Ruby script handles state management. It provides the init, remove, and restore commands, effectively hiding the complexity of paths, permissions, and hook generation from the end-user.

Clone this wiki locally