onelf
Directories packed into self-contained executables
Author:
@QaidVoidProject Page: https://github.com/QaidVoid/onelf
onelf packs a directory into a single self-contained ELF executable. The file carries a trailing footer, a zstd-compressed manifest, and a compressed payload, with a static musl runtime stub at the front that knows how to bring the payload up.
It exists for the case a static binary cannot cover: a program that comes with its own libraries or data files, where upstream ships something dynamically linked and there is nothing to statically link instead.
In soarpkgs
Prerequisites (HOST)
Nothing in particular. The runtime tries a ladder of execution modes and uses the first one the host supports, so it adapts rather than requiring anything.
Fonts are still the host's, so non-English characters, symbols and emoji need them installed.
Execution modes
memfd a static single binary, straight into an anonymous fd
userns + FUSE private mount, invisible, torn down by the kernel
fusermount3 + FUSE host-visible mount, still lazy
userns + tmpfs extracted into a private tmpfs
runtime directory extracted into a private per-user directory
persistent cache only on requestEvery rung but the last leaves nothing behind when the application exits. Mounting is preferred over extracting wherever the host allows it, since it decompresses blocks on demand and starts fast regardless of package size.
The persistent cache is the exception, because it is the one mode that leaves something on disk. The runtime never falls into it on its own: it runs when the package was built with it, when ONELF_CACHE=1 is set, or when it is asked for explicitly.
ONELF_MODE forces a particular rung, which is useful for narrowing down a problem. A forced mode that fails is an error rather than a fallback:
See execution modes for what each one requires and what it costs.
Quirks
Last updated