Turris Omnia: Setting up a buildsystem

Whenever you want to use a program which has not been added to the repositories of Turris Omnia, you need to first compile the program by your own. For embedded devices this compilation is normally performed on a build system where you have much better resources available than on the embedded device. In this blog I will show on the example of the VPN Tool Softether how to setup a build system for Turris Omnia and how to compile the package.

Setup of the Turris Omnia buildsystem

To be able to setup the buildsystem we need as a basis a linux system running on any architecture which is able to do a cross compile for the ARM architecture used in Turris Omnia.

I will use a virtualised Ubuntu Linux distribution to isolate the configuration. In this way the build host can be started when needed and will not affect my daily work on my linux systems.

I will start by installing a Ubuntu Server 16.04.1 LTS Image which can be found here: https://www.ubuntu.com/download/server

As a Virtualisation Engine I use VMware Fusion on a Mac- but any virtualisation engine will be o.k.

Start Fusion and select: VMware Fusion -> Add -> Install from Disk or Image

vmware-fusion-create-a-new-virtual-machine

You can use the Linux Easy Install Option:

Choose an appropriate user and a strong password.

vmware-fusion-linux-easy-install

After hitting Continue you will see the final summary page:

vmware-fusion-finish

After the system has been installed and booted the first time, you can log in as the user you have defined and start customizing the environment to support the buildsystem.

Because I normally want to use a linux system without GUI, I first install the openssh-server:

sudo apt-get install openssh-server

Now get the latest packages

sudo apt-get updade

sudo apt-get upgrade

Now we have to install the packages needed for the buildsystem

sudo apt-get install git-core build-essential libssl-dev libncurses5-dev unzip gawk gettext subversion mercurial libreadline6 libreadline6-dev

Download the “Fork of OpenWrt used in router Turris“ with git

git clone https://github.com/CZ-NIC/turris-os

Cloning into ‘turris-os’…

remote: Counting objects: 332218, done.

remote: Compressing objects: 100% (97/97), done.

remote: Total 332218 (delta 46), reused 0 (delta 0), pack-reused 332117

Receiving objects: 100% (332218/332218), 119.50 MiB | 5.95 MiB/s, done.

Resolving deltas: 100% (227656/227656), done.

Checking connectivity… done.

I had to manually compile flock to prevent some errors during the rest of the procedure:

cd turris-os

~/turris-os$ make tools/flock/clean

 make[1] tools/flock/clean

 make[2] -C tools/flock clean

~/turris-os$ make tools/flock/install

Now we can start with the compilation

~/turris-os$ make menuconfig

You have to select “Marvell Armada 37x/38x/XP” as Target System:

Target System (Marvell Armada 37x/38x/XP)  --->

┌──────────────────────── Target System ────────────────────────  Use the arrow keys to navigate this window or press the      │

  hotkey of the item you wish to select followed by the <SPACE │

  BAR>. Press <?> for additional information about this        │

 ┌────────────────^(-)─────────────────────────────────────── │            ( ) Infineon/ADMtek ADM5120                     │            ( ) Ingenic XBurst                              │            ( ) Intel IXP4xx                                │            ( ) Lantiq                                      │            ( ) MIPS Malta CoreLV board (qemu)              │            (X) Marvell Armada 37x/38x/XP                                      <Select>      < Help >                     │

───────────────────────────────────────────────────────────────┘

As Target Profile “Turris Omnia” has to be selected

Target Profile (Turris Omnia)

┌─────────────────────── Target Profile ────────────────────────  Use the arrow keys to navigate this window or press the      │

  hotkey of the item you wish to select followed by the <SPACE │

  BAR>. Press <?> for additional information about this        │

 ┌──────────^(-)───────────────────────────────────────────── │      ( ) Marvell Armada 385 RD (RD-88F6820-AP)             │      ( ) Marvell Armada 385 DB AP (DB-88F6820-AP)          │      ( ) Marvell Armada XP DB (DB-78460-BP)                │      ( ) Marvell Armada XP GP (DB-MV784MP-GP)              │      ( ) Plat'Home OpenBlocks AX3                          │      (X) Turris Omnia                                                         <Select>      < Help >                     │

───────────────────────────────────────────────────────────────┘

 

 

Add Softether for OpenWRT repository to OpenWRT Buildroot feeds file

echo “src-git softethervpn https://github.com/el1n/OpenWRT-package-softether.git” >> feeds.conf.default

Update feeds and Install SoftEther VPN.

./scripts/feeds update -a

./scripts/feeds install -a

./scripts/feeds install softethervpn

SDK settings

make defconfig

make menuconfig

Select

[*] Package the OpenWrt-based Toolchain

Now we have to prepare the build system

~/turris-os$ make prepare -j4 -j1 V=s

The compilation terminated in my environment. I had to

~/turris-os$ cd ~/turris-os/staging_dir/toolchain-arm_cortex-a9+vfpv3_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/bin/ 

$ ln -s ~/turris-os/staging_dir/host/bin/flock .

The second run finished successfully

~/turris-os$ make prepare -j4 -j1 V=s

 

Compiling the “SoftEther VPN” package

Now our buildsystem is ready for being used for own packages.

Change “Target System” for your OpenWrt.
Visit “Network/VPN/SoftEther VPN”, Check what you need.

 

Now create the package

make package/softethervpn/compile V=99

The package is then available at:

./bin/mvebu/packages/softethervpn/softethervpn_4.19-9605_mvebu.ipk

You can download this package using the password “turris”

https://ocloud.global/index.php/s/SsvxiwdCBcQLowA

References:

https://forum.turris.cz/t/cant-build-turris-os/1420/4

https://github.com/el1n/OpenWRT-package-softether

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.