How the system bootstraps itself
--------------------------------


After unpacking the Midori Distribution you find one makefile (16 lines) and a
directoriy called apps with *.mlz files. Those contain all the packages that
will ultimatly be installed. There is also a docs/ directory which is empty
for now but will eventually contain several files with documentation regarding
Midori Linux

The bootstrapping process works as follows:

 1. After typing make, the toplevel Makefile tries to include the file
    cache/scripts/Makefile, which does not exist and which needs to be created.
    In order to do so the package base/mlbuild-0.2.mlb (basically a tarball) is
    extracted into cache/build/mlbuild-0.2

 2. The build script for that package is executed, which copies a few files
    into cache/scripts, among them the missing Makefile.

 3. That Makefile tries to include the file .config.mk, which contains all the
     options that are relevant for the build.

 4. To create .config.mk a user configuration file is needed. By default its
    called 'config', and if it does not exist it will be created by the
    configurator package. So the Makefile will extract the package
    base/configurator-0.1.mlb into cache/copnfigurator-0.1.

 5. The Makefile will then use that package to create the config file. The
    configurator will go through all packages in base and apps and extract
    their CONFIG files. This will take a while, but the result is cached for
    future runs. Then it creates the config file.

 6. The Makefile will now call the configurator again to create the .config.mk
    file (the second run will be much faster as the CONFIG files have already
    been extracted).

 7. Now that the base build system is setup, all packages are unpacked into
    cache/build and their build scripts are exeuted up to the function
    installconfig. This function is supposed to store data that is relevant to
    other packages in some files. Examples include kernel options and which
    tools busybox needs to install.

8.  If there were no conflicts, the compilation of packages starts:

        1. binutils is compiled and installed into tools (it is configured as a
           crosscompiler system) It contains linker, assembler, and some other
           vital commands.

        2. The correct kernel is unpacked and configured in order to create the
           kernel header files (liunx/* and asm/*)

        3. A minial version of Gcc is compiled as a crosscompiler and without
           the use of glibc

        4. the newly created gcc is then used to compile glibc, which is
           installed into cache/tools

        5. Gcc is compiled again, but this times with more options turned on
           (c++, and it uses glibc now).

 9. Now all the programs necessary to compile packages are compiled and
    installed in cache/tools, so one package after the other is compiled and
    installed.

10. The init scripts are created

11. The kernel is compiled

12. ld.so.cache is created on the image system

13. The images are created that can then be used to create a running system.







