diff --git a/apps/microtvm/reference-vm/zephyr/README.md b/apps/microtvm/reference-vm/zephyr/README.md index 7dd1ca62060a..6218d6d0f9f5 100644 --- a/apps/microtvm/reference-vm/zephyr/README.md +++ b/apps/microtvm/reference-vm/zephyr/README.md @@ -21,10 +21,16 @@ This directory contains setup files for Zephyr virtual machine used for testing that are supported by [Zephyr Project](https://zephyrproject.org/). ## VM Information for Developers -Zephyr VM is published under [tlcpack/microtvm-zephyr](https://app.vagrantup.com/tlcpack/boxes/microtvm-zephyr). +Zephyr VM is published under [tlcpack](https://app.vagrantup.com/tlcpack). Here is a list of different release versions and their tools. -### [v0.0.4](https://app.vagrantup.com/tlcpack/boxes/microtvm-zephyr/versions/0.0.4) +### [microtvm-zephyr-2.5](https://app.vagrantup.com/tlcpack/boxes/microtvm-zephyr-2.5/versions/0.0.1) + +- Zephyr [version 2.5.0] +- Zephyr SDK [version 0.12.3] +- nRFjProg [version 10.12.1] + +### [microtvm-zephyr-2.4](https://app.vagrantup.com/tlcpack/boxes/microtvm-zephyr/versions/0.0.4) - Zephyr [version 2.4.0] - Zephyr SDK [version 0.11.3] diff --git a/apps/microtvm/reference-vm/zephyr/base-box/setup.sh b/apps/microtvm/reference-vm/zephyr/base-box/setup.sh index 6eab652067b3..8f7ed41af337 100644 --- a/apps/microtvm/reference-vm/zephyr/base-box/setup.sh +++ b/apps/microtvm/reference-vm/zephyr/base-box/setup.sh @@ -81,10 +81,8 @@ pip3 install --user -U west echo 'export PATH=$HOME/.local/bin:"$PATH"' >> ~/.profile source ~/.profile echo PATH=$PATH -west init --mr v2.5.0 ~/zephyr -cd ~/zephyr -west update -west zephyr-export +REPO_ROOT=$(git rev-parse --show-toplevel) +${REPO_ROOT}/docker/install/ubuntu_init_zephyr_project.sh ~/zephyr v2.5.0 cd ~ echo "Downloading zephyr SDK..." diff --git a/docker/Dockerfile.ci_qemu b/docker/Dockerfile.ci_qemu index 04434b7186b0..a21b44aee435 100644 --- a/docker/Dockerfile.ci_qemu +++ b/docker/Dockerfile.ci_qemu @@ -62,6 +62,7 @@ RUN bash /install/ubuntu_install_qemu.sh # Zephyr SDK deps COPY install/ubuntu_install_zephyr.sh /install/ubuntu_install_zephyr.sh +COPY install/ubuntu_init_zephyr_project.sh /install/ubuntu_init_zephyr_project.sh RUN bash /install/ubuntu_install_zephyr.sh ENV ZEPHYR_BASE=/opt/zephyrproject/zephyr diff --git a/docker/install/ubuntu_init_zephyr_project.sh b/docker/install/ubuntu_init_zephyr_project.sh new file mode 100755 index 000000000000..2116a4d981f5 --- /dev/null +++ b/docker/install/ubuntu_init_zephyr_project.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +DOWNLOAD_DIR=$1 +ZEPHYR_BRANCH=$2 + +west init --mr ${ZEPHYR_BRANCH} ${DOWNLOAD_DIR} +cd ${DOWNLOAD_DIR} +west update +west zephyr-export diff --git a/docker/install/ubuntu_install_zephyr.sh b/docker/install/ubuntu_install_zephyr.sh index 732f6f69ec3b..a092810eef4d 100644 --- a/docker/install/ubuntu_install_zephyr.sh +++ b/docker/install/ubuntu_install_zephyr.sh @@ -55,9 +55,11 @@ pip3 install west #EOF #chmod a+x /usr/local/bin/west -west init --mr v2.5-branch /opt/zephyrproject -cd /opt/zephyrproject -west update +# Init ZephyrProject +ZEPHYR_PROJECT_PATH=/opt/zephyrproject +ZEPHYR_INIT_SCRIPT=$(find -name "ubuntu_init_zephyr_project.sh") +bash ${ZEPHYR_INIT_SCRIPT} ${ZEPHYR_PROJECT_PATH} v2.5-branch +cd ${ZEPHYR_PROJECT_PATH} # This step is required because of the way docker/bash.sh works. It sets the user home directory to # /workspace (or the TVM root, anyhow), and this means that zephyr expects a ~/.cache directory to be @@ -67,8 +69,6 @@ west update mkdir zephyr/.cache chmod o+rwx zephyr/.cache -west zephyr-export - #/opt/west/bin/pip3 install -r /opt/zephyrproject/zephyr/scripts/requirements.txt pip3 install -r /opt/zephyrproject/zephyr/scripts/requirements.txt