2021-04-29 09:20:31 +08:00
|
|
|
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright(c) 2021 Intel Corporation. All rights reserved.
|
|
|
|
|
|
|
|
# "All problems can be solved by another level of indirection"
|
|
|
|
# Ideally, this script would not be needed.
|
2021-07-12 14:28:35 +08:00
|
|
|
#
|
|
|
|
# Minor adjustments to the docker image provided by the Zephyr project.
|
2021-04-29 09:20:31 +08:00
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
unset ZEPHYR_BASE
|
|
|
|
|
|
|
|
# Make sure we're in the right place; chgrp -R below.
|
|
|
|
test -e ./scripts/xtensa-build-zephyr.sh
|
|
|
|
|
2021-07-12 14:28:35 +08:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get -y install tree
|
|
|
|
|
2021-09-29 01:56:16 +08:00
|
|
|
# As of container version 0.18.4,
|
|
|
|
# https://github.com/zephyrproject-rtos/docker-image/blob/master/Dockerfile
|
|
|
|
# installs two SDKs: ZSDK_VERSION=0.12.4 and ZSDK_ALT_VERSION=0.13.1
|
|
|
|
# ZEPHYR_SDK_INSTALL_DIR points at ZSDK_VERSION but we want the latest.
|
2021-09-28 10:19:43 +08:00
|
|
|
unset ZEPHYR_SDK_INSTALL_DIR
|
|
|
|
|
|
|
|
# Zephyr's CMake does not look in /opt but it searches $HOME
|
|
|
|
ls -ld /opt/toolchains/zephyr-sdk-*
|
|
|
|
ln -s /opt/toolchains/zephyr-sdk-* ~/
|
|
|
|
|
2021-04-29 09:20:31 +08:00
|
|
|
if test -e zephyrproject; then
|
2021-09-09 03:33:23 +08:00
|
|
|
./scripts/xtensa-build-zephyr.sh -a "$@"
|
2021-04-29 09:20:31 +08:00
|
|
|
else
|
|
|
|
# Matches docker.io/zephyrprojectrtos/zephyr-build:latest gid
|
|
|
|
ls -ln | head
|
|
|
|
stat .
|
|
|
|
sudo chgrp -R 1000 .
|
|
|
|
sudo chmod -R g+rwX .
|
2021-09-09 03:33:23 +08:00
|
|
|
./scripts/xtensa-build-zephyr.sh -a -c "$@"
|
2021-04-29 09:20:31 +08:00
|
|
|
fi
|