Dualayer Hierarchy Standard
A layered filesystem hierarchy in which musl and GNU libc run side by side. Dualayer = dual (two C libraries) + layer (a system built from layers). Zainium OS is its reference implementation.
Why a new hierarchy
The Filesystem Hierarchy Standard puts the vendor's software and the user's software together under /usr, and assumes one C library. That makes it hard to keep the base apart from what users install, to upgrade the base as one unit, and to have a second C library.
DHS gives every part of the system its own layer with a single owner, composes the layers into one view at boot with OverlayFS, and gives each C library a directory of its own. The root holds only /overlayer, user data and virtual filesystems — no /usr, /lib64, /etc or /var. At run time the system layer is read-only; its etc and var are writable layers whose changes are kept in the userland layer.
/ ├── overlayer/ │ ├── syshub/ system layer: the base OS │ │ ├── bin/ lib/ include/ share/ etc/ var/ │ │ └── x86_64-<vendor>-linux-musl/ │ ├── userland/ userland layer │ │ └── union/ │ │ └── x86_64-<vendor>-linux-gnu/ │ ├── ignition/ kernels, initramfs, boot loader │ ├── agents/ instructions for AI agents │ └── .syshub-pending/ └── home/ root/ tmp/ run/ dev/ proc/ sys/
The layers
| Layer | DHS path | Zainium OS |
|---|---|---|
| System layer: the base OS, changed only by base upgrades | /overlayer/syshub | syshub |
| Userland layer: software the user installs, the OverlayFS upper layer | /overlayer/userland | zexlib |
| Ignition layer: kernels, initramfs and boot loader, read-only | /overlayer/ignition | zaisys |
A distribution may give the userland and ignition layers names of its own, as Zainium OS does, if the structure inside them stays the same.
musl and glibc, side by side
Each distribution chooses its primary C library, the one the base is built against. The other is the optional secondary. Whether the secondary ships in the system layer or as a userland package varies by distribution — both conform.
musl primary, glibc secondary
The base is built against musl; glibc is added for prebuilt glibc software. Used by Zainium OS, with glibc as a userland package.
glibc primary, musl secondary
The base is built against glibc, as most distributions are today; musl is added for software built for musl distributions or small static programs.
Conflicts the layout prevents
Implement DHS in your distribution
The specification is licensed under CC BY-SA 4.0 and written in DocBook, like the FHS it builds on. Issues and pull requests from distribution, toolchain and package-manager maintainers are welcome. See also how Zainium OS implements it.