Difference between revisions of "Bering-uClibc 4.x - Developer Guide - Preparing the Build Environment"

From bering-uClibc
Jump to: navigation, search
(Added requirement for "git" and "perl-Date-Format"u -)
m (Corrected "Cloning the Git Repository" section in line with not-so-recent changes to the Git directory structure)
 
(7 intermediate revisions by 2 users not shown)
Line 9: Line 9:
  
  
==Hardware==
+
==Pre-Requisites==
===CPU & RAM===
+
===Hardware===
 +
====CPU & RAM====
 
Compiling source code is a CPU- and RAM-intensive operation, so a reasonably powerful machine is advisable. Multiple CPU cores are a benefit, especially for compiling the build environment itself (the target GCC etc.).
 
Compiling source code is a CPU- and RAM-intensive operation, so a reasonably powerful machine is advisable. Multiple CPU cores are a benefit, especially for compiling the build environment itself (the target GCC etc.).
  
Line 19: Line 20:
 
;200 minutes : Intel(R) Pentium(R) 4 CPU 2.80GHz (Single Core) with 2GB SDRAM, Fedora 10 (32-bit)
 
;200 minutes : Intel(R) Pentium(R) 4 CPU 2.80GHz (Single Core) with 2GB SDRAM, Fedora 10 (32-bit)
  
===Disk Space===
+
====Disk Space====
 
A fully built development environment with all of the [[Bering-uClibc 4.x]] Packages and all of the kernel variants occupies more than 7.5 Gigabytes of disk space.
 
A fully built development environment with all of the [[Bering-uClibc 4.x]] Packages and all of the kernel variants occupies more than 7.5 Gigabytes of disk space.
  
 
Assume that 8 Gigabytes are required.
 
Assume that 8 Gigabytes are required.
  
 
+
===Operating System===
==Operating System==
+
 
The [[Bering-uClibc 4.x]] kernel and Packages can be built on any modern Linux distribution which has the necessary software development utilities installed. Examples of distributions which are known to work include:
 
The [[Bering-uClibc 4.x]] kernel and Packages can be built on any modern Linux distribution which has the necessary software development utilities installed. Examples of distributions which are known to work include:
 
* Fedora 10 (32-bit)
 
* Fedora 10 (32-bit)
 
* Fedora 14 (64-bit)
 
* Fedora 14 (64-bit)
 +
* Fedora 15 (64-bit)
 +
** Fails for [[Bering-uClibc 4.0]]; OK for 4.1 and above
  
 
The following are known '''not''' to work:
 
The following are known '''not''' to work:
 
* Ubuntu 10 (64-bit)
 
* Ubuntu 10 (64-bit)
 +
* Ubuntu 11.04
  
===Required Software on the Build Host===
+
====Required Software on the Build Host====
 
;perl : All of the "build" utilities (buildtool, buildpackage, buildimage) are written in Perl and require Perl version 5.6 or higher.
 
