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