MiniMyth from minimyth.org
Build System Instructions
General

The MiniMyth build system is called GAR MiniMyth. It uses a somewhat modified version of the GAR build system to build MiniMyth. Building MiniMyth from source is not for the faint of heart. It takes a long time to build and may fail to build on some systems.

The build system has three stages:

  1. build the native environment,
  2. build the cross environment and
  3. build MiniMyth.

While most packages needed for MiniMyth only build their cross versions, some of the packages needed for MiniMyth such as MySQL need to build their native versions in order to build their cross versions.

This long, multi-stage, build process exists to ensure independence from the local system on which MiniMyth is being built. We do not want MiniMyth binaries to link to or depend on local system libraries. We do not want differences in local system environments to result in differences in the MiniMyth builds.

Unfortunately, the price for this local system independence is time and disk space. For me, on a 2.4GHz Intel Core 2 Quad Q6600 computer running CentOS 5.6 x86_64, a complete build for i386-pentium takes approximately 8.25 hours and 31.25GB of disk space.

However, if you wish to build MiniMyth from source, then you can either build any version in the MiniMyth download directory or any version found in the version control system. If you wish to build a version found in the MiniMyth download directory, then you will want to follow the instructions for retrieving the build system from the download directory. If you wish to build a version found in the version control system, then you will want to follow the instructions for retrieving the build system from the version control system.

Prerequisites

The build system assumes that you are building on either an i386 or an x86_64 architecture computer that is running Linux. In addition, the build system assumes that you have a basic set of binaries and libraries installed, including:

  • bash (or other Posix compatible shell),
  • binutils,
  • bison,
  • bzip2,
  • coreutils,
  • cvs,
  • diffutils,
  • findutils,
  • flex,
  • gawk,
  • gcc,
  • git (the version control system not the GNU interactive tools),
  • glibc (including static and development libraries),
  • grep,
  • gzip,
  • guzip,
  • util-linux,
  • make,
  • mercurial (also known as hg),
  • patch,
  • sed,
  • subversion (also known as svn),
  • texinfo,
  • tar,
  • wget and
  • xz.

The build system does its best to check for the presence of any needed binaries at the beginning of the build process.

In order to ensure independence from the local system on which MiniMyth is being built, the build system only uses these binaries and libraries for the early part of the native environment build stage. During the native environment build stage, the MiniMyth build system builds its own versions of these binaries and libraries (with the exception of cvs, glibc and subversion).

Some Linux distributions, including Fedora, install and use ccache as part of their collection of developer packages. Unfortunately, ccache breaks the MiniMyth build system. Therefore, before you attempt to build MiniMyth, make sure that the ccache package is not installed on your system.

Some Linux distributions, including Fedora, enable Security Enhanced Linux (selinux) policies that break the MiniMyth build system. Therefore, before you attempt to build MiniMyth, make sure that selinux is disabled on your system.

Some packages included in MiniMyth will fail to build when the file system is NTFS. Therefore, do not extract and build MiniMyth on an NTFS file system. MiniMyth is known to build when the file system is ext3.

Retrieving the build system from the download directory

Retrieving the MiniMyth build system from the MiniMyth download directory is easy:

  1. Download the files that are necessary for building MiniMyth from source. These files can be found in the 'gar-minimyth-{version}.tar.bz2' file in a MiniMyth distribution download directory. The location of the MiniMyth distribution download directories can be found in the MiniMyth download instructions.
  2. Extract the 'gar-minimyth-{version}.tar.bz2' file by running the command 'tar -jxf gar-minimyth-{version}.tar.bz2. This should create the directory 'gar-minimyth-{version}', which is the root of the MiniMyth build system.
Retrieving the build system from the version control system

MiniMyth uses Google Code's Subversion version control system.

To use you will need the Subversion client, which should be available through your Linux distribution's package management system.

Once you have installed the Subversion client, you can synchronize with the Subversion server by following the instructions here.

Information on how to use Subversion can be found in the free online book: "Version Control with Subversion".

Build instructions

If your local system meets the prerequisites, and you have obtained a copy of the MiniMyth build system by either downloading it from the download directory or checking it out from the version control system, then you are ready to build MiniMyth.

You can build MiniMyth by following these steps:

  1. Configure the build system with your settings in your '$(HOME)/.minimyth/minimyth.conf.mk' file. These settings override the default settings in the build system's '{build-root}/script/minimyth.conf.mk' file, where '{build-root}' is the root directory of the MiniMyth build system. Be sure to set 'mm_HOME' to the root directory of the MiniMyth build system. The build system does its best to check for stale, incorrect or missing settings, but it cannot catch everything. Therefore, be sure that your '${HOME}/.minimyth/minimyth.conf.mk' file is up-to-date and contains correct values for settings that you need or want to override.
  2. Clean the entire build system by running the command 'cd {build-root} ; make clean'.
  3. Download the distribution source files by running the following command 'cd ${build-root} ; make garchive'. Because some source tarballs are large and some download servers are slow, this can take awhile.
  4. Build MiniMyth by running the following command 'cd ${build-root}/script/meta/minimyth ; make build'. This is the step that take a long time.
  5. Install MiniMyth by running the following command 'cd ${build-root}/script/meta/minimyth ; make install'.

While care is taken to make sure the build system is free of bugs, assuming that it is free of bugs would be foolish. If a bug in the build system caused the build system to install files in the wrong location, then your local system could be crippled. Therefore, the build system performs checks to reduce the chance that it will damage the system.

First, the build system checks whether or not you are the root user (any user with UID='0' or GID='0'). If you are the root user, then the build system prints an error message and exits. Everything, with the exception of parts of 'make install', can be done as a user with very limited access rights.

Second, the build system checks whether or not you have write access to typical system directories. If you have write access to any of these directories, then the build system prints an error message and exits.

However, 'make install' needs to perform the following operations as root:

  • copy files to the TFTP directory, when mm_INSTALL_RAM_ROOT='yes',
  • copy files to the TFTP and NFS directories, when mm_INSTALL_NFS_ROOT='yes' and
  • copy files to the TFTP directory, when mm_INSTALL_LATEST='yes'.

As a result, 'make install' may prompt you for the root password, depending on your settings in '${HOME}/.minimyth/minimyth.conf.mk'.