IPCOP

building the current and stable IPCop v1.4.x

The first IPCop versions were mostly buildable only from an RH7.x distribution.
Since the v1.4.a3 development version, IPCop can be built from every other Linux distribution due to the adoption of a Linux From Scratch (LFS) based build.


Load IPCop sources.
The sources for IPCop can be retrieved :
  • from the sources tgz delivered with each version;
  • from direct cvs access (settings explanation for anonymous or developper access), details for available branches in IPCop tree in [1]. Do not try to retrieve sources from cvs main branch. Thoses sources are deprecated as developement for the new version is made on svn. You need to use '-r IPCOP_v1_4_0' to receive v1.4 branch sources or '-r IPCOP_v1_4_<version>_FINAL' for a particular <version>.

For example: ipcop-dev-v140-20040507.tgz (the build for version 1.4.0 dated 07-May-2004) the file is over 1.0 Mb.
Extract it using:
tar xvfz ipcop-dev-v140-20040507.tgz


Open a terminal and type:
su - root
followed by your password.

Change into the ipcop directory:
cd ipcop


Issuing the command ls should list some directories and files like doc, config, src, etc.
Change the permissions of make.sh to make it executable:
chmod 755 make.sh

You are now able to use IPCop make.sh script to do some tasks for you.


Load other sources
IPCop needs many other source packages to build. Those sources will be loaded from the Internet and placed in a cache directory (loading only occurs once).

./make.sh build

will compile and could load each sources package when a package is required to compile. Building can stop if a web site is temporary unavailable.
Because of this, it is more convenient to download all files at one time with:
./make.sh prefetch


This will download all the needed files from the Internet before starting compilation. Should some files not be available or have moved to a different URL, 'make.sh' will report it to you. For these you might try a Google search and download them manually into the cache directory.
A good place to look for missing files is http://ipcop.ath.cx.

Since v1.4.11, a packages cd is supplied with all source packages used included in an iso. You could mount the iso in a loop or write a CD and copy files to the cache.

Starting from 1.4.12, all files can be loaded from Sourceforge gathered in one big (255 Mb) package, uncompressed and moved to the cache with:
./make.sh getothersrc


Required binaries
make.sh executes some commands that need to be available on the building machine to be able to compile. This is generally done installing a development environment.
Read some specific instructions for Debian [2] Knoppix [3] Cooperative Linux [4] or Ubuntu [5].
If your distribution is not actually able to build the first part of the build (the toolchain) because your distribution is either old or very new [4], you can retrieve a precompiled one with:
./make.sh gettoolchain


For v1.4 IPCop version, the toolchain package to be loaded depends on your building cpu. Type:
uname -m
to see the cpu configured on your machine. The appropriate package is automatically selected.

Toolchain packages are actually available for i586 and i686.

Common other make.sh commands
Type:
./make.sh
to see some explanation of the available commands.

To start the actual build process, use the following command (building takes quite some time, depending on the speed of your build system):
./make.sh build


To restart a new clean build after some changes, type:
./make.sh clean
./make.sh build


It is possible to hack and rebuild quicker one part of the process. If, for instance, you know that one cgi script for the web interface has been changed, delete the apache log file, and run the build process again:
rm log/apache_1.3.*
./make.sh build


For minor changes, other good candidates for deletion are: log/configroot log/misc-progs log/initscripts log/installer

Look inside each log file before recompilation to find out which files will be rebuilt. This method can save a huge amount of time, allowing you to rebuild very quickly but does not actually support dependencies check.

Building duration
The ccache compiler cache has been included in the build process, so subsequent builds are faster than the first one.

Compilation speed result from cpu power and disk I/O speed.
Installed memory amount available may greatly influence the result.

With a XP1700+ / 512MB installed and an ATA100 disk, initial compilation spend 4h 30 and next recompilations 3h 30 due to ccache usage.
On the same machine, with only 128MB installed, a recompilation need more than 10 h 30, so it is 3 times slower than with 512 MB installed.
Using the toolchain packaged could save another 20% on the building time. Load the precompiled toolchain from Sourceforge with ./make.sh gettoolchain or build your own with:
./make.sh clean
./make.sh toolchain


