I have decided to build a Linux distro after some consideration of how things have changed, seeming to move away from the roots of Linux.
Not liking the changes from real paths for various bin and sbin into symlinks. Want to have an init choice.
Reviewing some things like acl, and the various 'kits', and other things to see what is really needed.
The goal is to create a distro with a normal FHS filesystem tree, a choice of init, complete package selection on install.
Fluxbox/Xorg is a first choice, and I am still reviewing some other window managers/desktops.
Want a LiveCD to provide a combination of binary installs and source build/installs for packages.
Would like to make a Linux system builder LiveCD with a full compliment of compilers and libraries.
I like the LFS idea, but would like to take this a step farther for finer control of the system build.
I have found an excellent method for starting the process of building a distro:
- Use the latest SystemRescueCD + Virtualbox (virtual sata drives: 10 gb + 512 mb swap drive)
- Use the upstream GNU sources (unbranded) to build a 'base system' (enough to boot)
- Build a native gcc compiler for the distro (decide on the arch level, like i686)
- Build a kernel for the distro
- Build system V init and write some basic rc scripts
Note: SystemRescueCD will give you a zsh for each console, so before working, invoke: bash
A lot of the upstream sources can be found at (http) gnu.org (choose a mirror) and directory.fsf.org/wiki/All
More sources at gcc.gnu.org/mirrors.html and www.gnu.org/prep/ftp.html
The kernel from kernel.org (patches are only needed to bring an older kernel version to the version you see listed).
So you just need the kernel, like for 3.19.3 use the tar.xz link, get the pgp signature file too.
You can get gcc from gcc.gnu.org, many dependencies are included, except for a few.
Dependencies needed (these are libraries), found on the gnu mirrors, for example (ftp) gnu.mirrors.pair.com/gnu/gnu/
Watch the version numbering, its easy to overlook it by the sort order. Like 3.10.2 is newer than 3.4.2
Read the gcc install guide (repeatedly, its a lot to digest but worth it, start with 1.prerequisites): gcc.gnu.org/install
I use the Debian package search tool to check dependencies: www.debian.org/distrib/packages
This is a great way to really learn and understand how a Linux system works.
I learned a lot just in this past week.
I have compiled binutils successfully, and installed it to the distro filesystem.
This is a test version for now because I have some tweaks to add on the next compile.
Mostly wanted to see where things ended up after an install and test the configure options.
Stil working on the gcc compiler build - need to resolve the chicken before the egg thing with the gnat/ada compiler.
Here are some things I did for the binutils build:
I already created a single partition using fdisk and created an ext3 filesystem on /dev/sda1 (vbox).
Create a full FHS tree on the distro filesystem (make all the base directories needed).
I made a bash script for this if anyone has an interest.
In vbox, /dev/sda1 is mounted as /mnt/distro and this is the distro root / for the install.
Make a directory on the distro system for builds, like: /mnt/distro/builds
Unpack binutils into this directory using tar (one of the below choices):
- tar -vxzf binutils-2.25.tar.gz
- tar -vxjf binutils-2.25.tar.bz2
- tar -vxJf binutils-2.25.tar.xz
- tar -vx -lzip -f binutils-2.25.tar.lz
- tar -vx -lzop -f binutils-2.25.tar.lzo
- tar -vx -lzma -f binutils-2.25.tar.lzma
Write the configure options into 2 files (1 is for reference).
You can view one in a console while editing the other.
./configure --help > cfigs
cat cfigs > ofigs
An example of some basic choices in the cfigs file for my machine (Use only 1 space before each --option, no blank lines):
I have specific locations in mind for the install, yours may vary.
Run the configure script by invoking configure and giving the custom options in the cfigs file:
sh ./configure $(cat cfigs | tr -d "\n")
Read the config.log to see if there are needs.
If all is well then invoke: make
If all is still well then invoke: make DESTDIR=/mnt/distro install
Make sure you use the keyword DESTDIR exactly as it looks.
This is the key to installing to a root path of your choice.
I am working from console (did not startx). If you want more tty consoles, invoke: openvty
This will push the dmesg streaming console from tty7 to tty8 and give you tty1 - tty7.
You can open more consoles by repeating the openvty command.
These are just some things I worked out this past week, hope it helps,