2018-04-26 00:48:41 +08:00
|
|
|
#!/bin/sh
|
2019-06-02 04:58:16 +08:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright(c) 2018 Intel Corporation. All rights reserved.
|
2018-04-26 00:48:41 +08:00
|
|
|
|
|
|
|
# Runs a given script in the docker container you can generate from the
|
|
|
|
# docker_build directory.
|
|
|
|
# Example:
|
|
|
|
# To build sof for baytrail:
|
|
|
|
# ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh byt
|
|
|
|
# To build topology:
|
2019-01-03 17:09:12 +08:00
|
|
|
# ./scripts/docker-run.sh ./scripts/build-tools.sh
|
2018-04-26 00:48:41 +08:00
|
|
|
|
2021-01-19 08:45:20 +08:00
|
|
|
# set -x
|
|
|
|
|
2021-09-30 12:10:19 +08:00
|
|
|
set -e
|
|
|
|
|
|
|
|
SOF_TOP="$(cd "$(dirname "$0")"/.. && /bin/pwd)"
|
|
|
|
|
2021-09-30 09:16:20 +08:00
|
|
|
# Log the container version. Especially useful when forgetting to update
|
|
|
|
# the 'sof' shortcut.
|
|
|
|
docker images sof
|
|
|
|
|
2021-01-19 08:45:20 +08:00
|
|
|
if tty --quiet; then
|
|
|
|
SOF_DOCKER_RUN="$SOF_DOCKER_RUN --tty"
|
|
|
|
fi
|
|
|
|
|
2021-09-30 12:10:19 +08:00
|
|
|
docker run -i -v "${SOF_TOP}":/home/sof/work/sof.git \
|
2021-09-30 07:11:23 +08:00
|
|
|
-v "${SOF_TOP}":/home/sof/work/sof-bind-mount-DO-NOT-DELETE \
|
2020-09-15 12:59:17 +08:00
|
|
|
--env CMAKE_BUILD_TYPE \
|
2020-09-25 13:07:07 +08:00
|
|
|
--env PRIVATE_KEY_OPTION \
|
2021-05-12 01:55:44 +08:00
|
|
|
--env http_proxy="$http_proxy" \
|
|
|
|
--env https_proxy="$https_proxy" \
|
2021-05-12 02:11:14 +08:00
|
|
|
--user "$(id -u)" \
|
2021-01-19 08:45:20 +08:00
|
|
|
$SOF_DOCKER_RUN \
|
2021-05-12 02:11:14 +08:00
|
|
|
sof "$@"
|