Building Cerowrt on your own machine

Version 17 (Dave Täht, 04/30/2012 09:15 am)

1 1
h1. Building Cerowrt on your own Linux machine
2 1
3 9 Petri Rosenström
These instructions *should* work with the 11.10 Ubuntu.
4 1
5 9 Petri Rosenström
h2. Prerequisites
6 10 Petri Rosenström
7 15 Dave Täht
You need some packages that you may download the sources. Then you need some build dependencies to be satisfied. Then you need to checkout the sources. 
8 1
9 9 Petri Rosenström
<pre>
10 16 Dave Täht
sudo apt-get install git-all subversion build-essential flex libncurses5-dev libz-dev gawk gettext bison texinfo
11 17 Dave Täht
mkdir -p ~/src/prep
12 17 Dave Täht
cd ~/src/prep
13 12 Dave Täht
git clone git://github.com/dtaht/cerofiles-3.3.git
14 9 Petri Rosenström
</pre>
15 1
16 9 Petri Rosenström
There will be a *build_cero.sh* script in that checkout. There is also a *cero_config* file here. Copy *cero_config* to *~/.cero* and then edit it to suit your preferences.
17 9 Petri Rosenström
18 9 Petri Rosenström
<pre>
19 12 Dave Täht
cp cerofiles-3.3/cero_config ~/.cero
20 9 Petri Rosenström
vim ~/.cero # use the editor you are comfortable with
21 9 Petri Rosenström
</pre>
22 9 Petri Rosenström
23 9 Petri Rosenström
This example assumes the use of folder *~/src/cerowrt* as main directory so you should change the *CERO_DIR* variable to 
24 9 Petri Rosenström
<pre>
25 9 Petri Rosenström
CERO_DIR=~/src/cerowrt
26 9 Petri Rosenström
</pre>
27 9 Petri Rosenström
28 9 Petri Rosenström
29 1
then run
30 9 Petri Rosenström
<pre>
31 12 Dave Täht
~/src/cerowrt/cerofiles-3.3/build_cero.sh init
32 1
cd ~/src/cerowrt
33 1
make # But please see note below for an extra step while kernel.org is down
34 1
</pre>
35 1
36 12 Dave Täht
The first time you run this it will take a VERY long time to build the toolchains, etc. I have generally found -jX to fail on large numbers of processors, so just build it in series and go to a long dinner or lunch. Or...
37 12 Dave Täht
38 12 Dave Täht
<pre>
39 12 Dave Täht
make -jX
40 12 Dave Täht
make V=s
41 12 Dave Täht
</pre>
42 12 Dave Täht
43 4 Dave Täht
Subsequent runs will be much faster, and -jX usually works AND:
44 5 Dave Täht
45 4 Dave Täht
**NOTE** With kernel.org down it is impossible to get a build to summon and compile all the needed packages. There is a temporary mirror of the needed packages available via rsync. Inside the build dir above:
46 4 Dave Täht
47 9 Petri Rosenström
<pre> 
48 9 Petri Rosenström
mkdir dl; cd dl; rsync -av huchra.bufferbloat.net::dl .
49 9 Petri Rosenström
</pre>
50 5 Dave Täht
51 5 Dave Täht
(this is a temporary expedient)
52 1
53 13 Dave Täht
h2. Check your build
54 13 Dave Täht
55 13 Dave Täht
If the wndr3700's bin/ar71xx/ has images that are less than 5MB, you didn't get a good .config file, and/or some major packages are missing, and/or 
56 13 Dave Täht
57 13 Dave Täht
Your final images should be about the same size as on huchra.
58 13 Dave Täht
59 10 Petri Rosenström
h2. Lastly:
60 1
61 2 Dave Täht
Given that this builds most of cerowrt against the main git head trees, your build will differ somewhat from what we are making available as "release candidates":http://huchra.bufferbloat.net/~cero1/ at present. After we get stable, we will tag and freeze the relevant trees.
62 2 Dave Täht
63 2 Dave Täht
We note that due to this difference, there may be slight (or even major) differences in the default .config file. It helps to repeatedly cp env/.config onto .config and run make defconfig, and install packages, etc, until they more closely match.
64 2 Dave Täht
65 3 Dave Täht
We will improve this script as time goes on, and if you run into trouble, please contact the #bufferbloat irc channel and/or the mailing lists. 
66 3 Dave Täht
67 1
[[changing your cerowrt ip addresses]] [[changing your dns domain]]