1
0
mirror of https://github.com/rancher/os.git synced 2025-09-17 07:30:42 +00:00

cross-build is back

`HOST_ARCH=arm64 ./make.sh minimal` builds vmlinuz and initrd for arm64 on arm64 (sourcing .docker-env.arm64 in the process)
`ARCH=arm ./make.sh rootfs` builds rootfs.tar.gz for arm on your current docker environment
This commit is contained in:
Ivan Mikushin
2016-03-14 18:26:21 -07:00
parent 35ccb325ba
commit 356f25be20
9 changed files with 41 additions and 32 deletions

View File

@@ -1,21 +1,20 @@
#!/bin/sh
set -ex
guessArch() {
docker version | grep 'OS/Arch:' | tail -n+2 | awk '{print $2}' | cut -f2 -d'/'
}
ARCH=${ARCH:-"$(guessArch)"}
ARCH=${ARCH:?"Failed to guess ARCH"}
export ARCH
HOST_ARCH=${HOST_ARCH:-$(docker version | grep 'OS/Arch:' | tail -n+2 | awk '{print $2}' | cut -f2 -d'/')}
HOST_ARCH=${HOST_ARCH:?"Failed to guess HOST_ARCH"}
ARCH=${ARCH:-"$HOST_ARCH"}
export HOST_ARCH ARCH
cd $(dirname $0)/..
[ -f "./.docker-env.${ARCH}" ] && . ./.docker-env.${ARCH} || echo "WARNING: missing .docker-env.${ARCH} (to use an ${ARCH} docker host)"
[ -f "./.docker-env.${HOST_ARCH}" ] && . ./.docker-env.${HOST_ARCH} || echo "WARNING: missing .docker-env.${HOST_ARCH} (to use an ${HOST_ARCH} docker host)"
. ./build.conf.${HOST_ARCH}
export HOST_DOCKER_BINARY_URL=${DOCKER_BINARY_URL}
docker inspect $DAPPER_BASE >/dev/null 2>&1 || docker pull $DAPPER_BASE
docker tag $DAPPER_BASE rancher/os-dapper-base
set -a
. ./build.conf.${ARCH}
set +a
docker inspect $DAPPER_BASE >/dev/null 2>&1 || docker pull $DAPPER_BASE
docker tag $DAPPER_BASE rancher/os-dapper-base