blob: b75be173d2ed5acaa99ca2db6e9c5f01b76a4fd5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#!/bin/bash
SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# DOCKER_HOME and DOCKER_ENV_VARS
source $SCRIPT_ROOT/nnfw_docker
HOST_HOME=$SCRIPT_ROOT/../..
DOCKER_VOLUMES+=" -v $HOST_HOME:$DOCKER_HOME"
DOCKER_ENV_VARS+=" -e TARGET_ARCH=armv7l"
DOCKER_ENV_VARS+=" -e CROSS_BUILD=1"
DOCKER_ENV_VARS+=" -e ROOTFS_DIR=/opt/rootfs"
DOCKER_ENV_VARS+=" -e EXT_ACL_FOLDER=/opt/libarmcl"
DOCKER_RUN_OPTS="--rm"
DOCKER_RUN_OPTS+=" -w $DOCKER_HOME"
# prepare armcl library
if [[ ! -d $ARMCL_DIR ]]; then
echo "cannot find armcl"
exit 1
fi
# prepare rootfs
if [[ ! -d $ROOTFS_DIR ]]; then
echo "cannot find rootfs"
exit 1
fi
DOCKER_VOLUMES+=" -v $ROOTFS_DIR:/opt/rootfs"
DOCKER_VOLUMES+=" -v $ARMCL_DIR:/opt/libarmcl"
if [ -n "$DOCKER_INTERACTIVE" ]; then
DOCKER_RUN_OPTS+=" -it"
CMD="/bin/bash"
else
CMD="make external_acl && export BENCHMARK_ACL_BUILD=1 && make && make install && make build_test_suite"
fi
docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME sh -c "$CMD"
BUILD_RESULT=$?
source $SCRIPT_ROOT/../docker_helper
restore_ownership $HOST_HOME $DOCKER_HOME
exit $BUILD_RESULT
|