Running FHS software
How programs written for /usr, /etc and /bin keep working on Zainium OS.
Most Linux software assumes the classic layout: scripts start with #!/usr/bin/env, programs open /etc/passwd or /usr/share/..., and binaries built elsewhere ask for /lib64/ld-linux-x86-64.so.2. Zainium OS keeps them working in two ways.
Packages are adapted when installed
zex rewrites packages from Void, Alpine and Chimera to Zainium paths: the program loader, the library path (RPATH), pkg-config prefixes and script interpreters.
Paths are resolved when used
This is the job of sys_resolver; the short version:
libsys_resolver.so is preloaded into systemd services, login shells and PAM sessions. When a program opens, runs or inspects an FHS path that does not exist, the resolver maps it:
- a leading
/usr/local/or/usr/is removed; lib64becomeslib;lib/modulesbecomesdrivers/modules,lib/firmwarebecomesdrivers/hardware/firmwares,bootbecomeskernel;- the result is tried under
/overlayer/syshub, the musl directory,/overlayer/zexlib/unionand/overlayer/zaisys, in that order.
For example /usr/bin/env becomes /overlayer/syshub/bin/env and /etc/passwd becomes /overlayer/syshub/etc/passwd. /home and /tmp are never touched.
Missing loaders
A program whose loader path does not exist — /lib64/ld-linux-x86-64.so.2 or /lib/ld-musl-x86_64.so.1 — is started with this system's loader of the same C library.
Limits
A preloaded library cannot act in statically linked or setuid programs, because the loader does not preload into those. Such programs need real Zainium paths.