You are browsing documentation for a version other than the latest stable release. Switch to the latest stable release, 1.7.
By using Golang tools the Mender client can easily be cross-compiled to target a number of different architectures.
The Mender client must also be integrated with your board, cross-compiling it is often one step in the board integration process.
This example is targeting the
armhf architecture but is applicable to other
architectures with minor adjustments.
Follow the instructions in the official Golang page to create a working Golang environment.
You will need a cross-compiler toolchain targeting your device.
If you are using Ubuntu and targeting
armhf, install it with:
sudo apt install gcc-arm-linux-gnueabihf
First, fetch the Mender client source code:
go get github.com/mendersoftware/mender
Change directory to where the Mender sources are:
Check out the version of the Mender client you want to compile; see
git tag for available versions.
For example, to use Mender 2.0.0b1 run the following command:
git checkout 2.0.0b1
Then cross-compile the
mender binary with:
env CGO_ENABLED=1 \ CC=arm-linux-gnueabihf-gcc \ GOOS=linux \ GOARCH=arm make build
After compilation has finished, the Mender binary is located at:
The strip command for your toolchain can be used to reduce the size of the binary by removing symbols that are not needed on a production system. In our example, we can run