;perl : All of the "build" utilities (buildtool, buildpackage, buildimage) are written in Perl and require Perl version 5.6 or higher.
:In addition there is a requirement for the [http://search.cpan.org/dist/Config-General/ <tt>Config::General</tt>] package which is not part of most standard Perl installations. On distributions which use the "yum" package manager (Red Hat, Fedora etc.) the required RPM can usually be installed with:<pre>yum install perl-Config-General</pre>
+
:In addition there is a requirement for the [http://search.cpan.org/dist/Config-General/ <tt>Config::General</tt>] Perl module which is not part of most standard Perl installations. On distributions which use the "yum" package manager (Red Hat, Fedora etc.) the required RPM can usually be installed with:<pre>yum install perl-Config-General</pre>
 +
:Furthermore, the <code class="filename">buildimage.pl</code> utility relies on the [http://search.cpan.org/~gbarr/TimeDate-1.20/lib/Date/Format.pm <tt>Date::Format</tt>] Perl module which is part of the <tt>TimeDate</tt> Perl package and can be installed with a command like:<pre>yum install perl-TimeDate</pre>
 +
:On distributions which use the "dpkg" package manager (Debian, Ubuntu etc.) the required packages can usually be installed with:<pre>aptitude install libconfig-general-perl libdatetime-perl</pre>
 
;cvs : [[LEAF]] currently uses CVS for source code version control, so the <tt>cvs</tt> utility is required.
 
;cvs : [[LEAF]] currently uses CVS for source code version control, so the <tt>cvs</tt> utility is required.
 
;git : CVS is now being replaced by Git so the <tt>git</tt> utility is required as well as / instead of <tt>cvs</tt>.
 
;git : CVS is now being replaced by Git so the <tt>git</tt> utility is required as well as / instead of <tt>cvs</tt>.
 
;patch : The <tt>patch</tt> utility is required to apply patches to upstream source distributions.
 
;patch : The <tt>patch</tt> utility is required to apply patches to upstream source distributions.
 
;gcc : There is no longer a requirement to use GCC version 3. GCC version 4 (e.g. 4.5.1.4) works well.
 
;gcc : There is no longer a requirement to use GCC version 3. GCC version 4 (e.g. 4.5.1.4) works well.
 +
: '''Note:''' For Ubuntu 11.11 you'll need to install gcc-multilib
 
;texinfo : Required for the <tt>makeinfo</tt> utility used for some compilation steps, though the resulting <tt>.info</tt> files are not used.
 
;texinfo : Required for the <tt>makeinfo</tt> utility used for some compilation steps, though the resulting <tt>.info</tt> files are not used.
 
;bison : Required to build the (TBC) Package.
 
;bison : Required to build the (TBC) Package.
 
;asciidoc : Required to build the (TBC) Package.
 
;asciidoc : Required to build the (TBC) Package.
 
;fakeroot : Required when building Packages and disk Images, avoiding the need to actually run as the <tt>root</tt> user on the build host.
 
;fakeroot : Required when building Packages and disk Images, avoiding the need to actually run as the <tt>root</tt> user on the build host.
 
 
  
 
In addition, the following RPM or similar packages are also required on the build host but are normally a standard part of the base Linux distribution:
 
In addition, the following RPM or similar packages are also required on the build host but are normally a standard part of the base Linux distribution:
 
* binutils (for command <tt>strip</tt>)
 
* binutils (for command <tt>strip</tt>)
 
* bzip2 (for command <tt>bzcat</tt>)
 
* bzip2 (for command <tt>bzcat</tt>)
 +
* cpio (for generating <tt>initrd.lrp</tt>)
 
* flex
 
* flex
 
* gawk
 
* gawk
Line 59: Line 64:
 
* tar
 
* tar
 
* wget
 
* wget
 +
 +
===SourceForge User Account===
 +
TODO
 +
 +
 +
==Cloning the Git Repository==
 +
In February 2011 the [[LEAF]] project switched from CVS to Git as the Source Code Management (SCM) tool for [[Bering-uClibc 4.x]] development.
 +
 +
The first step in building [[Bering-uClibc 4.x]] from source is therefore to copy or "clone" the Git repository hosted by SourceForge.
 +
Further information on using Git can be found in Appendix [[Bering-uClibc 4.x - Developer Guide - Hints and Tips for using Git SCM|Hints and Tips for using Git SCM]] but the basic steps are as follows:
 +
# Change to the directory where you wish to do your [[Bering-uClibc 4.x]] development.
 +
# Run the following command, replacing ''USERNAME'' with your SourceForge username: <pre>git clone ssh://USERNAME@leaf.git.sourceforge.net/gitroot/leaf/bering-uclibc</pre>Note that this will take some time to run, since it has to download the build toolchain source as well as the source for most of the [[Bering-uClibc 4.x]] Packages.
 +
# Change directory to the <code class="filename">bering-uclibc</code> directory. This is the "buildtool root" directory used as the working directory for subsequent commands.
 +
 +
 +
==Building the Build environment==
 +
With the source code for the build toolchain downloaded this now has to be compiled for your build host.
 +
Run the following command:
 +
./buildtool.pl build buildenv
 +
This will take some considerable time.
 +
Build messages, including any errors, are written to file <code class="filename">log/buildtoollog</code> so you may wish to run the following command in another shell window to keep track of progress:
 +
tail -f log/buildtoollog
  
  

Latest revision as of 20:31, 13 March 2012

Preparing the Build Environment
Prev Bering-uClibc 4.x - Developer Guide Next


Pre-Requisites

Hardware

CPU & RAM

Compiling source code is a CPU- and RAM-intensive operation, so a reasonably powerful machine is advisable. Multiple CPU cores are a benefit, especially for compiling the build environment itself (the target GCC etc.).

x86 and x86_64 CPUs are supported for the build host.

Examples of build performance for "buildtool.pl build buildenv" (following a successful "buildtool.pl source buildenv" on a brand new build environment) are:

50 minutes 
Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz (Dual Core) with 4GB DDR2 RAM, Fedora 14 (64-bit)
200 minutes 
Intel(R) Pentium(R) 4 CPU 2.80GHz (Single Core) with 2GB SDRAM, Fedora 10 (32-bit)

Disk Space

A fully built development environment with all of the Bering-uClibc 4.x Packages and all of the kernel variants occupies more than 7.5 Gigabytes of disk space.

Assume that 8 Gigabytes are required.

Operating System

The Bering-uClibc 4.x kernel and Packages can be built on any modern Linux distribution which has the necessary software development utilities installed. Examples of distributions which are known to work include:

  • Fedora 10 (32-bit)
  • Fedora 14 (64-bit)
  • Fedora 15 (64-bit)

The following are known not to work:

  • Ubuntu 10 (64-bit)
  • Ubuntu 11.04

Required Software on the Build Host

perl 
All of the "build" utilities (buildtool, buildpackage, buildimage) are written in Perl and require Perl version 5.6 or higher.
In addition there is a requirement for the Config::General Perl module which is not part of most standard Perl installations. On distributions which use the "yum" package manager (Red Hat, Fedora etc.) the required RPM can usually be installed with:
yum install perl-Config-General
Furthermore, the buildimage.pl utility relies on the Date::Format Perl module which is part of the TimeDate Perl package and can be installed with a command like:
yum install perl-TimeDate
On distributions which use the "dpkg" package manager (Debian, Ubuntu etc.) the required packages can usually be installed with:
aptitude install libconfig-general-perl libdatetime-perl
cvs 
LEAF currently uses CVS for source code version control, so the cvs utility is required.
git 
CVS is now being replaced by Git so the git utility is required as well as / instead of cvs.
patch 
The patch utility is required to apply patches to upstream source distributions.
gcc 
There is no longer a requirement to use GCC version 3. GCC version 4 (e.g. 4.5.1.4) works well.
Note: For Ubuntu 11.11 you'll need to install gcc-multilib
texinfo 
Required for the makeinfo utility used for some compilation steps, though the resulting .info files are not used.
bison 
Required to build the (TBC) Package.
asciidoc 
Required to build the (TBC) Package.
fakeroot 
Required when building Packages and disk Images, avoiding the need to actually run as the root user on the build host.

In addition, the following RPM or similar packages are also required on the build host but are normally a standard part of the base Linux distribution:

  • binutils (for command strip)
  • bzip2 (for command bzcat)
  • cpio (for generating initrd.lrp)
  • flex
  • gawk
  • gzip (for a gzip-compatible zcat)
  • lzma
  • m4
  • make
  • sed
  • tar
  • wget

SourceForge User Account

TODO


Cloning the Git Repository

In February 2011 the LEAF project switched from CVS to Git as the Source Code Management (SCM) tool for Bering-uClibc 4.x development.

The first step in building Bering-uClibc 4.x from source is therefore to copy or "clone" the Git repository hosted by SourceForge. Further information on using Git can be found in Appendix Hints and Tips for using Git SCM but the basic steps are as follows:

  1. Change to the directory where you wish to do your Bering-uClibc 4.x development.
  2. Run the following command, replacing USERNAME with your SourceForge username:
    git clone ssh://USERNAME@leaf.git.sourceforge.net/gitroot/leaf/bering-uclibc
    Note that this will take some time to run, since it has to download the build toolchain source as well as the source for most of the Bering-uClibc 4.x Packages.
  3. Change directory to the bering-uclibc directory. This is the "buildtool root" directory used as the working directory for subsequent commands.


Building the Build environment

With the source code for the build toolchain downloaded this now has to be compiled for your build host. Run the following command:

./buildtool.pl build buildenv

This will take some considerable time. Build messages, including any errors, are written to file log/buildtoollog so you may wish to run the following command in another shell window to keep track of progress:

tail -f log/buildtoollog



Prev Up Next