A truly minimal Linux system.
For the idealists, for the masochists.
- Static Linking
All programs should be statically linked.
No dependency hell, no searching through the filesystem.
Minimize moving parts. Simpler is better.
- Sandboxing
Chroot sandboxes should be dead simple to setup simply by copying the statically-linked binaries.
- A Better C Library
GNU's glibc is massively bloated and a poor choice for static linking.
musl-libc is a fresh lightweight alternative
that was designed from the ground up
to be used with static linking.
Just take a look at this simple hello world comparison.
Applications statically-linked with musl carefully avoid pulling in large amounts of code or data that the application will not use and have no runtime dependencies. Many programs need patching to compile under musl-libc, however this almost always makes their code better.
- Simplicity
No matter how great, a system is bottlenecked by its ability to be understood.
- Sane and optimal default flags
- A modular automated build system with parts that can overriden simply by defining the given function in the pkgfile
- Easy-to-understand "3-phase"
prebuild()
,build()
, andpostbuild()
- Automatic detection of required flags, configs, patches, and workarounds
- Ports can be written with just one line!
- Extensive documentation, with unclear or missing manuals considered a bug
- Sane File System Hierarchy
Similar to GoboLinux, bonsai uses a custom directory scheme:
/include
/lib
/share
/local
(applications not installed via bonsai)
/src
(bonsai home)
/usr
symlinked → /
/sbin
symlinked → /bin
(directories left standard not shown)
A tree of /src
looks like this:
/src
├── /pkgs ← packages
├── /ports ← pkgfiles
├── /sources ← tarballs
├── bonsai.rc ← config file
└── bonsai.db ← database file
Inside each package is its own prefix with given /bin
, /lib
, etc
As a side effect of this, each $pkgdir
is its own chroot filesystem that can
be used at will. In the future, this process is planned to be automated.
Symlinks are created from the package to the outsde root for seamless integration and standards compatibilty.
Example:
% readlink /bin/perl
/src/pkgs/perl/bin/perl
% readlink /share/man/man1/gcc.1
/src/pkgs/gcc/share/man1/gcc.1
With only symlinks, no actual data lives in
/bin
, /lib
, /include
, or /share
on the root.
Thus removing data is as simple as removing a given $pkgdir
from /src/pkgs
.
The symlinks are then tracked and removed once the program is uninstalled.
- Lightweight
These are lightweight/embedded technologies incorporated into bonsai as to be more "suckless" alternatives to conventional GNU/Linux software.
C Library: musl-libc
Libraries: LibreSSL libnl-tiny netbsd-curses libedit
Init System: sinit
Userland: sbase ubase hbase
Shell: dash
Build Automation: pkgconf mk samurai
Networking: sdhcp dropbear
Compression: xz-embedded
Device Management: smdev nldev
Inspirations, technologies, and patches have all been taken from these wonderful projects.
Also:
- Rich Felker's work on musl-crossmake for ease of musl toolchain compilation
- The folks at musl.cc for providing statically-compiled toolchain binaries
This is heavily still a WIP.
There are bugs. There are snakes.
Do not use in production.
Star it! 🌟
It helps get it higher in GitHub's search results and motivates us to continue development.
If you would like to contribute, look into submitting a pull request.
You can see our contributing guidelines here.
irc: moving hosts - TBA
discord server (irc mirror): http://discord.gg/qcjRGZv
email: moving hosts - TBA
mailing list: moving hosts - TBA