t[draft] make your own distro - monochromatic - monochromatic blog: http://blog.z3bra.org
 (HTM) git clone git://z3bra.org/monochromatic
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) commit ae43d9c7115b411fde59290cc96072ce2344757b
 (DIR) parent f4e94709b37a9edfb1d118a8f916fd4794a46c2f
 (HTM) Author: z3bra <willyatmailoodotorg>
       Date:   Tue, 19 Jan 2016 20:58:47 +0100
       
       t[draft] make your own distro
       
       Diffstat:
         A 2016/01/make-your-own-distro.txt    |      66 +++++++++++++++++++++++++++++++
       
       1 file changed, 66 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/2016/01/make-your-own-distro.txt b/2016/01/make-your-own-distro.txt
       t@@ -0,0 +1,66 @@
       +# [Make your own distro](#)
       +## &mdash; 17 January, 2016
       +
       +Happy new year everyone! For the new year I've decided to focus more on
       +projects, and less on "ricing" which bores me more and more...  
       +So here is a fun project I'm working on: Making my own linux distro!
       +
       +I consider building a linux distribution from scratch to be one of the coolest
       +things one could do with their computers. And I finally got into it!
       +
       +First off all, I have never built an [LFS](https://linuxfromscratch.org) system,
       +and will probably never do (their documentation is great though).
       +
       +### Scope
       +
       +So here I am, sitting in front of my computer, deciding what this "new distro"
       +should be. I've always liked the idea of [sta.li](http://sta.li), an similar
       +distributions ala [rlsd2](http://rlsd2.dimakrasner.com). Minimalist systems
       +trying to bring fresh new ideas on the table of linux distributions. So I
       +decided to list the things I wanted in my distro:
       +
       +* statically compiled
       +* stripped down userland
       +* simplified file system
       +* port-tree featuring plan9's mk(1)
       +* featuring new/obscure softwares when possible
       +
       +I chose each point because I though it would be and interresting challenge,
       +allowing me to learn more about linux distributions in the process. I'm not
       +trying to argue that X is better than Y, or anyhing amongst those lines.
       +
       +### Toolchains
       +
       +There are, from my experience, three important toolchains when building a
       +distro:
       +
       +* Compilation toolchain
       +* Package management toolchain
       +* Testing toolchain
       +
       +Each one is as important as the two others, because they will define how
       +efficient you'll be for the whole project.  
       +
       +#### Compilation toolchain
       +I am using [pcc](http://pcc.ludd.ltu.se) as my complier of choice, and
       +[musl](http://musl-libc.org) as my libc.
       +
       +To this day, I couldn't find a suitable replacement for GNU's binutils, but am
       +still looking forrward to elfutils and elftoolchain.
       +
       +To make it easier to work with this toolchain, I decided to build a
       +cross-compiler featuring both. I also had to create one using gcc, until I can
       +figure out a patch for softwares that can't compile with pcc.
       +
       +#### Package management toolchain
       +There are a lot of them. But the most challenging one will be the one I'll write
       +myself. This is why I wrote [pm](http://git.z3bra.org/pm/log.html), my pack
       +manager. It's still a work in progress, but it can install, delete and inspect
       +packs in a given directory, which is perfect for my needs.
       +
       +For the packaging of softwares, I decided to go with an mk(1) based port-tree
       +ala BSD. Inspired by the [morpheus port-tree](http://git.2f30.org/ports/log.html),
       +it follows the way the *BSD handle their own port-tree, while using mk(1) from
       +plan9, which is, in my opinion, more predictable. For more information on mk,
       +check the link [maintaining files on plan9 with
       +mk](http://plan9.bell-labs.com/sys/doc/mk.html).