aro86
June 1, 2019, 3:49pm
1
Hello everybody.
I have a minor problem with the cross compilation of Mender-client.
Everything works great but when I run “mender -version” the shown version is unknown. (So in mender server the version of Mender client for every device is unknown too).
Perhaps I am missing some parameter that has to be given when compailing.
Any body has faced this?
best regards.
Hi @aro86 welcome. How do you crosscompile mender-client? Using some build system or manually? Thanks.
aro86
June 1, 2019, 4:47pm
3
Hi @MarekBelisko , thanks for your response.
I compile it with a script:
LIBLZMA_INSTALL_PATH="$(pwd)/install"
cd $GOPATH
if [ cpu == "armv8" ]; then
GOARCH="arm64"
CGO_CFLAGS="-mtune=cortex-a53 -I {LIBLZMA_INSTALL_PATH}/include"
CGO_LDFLAGS="-L${LIBLZMA_INSTALL_PATH}/lib"
else
echo “Error: unsupported processor type: $cpu”
exit 1
fi
printf -v ARCH “%sv%s” $GOARCH
echo “Building binary for $ARCH architecture…”
go clean $package
env CGO_ENABLED=1 CC=$CC GOOS=$GOOS GOARCH=$GOARCH CGO_CFLAGS="$CGO_CFLAGS" CGO_LDFLAGS="$CGO_LDFLAGS" go build -o $output_file $package
Thanks.Looks like yo want to crossompile it so in this case pls use info (scripts) from this repo
aro86
June 1, 2019, 5:01pm
5
@MarekBelisko I based my script on https://github.com/mendersoftware/mender-crossbuild/blob/master/go-executable-build.sh , but the version in the bianry is missing. Nevertheless the binary is well compiled and works fine in my board.
The version is set if you use the Makefile
in mendersoftware/mender, and specifically these lines,
aro86
June 3, 2019, 10:17am
8
@mirzak how can I open a pull request to add the needed changes to add the version when compiling with go-executable-build.sh?
I have tried with my github user but (as expected) I do not have permission for that.
aro86
June 3, 2019, 10:37am
9
@mirzak I have created ticket:
https://tracker.mender.io/browse/MEN-2576
Where i have added a possible solution for showing the version when compiling with go-executable-build.sh
mirzak
June 3, 2019, 11:02am
10
You first need to fork the repository on github, make the necessary changes, push to your fork and then create the pull-request