Differences in Revisions: IPFire 2.x - Build Howto

Older Revision
August 15 at 4:50 pm
»
format, removed old os version remarks
# IPFire 2.x - Build Howto
 
## 1. Foreword
This how-to covers building IPFire from source code, creating a development environment that can be used to create new packages and make changes.
 
When building a development environment, you should be aware that:
 
* This will require some patience and may take some time.
* This will require some patience and may take some time
* Ideally you should have a powerful PC, with an above-average amount of RAM (although this procedure will work on any modern PC).
* Ideally you should have a powerful PC, with a lot of RAM (although this procedure will work on any modern PC)
* You will need to dedicate a significant chunk of disk space.
* You will need to dedicate a significant chunk of disk space
 
## Prerequisites
## 2. Prerequisites
 
You require a system with a common Linux distribution. Fedora, Ubuntu, or even IPFire itself will work.
You require a system with a common Linux distribution: Fedora, Ubuntu, or even IPFire itself will work.
 
You may have to change some minor things on your system and install several packages. There are some tips for common distributions. It also makes sense to install the package ccache to speed up compilation. If you made minor changes only that code will be compiled, the rest will be taken from the ccache. If your own distro is missing, feel free to add it here.
You may have to change some minor things on your system and install several packages. There are some tips for common distributions. If your own distro is missing, feel free to add it here.
 
## Step 1: Grabbing the source
 
First of all, you have to check out the [source code](../sources). Read [our git howto](/devel/git/setup) for instructions.
 
Next, grab the source code tarballs of every upstream package (~500MB):
 
```
./make.sh downloadsrc
```
 
### Precompiled toolchain
 
In order to speed up compilation, you can download the first stage of the toolchain. This is recommended to do.
 
```
./make.sh gettoolchain
```
 
## Step 2: Building
 
The build process automatically uses all available CPUs on the system to speed up the build as much as possible.
 
Start the build with:
 
```
./make.sh build
```
 
Easy, isn't it? But this process will now take several hours...
 
## Hints
 
### IPFire
 
Known to work: IPFire 2.x
 
These packages will be required: `pakfire install -y git make`
 
These packages will be required:
```
pakfire install -y git make
```
IPFire can't build the toolchain, so you will have to use the precompiled version.
After git checkout and source download you also need to download the toolchain.
 
### Fedora (Core) & CentOS
 
Known to work: **Fedora Core 5, Fedora Core 6, Fedora 7-17 und Centos 5.1**
 
These packages will be required, too:
These packages will be required:
 
```
yum install git gcc byacc make wget binutils bison patch texinfo gcc-c++ glibc-static which autoconf automake
```
 
### OpenSuSE
 
These packages will be required and can be installed via yast:
```
git, gcc, make, patch, bzip2, bison
```
Known to work: **SuSE Linux 9.3, OpenSuSE 10.3**
 
These packages will be required, too: git, gcc, make, patch, bzip2, bison
 
Install these packages with "yast".
 
### Debian
 
These packages will be required:
Known to work: **Debian 4.0R1, Debian 5.0, Debian 7.0, Debian 8.0**
 
These packages will be required, too: git-core, gcc, g++, realpath, make, patch, bzip2, byacc, python-urlgrabber, bison, gawk, texinfo, autoconf, automake
 
Install these packages with:
```
apt-get install git-core gcc g++ realpath make patch bzip2 byacc python-urlgrabber bison gawk texinfo autoconf automake
```
 
or with:
```
aptitude install git-core gcc g++ realpath make patch bzip2 byacc python-urlgrabber bison gawk texinfo autoconf automake
```
 
### Ubuntu
 
There is a Symlink "/bin/sh" that points to "/bin/dash". This will cause an error if you compile glibc. Please change "/bin/sh" to "/bin/bash".
 
Ubuntu 11.04 needs some additional symlinks to asm header and glibc:
 
```
ln -s /usr/include/asm-generic /usr/include/asm
ln -s /usr/lib/i386-linux-gnu/libc.so /usr/lib/libc.so
```
 
Known to work: **Ubuntu 6.06 LTS - Ubuntu 11.04**
These packages will be required:
 
These packages will be required, too: git-core, g++, realpath, patch, byacc, make, python-urlgrabber, autoconf, automake. Install them with apt-get or aptitude.
Install these packages with:
```
apt-get install git-core g++ realpath patch byacc make python-urlgrabber autoconf automake
```
 
It also makes sense to install the package ccache to speed up compilation. If you made minor changes only that code will be compiled, the rest will be taken from the ccache.
or with:
```
aptitude install git-core g++ realpath patch byacc make python-urlgrabber autoconf automake
```
 
### Arch Linux
 
Kown to work: simple i686 core installation
 
These packages will be required too:
These packages will be required:
 
```
pacman -S git gcc make patch urlgrabber bison gawk texinfo
```
 
First buildtime in VirtualBox*(2 cores (2x2.1Ghz), 1GB Ram)* ~12 hours, second buildtime just ~40 minutes.
## 3. Howto build IPFire
 
## Benchmarks
This process may take several hours...
 
The test machine was an Athlon XP 2000+ with 1.75 GB of RAM. Note that between the first and second build there only has been a "./make.sh clean" just to test ccache.
### Step 1: Grabbing the source
 
First of all, you have to check out the [source code](../sources). Read [our git howto](/devel/git/setup) for instructions.
 
Next, grab the source code tarballs of every upstream package:
 
```
./make.sh downloadsrc
```
 
### Step 2: Precompiled toolchain
 
In order to speed up compilation, you can download the first stage of the toolchain. This is recommended to do.
 
```
./make.sh gettoolchain
```
 
### Step 3: Building
 
The build process automatically uses all available CPUs on the system to speed up the build as much as possible.
 
Start the build with:
 
```
./make.sh build
```
Now just wait until it's finished. That's all.
 
## 4. Benchmarks
 
In 2007 the test machine was an Athlon XP 2000+ with 1.75 GB of RAM. Note that between the first and second build there only has been a `./make.sh clean` just to test ccache.
 
|System |1.Build |2.Build |
|System|1.Build|2.Build|
| --- | --- | --- |
|Fedora 8 | 40091s| 26240s|
|Fedora 8|40091s|26240s|
|CentOS 5.1 | 35261s| 25123s|
|CentOS 5.1|35261s|25123s|
|SuSE 10.3 | 34274s| 16258s|
|SuSE 10.3|34274s|16258s|
|Debian 4.0R1 | 32909s| 15274s|
|Debian 4.0 R1|32909s|15274s|
|Ubuntu 7.10 | 33836s| 15855s|
|Ubuntu 7.10|33836s|15855s|
 
Nowadays, in 2014, build time has dropped to about 3 hours and 45 minutes, which is more than twice as fast as a little over a decade ago when the benchmarks you can see above where done on an AMD Athlon XP 2000+.
In 2014 with a laptop (Intel Core i7 3612QM, 8GB of RAM, Linux Mint 16 x64 KDE), the build time has dropped to about 3 hours and 45 minutes.
 
The new build time is from a laptop with an Intel Core i7 3612QM, 8GB of RAM and Linux Mint 16 x64 KDE.
In 2020 with a desktop PC (Intel Core i5 6400, 32GB of RAM, Kali 2019.4 XFCE), the first build time has been about 8 hours and 15 minutes.