1
0
mirror of https://github.com/rancher/os.git synced 2025-09-12 04:01:20 +00:00

Multi-arch build

Currently, for amd64 (the default) and arm.
Run `dapper make ARCH=arm rootfs` to build rootfs.tar.gz for arm.
This commit is contained in:
Ivan Mikushin
2016-01-15 18:18:30 +05:00
parent 3a0aebe738
commit 2f27271a2c
18 changed files with 531 additions and 73 deletions

19
scripts/mk-ros.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
set -ex
ros="$1"
ARCH=${ARCH:?"ARCH not set"}
VERSION=${VERSION:?"VERSION not set"}
cd $(dirname $0)/..
strip_bin=$(which strip)
if [ "${ARCH}" == "arm" ]; then
export GOARM=6
export CC=/usr/bin/arm-linux-gnueabihf-gcc
export CGO_ENABLED=1
strip_bin=/usr/arm-linux-gnueabihf/bin/strip
fi
GOARCH=${ARCH} go build -tags netgo -installsuffix netgo -ldflags "-X github.com/rancher/os/config.VERSION=${VERSION} -linkmode external -extldflags -static" -o ${ros}
${strip_bin} --strip-all ${ros}