Compile Manually

Version 2 (Ilario Gelmetti, 06/05/2014 12:28 pm)

1 1 Gioacchino Mazzurco
h1. Compile Manually
2 2 Ilario Gelmetti
3 2 Ilario Gelmetti
h2. Using lime-build
4 2 Ilario Gelmetti
5 2 Ilario Gelmetti
h3. First build
6 2 Ilario Gelmetti
7 2 Ilario Gelmetti
Libre-Mesh firmware is organized as a feed of packages for OpenWRT. To build the current firmware you could use our SDK lime-build.
8 2 Ilario Gelmetti
9 2 Ilario Gelmetti
See instructions in "this":http://libre-mesh.org/projects/libre-mesh page.
10 2 Ilario Gelmetti
11 2 Ilario Gelmetti
h3. Update a previous build
12 2 Ilario Gelmetti
13 2 Ilario Gelmetti
@make update_all@
14 2 Ilario Gelmetti
15 2 Ilario Gelmetti
h2. Starting from OpenWrt
16 2 Ilario Gelmetti
17 2 Ilario Gelmetti
*Resources needed:*
18 2 Ilario Gelmetti
19 2 Ilario Gelmetti
Probably a Linux based operating system.
20 2 Ilario Gelmetti
21 2 Ilario Gelmetti
Some tools for the compilation process, on Debian:
22 2 Ilario Gelmetti
23 2 Ilario Gelmetti
@apt-get install git build-essential libncurses5-dev zlib1g-dev gawk svn@
24 2 Ilario Gelmetti
25 2 Ilario Gelmetti
About 9 GB of disk space.
26 2 Ilario Gelmetti
27 2 Ilario Gelmetti
About 3 hours of compilation time.
28 2 Ilario Gelmetti
29 2 Ilario Gelmetti
*Download trunk version of OpenWrt* (Attitude Adjustment isn't supported by Libre-Mesh).
30 2 Ilario Gelmetti
31 2 Ilario Gelmetti
@git clone git://git.openwrt.org/openwrt.git@
32 2 Ilario Gelmetti
33 2 Ilario Gelmetti
*Add our repositories* to the default ones.
34 2 Ilario Gelmetti
35 2 Ilario Gelmetti
@cd openwrt
36 2 Ilario Gelmetti
cp feeds.conf.default feeds.conf
37 2 Ilario Gelmetti
echo "src-git libremap git://github.com/libremap/libremap-agent-openwrt.git" >> feeds.conf
38 2 Ilario Gelmetti
echo "src-git lime https://github.com/libre-mesh/lime-packages.git" >> feeds.conf@
39 2 Ilario Gelmetti
40 2 Ilario Gelmetti
If you want to use a specific branch of lime-packages specify it adding ;nameofthebranch at the end of the last line. For example:
41 2 Ilario Gelmetti
42 2 Ilario Gelmetti
@src-git lime https://github.com/libre-mesh/lime-packages.git;develop@
43 2 Ilario Gelmetti
44 2 Ilario Gelmetti
Download all these packages and put sources in the right place.
45 2 Ilario Gelmetti
46 2 Ilario Gelmetti
@scripts/feeds update -a
47 2 Ilario Gelmetti
scripts/feeds install -a@
48 2 Ilario Gelmetti
49 2 Ilario Gelmetti
Then enter the OpenWrt *configuration* menu.
50 2 Ilario Gelmetti
51 2 Ilario Gelmetti
@make menuconfig@
52 2 Ilario Gelmetti
53 2 Ilario Gelmetti
Go in "Base system" and *deselect "dnsmasq"* (this is the IPv4 version which conflicts with Libre-Mesh, the IPv6 version will be automatically selected).
54 2 Ilario Gelmetti
55 2 Ilario Gelmetti
Exit from "Base system" end *enter in "LiMe", select what you want* (for example everything or everything except reghack and lime-full), exit.
56 2 Ilario Gelmetti
57 2 Ilario Gelmetti
If you need to compile images only for one type of devices you could specify the type in the menu "Target system" and "Target profile", otherwise keep the default and images for each profile will be produced. Exit and save.
58 2 Ilario Gelmetti
59 2 Ilario Gelmetti
Launch the *compilation*.
60 2 Ilario Gelmetti
61 2 Ilario Gelmetti
@make@
62 2 Ilario Gelmetti
63 2 Ilario Gelmetti
You can try to speed up the process launching the compilation on more than one CPU core.
64 2 Ilario Gelmetti
65 2 Ilario Gelmetti
@make -j 4@
66 2 Ilario Gelmetti
67 2 Ilario Gelmetti
But if you encounter some errors (maybe related to network connectivity problems) it's better to clean up with
68 2 Ilario Gelmetti
69 2 Ilario Gelmetti
@make clean@
70 2 Ilario Gelmetti
71 2 Ilario Gelmetti
and start over with only a core.
72 2 Ilario Gelmetti
73 2 Ilario Gelmetti
Flash on your devices and enjoy!