Building Cerowrt on your own machine

Version 23 (Dave Täht, 04/30/2012 12:52 pm)

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 19 Dave Täht
mkdir -p ~/src/prep ~/src/cerowrt
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 1
then run
29 9 Petri Rosenström
<pre>
30 20 Dave Täht
~/src/prep/cerofiles-3.3/build_cero.sh init
31 20 Dave Täht
cd ~/src/
32 20 Dave Täht
# in there will be your checked out dir, usually wndr3700v2, cd into that
33 18 Dave Täht
make # But please see note below for an extra step to save on download hassles
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 1
43 23 Dave Täht
Subsequent runs will be much faster, and -jX usually works. When it doesn't... 
44 23 Dave Täht
<pre>
45 23 Dave Täht
make package/the_breaking_package/{clean,compile,install} V=99 
46 23 Dave Täht
</pre>
47 23 Dave Täht
usually will work or show the problem.
48 5 Dave Täht
49 21 Dave Täht
**NOTE** With kernel.org down last year it was 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. It's still faster to just snag all the tarballs this way, so... inside the build dir above:
50 4 Dave Täht
51 9 Petri Rosenström
<pre> 
52 9 Petri Rosenström
mkdir dl; cd dl; rsync -av huchra.bufferbloat.net::dl .
53 22 Dave Täht
</pre>
54 1
(this is a temporary expedient and not actually necessary in normal use)
55 1
56 13 Dave Täht
h2. Check your build
57 13 Dave Täht
58 23 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 the phase of the moon was wrong. 
59 13 Dave Täht
60 13 Dave Täht
Your final images should be about the same size as on huchra.
61 13 Dave Täht
62 23 Dave Täht
h2. Notes:
63 1
64 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.
65 1
66 1
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.
67 1
68 1
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. 
69 23 Dave Täht
70 23 Dave Täht
h2. Keeping updated
71 23 Dave Täht
72 23 Dave Täht
The procedure above makes it possible to track all or parts of openwrt and cerowrt, by keeping multiple repositories around.
73 23 Dave Täht
You can,for example, merely track ceropackages, by doing a git pull in the ceropackages directory and a ./scripts/feeds update in your build directory. Or setup something to track the mainline repos (this is what I do), do integration, and builds, and not bother the ongoing work in your release process. Doing continuous integration is difficult, but necessary if you wish to advance the state of the art.
74 23 Dave Täht
75 3 Dave Täht
76 1
[[changing your cerowrt ip addresses]] [[changing your dns domain]]