Error building v1.4
You may have this error
Inconsistency detected by ld.so: rtld.c: 1221: dl_main:
Assertion `pt_load_num || (void *) ph->p_vaddr ==
_rtld_local._dl_sysinfo_dso' failed!


This is related to the kernel you are running that require a feature not available in the glibc version compiled for IPCop. You could workaround with two different ways:
- recompile your kernel using COMPAT_VDSO=y (in Processor type and features, Compat VDSO support)
- pass an option to the kernel on boot (add vdso=0 to the grub or lilo kernel line)
- disable compat vdso directly with echo 0 > /proc/sys/vm/vdso_enabled

Compile additional code
Details on how to compile additional code.

Notes
[1] Using CVS Instructions for retrieving the source from CVS can be found on the Sourceforge Page.

However, you should be aware that different versions of IPCop can be downloaded from CVS, depending on the TAG used to checkout the working copy. Make sure you end up with the version you want.

To checkout the branch used for the latest version of 1.4.x (including modifications since the previous release), use this command:
cvs -z3 -d:pserver:anonymous@ipcop.cvs.sourceforge.net:/cvsroot/ipcop co -r IPCOP_v1_4_0 ipcop


Each version on the 1.4 branch is tagged and can be retrieved separately. Use this command (for v1.4.10):
cvs -z3 -d:pserver:anonymous@ipcop.cvs.sourceforge.net:/cvsroot/ipcop co -r IPCOP_v1_4_10_FINAL ipcop


You should not try to get the HEAD of the development branch (which will become v2.0) because next version development has moved to svn
Don't do that even it is the general advice displayed on sourceforge page:
cvs -z3 -d:pserver:anonymous@ipcop.cvs.sourceforge.net:/cvsroot/ipcop co ipcop


To update your working copy with recent changes to CVS, use this command:
cvs -z3 -d:pserver:anonymous@ipcop.cvs.sourceforge.net:/cvsroot/ipcop update -P -d


To list differences between your working copy and the CVS repository, use this command:
cd ipcop (or whatever directory you rename the tree received)
cvs diff -u (-u is not mandatory but output is more readable)


[2] Building v1.4 on Debian
Various packages are needed to be able to build IPCop, install them with
4.0 (Etch) From 1.4.11 to 1.4.18 versions, toolchain will not build, use instead the pre-build toolchain or move the 'export PATH...' declaration in toolchain before 'lfsmake1 ccache'
apt-get install build-essential realpath bzip2 cvs


3.1 (Sarge)
apt-get install bzip2 realpath cvs


3.0 (Woody)
Since the switch to lfs (v1.4a3), the special scripts like these for building v1.3 are no longer necessary.
Starting from a minimal install, select C/C++ development in tasksel to have the compiler stuff for the lfs build phase.With dselect add the packages:
wget, bzip2 and realpath
Use a kernel more recent than 2.4.18 or you will encounter build errors in Apache libcrypto.

[3] Building v1.4 on Knoppix (Debian-based)
(this should be partially obsolete, gcc-2.95 is no more used on v1.4 build)
(Thanks to Hans-Joachim Fabry) Please note, that you have to install Knoppix to your HD, because you have to install some files.
apt-get install realpath atm-dev libpcap-dev libgmp3-dev libgd-dev libnewt-dev
apt-get install gcc-2.95 cpp-2.95 libstdc++2.10-dev libg++2.8.1.3-dev

The gcc Version on Knoppix is gcc-3.3 so you have to symlink /usr/bin/gcc to /usr/bin/gcc-2.95 and /usr/bin/cpp to /usr/bin/cpp-2.95.
Knoppix is Debian-based, so in case of trouble refer to the Debian-part of this document (e.g. traffic-graphs).

[4] Building v1.4 on Windows using Cooperative Linux
Morten Christensen has written a Howto about how you can build IPCop on a Windows workstation with W2K or XP (using Cooperative Linux).
His Howto is available as a pdf, rtf and ooo-sxw from http://home.tiscali.dk/m-c/ipcop/index.htm