Giter VIP home page Giter VIP logo

bonsai's Introduction

bonsai

A truly minimal Linux system.

For the idealists, for the masochists.

Core Philosophy

"Software shouldn't come with compromise."

  1. Static Linking

All programs should be statically linked.
No dependency hell, no searching through the filesystem.
Minimize moving parts. Simpler is better.

  1. Sandboxing

Chroot sandboxes should be dead simple to setup simply by copying the statically-linked binaries.

  1. 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.

  1. 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(), and postbuild()
  • 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
  1. 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.

  1. 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

Special thanks to

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

Achtung!

This is heavily still a WIP.
There are bugs. There are snakes.
Do not use in production.


Support

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.

Community

irc: moving hosts - TBA
discord server (irc mirror): http://discord.gg/qcjRGZv
email: moving hosts - TBA
mailing list: moving hosts - TBA

bonsai's People

Contributors

mitchweaver avatar kayew avatar lucat1 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.