3 ms·
I did something similar years ago, though it may have been under NetBSD. The important thing to remember is that init is just a program. It is an important pro
by II2II 3y ago
I did something similar years ago, though it may have been under NetBSD.
The important thing to remember is that init is just a program. It is an important program since it does some setup and starts some services, but any other program can take its place as long as it doesn't depend upon the initialization performed by init. For example: the article mentions statically linking Vim. That is because most systems place shared libraries in /usr/lib, with /usr being on a separate partition. Mounting other partitions is part of the setup stage, so programs that use shared libraries are unlikely to work. That is no longer a concern with static linking. (If I recall correctly, shared libraries will still work in such a scenario if the required libraries are on the root partition. Yet that takes much more effort to setup.)
The kernel proper provides enough to run generic programs up to and including a terminal emulator. If you want to run programs with dependencies, you could still bypass init by writing a script that only does the necessary initialization.
- midasuni 3y ago> most systems place shared libraries in /usr/lib, with /usr being on a separate partition It’s not 1995 any more.
- ObscureScience 3y agoI would however say that the justification for using /usr/bin is to simplify the possibility of having most of the system on a separate partition. Merged mounts and namespaces à la Plan9 would be an elegant alternative