AppBundle Documentation & Implementation Details Labs

tooling.md

by xplshn 2025/05/24

pelf

The pelf command is responsible for assembling an AppBundle by combining an ELF runtime, runtime information, static tools, and a compressed filesystem image.

Functionality

Command-Line Usage

The pelf tool is can be invoked with the following flags:

pelfCreator

The pelfCreator command is a higher-level utility that prepares an AppDir and invokes pelf to create an AppBundle. It supports multiple modes for different use cases.

Functionality

Command-Line Usage

The pelfCreator tool is invoked with the following flags:

Modes of Operation

  1. Sandbox Mode (--sandbox):

    • Retains and binds the proto directory as the root filesystem, with host directory bindings (e.g., /home, /tmp, /etc).
    • Supports trimming of the proto directory using --keep or --getrid flags to reduce size.
    • Uses AppRun.rootfs-based to run the application in a bwrap sandbox.
    • Can be customized via env vars such as SHARE_LOOK, SHARE_FONTS, SHARE_AUDIO, and UID0_GID0 for fine-grained control over sandboxing.
    • Suitable for applications requiring strict isolation from the host system. Or those that refuse to work with the default mode (hybrid)
  2. Sharun Mode (--sharun <binaries>):

    • Processes specified binaries with lib4bin to ensure compatibility and portability.
    • Uses AppRun.sharun (if proto is removed) or AppRun.sharun.ovfsProto (if proto is retained).
    • When using AppRun.sharun.ovfsProto, employs unionfs-fuse to create a copy-on-write overlay of the proto directory.
    • Sets LD_LIBRARY_PATH to include library paths from the AppDir, ensuring binaries can find their dependencies.
    • Ideal for lightweight applications or when minimizing filesystem size is a priority.
  3. Default Mode (can be combined with --sharun, to ship lightweight AppBundles that include a default config file, etc, but otherwise use the system’s files unless they’re missing):

    • Retains the proto directory
    • Supports trimming of the proto directory using --keep or --getrid flags to reduce size.
    • Uses AppRun.sharun.ovfsProto to execute the application with a unionfs-fuse overlay of the user’s / & the AppDir’s proto.
    • Suitable for most applications, as it allows the AppBundle to use files from the system if they don’t exist in the AppDir’s proto and vice-versa

Notes