Loading...
 

Build From Source - OpenWrt

In this page we will go over building OpenWrt for ESPRESSObin on your Linux machine. Before proceeding, make sure to install all prerequisites mentioned in Build system requirements page.

OpenWrt is an open source firmware designed for embedded devices that is highly extensible and enables both users and customers to install a powerful, highly customizable variant of Linux on their routers.

Kernel


First we will need to download Marvell's LSP kernel version 17.02 with OpenWrt's patches on top of it. Download the kernel sources to your Linux machine; the location for the kernel we will use is /opt/kernel/openwrt-kernel:

user@laptop:~$ mkdir -p /opt/kernel/ && cd /opt/kernel/
user@laptop:/opt/kernel$ git clone https://github.com/MarvellEmbeddedProcessors/openwrt-kernel.git -b openwrt_17.02_release

 

OpenWrt


OpenWrt version supported for ESPRESSObin is Designated Driver (DD), with additional patches for the boards. We will download OpenWrt to /opt/openwrt/openwrt-dd:

user@laptop:~$ mkdir -p /opt/openwrt/ && cd /opt/openwrt/
user@laptop:~$ git clone https://github.com/MarvellEmbeddedProcessors/openwrt-dd.git -b openwrt_17.02_release

 

 Note

user@laptop:~$ sudo chown -R $(whoami):$(id -gn) /opt/kernel/
user@laptop:~$ sudo chown -R $(whoami):$(id -gn) /opt/openwrt/openwrt-dd/

{CODE}

 

Image configuration


After we have downloaded necessary repos, we head to our OpenWrt directory (in our case /opt/openwrt/openwrt-dd):

user@laptop:~$ cd /opt/openwrt/openwrt-dd/


and there we update and index the feeds with:

user@laptop:/opt/openwrt/openwrt-dd$ ./scripts/feeds update -a
user@laptop:/opt/openwrt/openwrt-dd$ ./scripts/feeds install -a


Now we invoke OpenWrt's image configuration dialog:

user@laptop:/opt/openwrt/openwrt-dd$ make menuconfig


and in the menu, we select the following:

Target System --->
    Marvell 64b Boards
Target Profile --->
    ESPRESSObin (Marvell Armada 3700 Community Board)
Target Images  --->
    [x] ramdisk  --->
    * Root filesystem archives *
    [x] tar.gz
    * Root filesystem images *
    [x] ext4  --->
[x] Advanced configuration options (for developers)  --->
    (/opt/kernel/openwrt-kernel) Use external kernel tree

 Note

If you have setup a different kernel path, make sure to replace it when defining external kernel tree variable.


Save your configuration and exit the make menuconfig interface. Build the image with the make command, e.g.:

user@laptop:/opt/openwrt/openwrt-dd$ make -j5


To speed up the build process, you can utilize multiple cores with the following command:

user@laptop:/opt/openwrt/openwrt-dd$ make -j$(($(nproc)+1))


When the build process finishes, the binaries will be generated inside the /bin/mvebu64/ directory. We will need the armada-3720-community.dtb device tree file, openwrt-armada-ESPRESSObin-Image image and openwrt-mvebu64-armada-espressobin-rootfs.tar.gz root file system.

To see how to flash these files onto a USB device or SD card, see Boot from MicroSD card/USB stick - OpenWrt.