Compile Manually
Version 4 (Gioacchino Mazzurco, 06/12/2014 01:40 pm) → Version 5/15 (Ilario Gelmetti, 07/29/2014 04:57 pm)
h1. Compile Manually
h2. Starting from a new compilation of OpenWrt
*Resources needed:*
Probably a Linux based operating system.
Some tools for the compilation process, on Debian:
<pre>
apt-get install git build-essential libncurses5-dev zlib1g-dev gawk subversion
</pre>
About 9 GB of disk space.
About 3 hours of compilation time.
*Download trunk version of OpenWrt* (Attitude Adjustment isn't supported by Libre-Mesh).
<pre>
git clone git://git.openwrt.org/openwrt.git
</pre>
*Add our repositories* to the default ones.
<pre>
cd openwrt
cp feeds.conf.default feeds.conf
echo "src-git libremap git://github.com/libremap/libremap-agent-openwrt.git" >> feeds.conf
echo "src-git lime https://github.com/libre-mesh/lime-packages.git" >> feeds.conf
</pre>
If you want to use a specific branch of lime-packages specify it adding ;nameofthebranch at the end of the last line. For example:
<pre>
src-git lime https://github.com/libre-mesh/lime-packages.git;develop
</pre>
Download all these packages and put sources in the right place.
<pre>
scripts/feeds update -a
scripts/feeds install -a
</pre>
Then enter the OpenWrt *configuration* menu.
<pre>
make menuconfig
</pre>
Go in "Base system" and *deselect "dnsmasq"* (this is the IPv4 version which conflicts with Libre-Mesh, the IPv6 version will be automatically selected).
Exit from "Base system" end *enter in "LiMe", select what you want* (for example everything or everything except reghack and lime-full), exit.
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.
Launch the *compilation*.
<pre>
make
</pre>
You can try to speed up the process launching the compilation on more than one CPU core.
<pre>
make -j 4
</pre>
But if you encounter some errors (maybe related to network connectivity problems) it's better to clean up with
<pre>
make clean
</pre>
and start over with only a core.
Flash on your devices and enjoy!
h2. Updating a previous compilation of Libre-Mesh
Enter the base directory of the previous compiled image, for example
<pre>
cd ~/openwrt
</pre>
Remove the unnecessary previously compiled files.
<pre>
make clean
</pre>
Update the OpenWrt source code.
<pre>
git pull
</pre>
Update the Libre-Mesh package source code.
<pre>
scripts/feeds update -a
scripts/feeds install -a
</pre>
Compile the image
<pre>
make
</pre>
or for using more than one CPU core.
<pre>
make -j 4
</pre>
If you encounter some errors try cleaning completely the installation environment
<pre>
make clean
make dirclean
rm -rf feeds/*
</pre>
and restart from the top of this section about updating.
h2. Starting from a new compilation of OpenWrt
*Resources needed:*
Probably a Linux based operating system.
Some tools for the compilation process, on Debian:
<pre>
apt-get install git build-essential libncurses5-dev zlib1g-dev gawk subversion
</pre>
About 9 GB of disk space.
About 3 hours of compilation time.
*Download trunk version of OpenWrt* (Attitude Adjustment isn't supported by Libre-Mesh).
<pre>
git clone git://git.openwrt.org/openwrt.git
</pre>
*Add our repositories* to the default ones.
<pre>
cd openwrt
cp feeds.conf.default feeds.conf
echo "src-git libremap git://github.com/libremap/libremap-agent-openwrt.git" >> feeds.conf
echo "src-git lime https://github.com/libre-mesh/lime-packages.git" >> feeds.conf
</pre>
If you want to use a specific branch of lime-packages specify it adding ;nameofthebranch at the end of the last line. For example:
<pre>
src-git lime https://github.com/libre-mesh/lime-packages.git;develop
</pre>
Download all these packages and put sources in the right place.
<pre>
scripts/feeds update -a
scripts/feeds install -a
</pre>
Then enter the OpenWrt *configuration* menu.
<pre>
make menuconfig
</pre>
Go in "Base system" and *deselect "dnsmasq"* (this is the IPv4 version which conflicts with Libre-Mesh, the IPv6 version will be automatically selected).
Exit from "Base system" end *enter in "LiMe", select what you want* (for example everything or everything except reghack and lime-full), exit.
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.
Launch the *compilation*.
<pre>
make
</pre>
You can try to speed up the process launching the compilation on more than one CPU core.
<pre>
make -j 4
</pre>
But if you encounter some errors (maybe related to network connectivity problems) it's better to clean up with
<pre>
make clean
</pre>
and start over with only a core.
Flash on your devices and enjoy!
h2. Updating a previous compilation of Libre-Mesh
Enter the base directory of the previous compiled image, for example
<pre>
cd ~/openwrt
</pre>
Remove the unnecessary previously compiled files.
<pre>
make clean
</pre>
Update the OpenWrt source code.
<pre>
git pull
</pre>
Update the Libre-Mesh package source code.
<pre>
scripts/feeds update -a
scripts/feeds install -a
</pre>
Compile the image
<pre>
make
</pre>
or for using more than one CPU core.
<pre>
make -j 4
</pre>
If you encounter some errors try cleaning completely the installation environment
<pre>
make clean
make dirclean
rm -rf feeds/*
</pre>
and restart from the top of this section about updating.