From aa2f4a5f632f6537a68e9b845ef5dc42987330f4 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 23 Apr 2021 11:54:58 -0700 Subject: [PATCH 1/6] refactor --- apps/microtvm/reference-vm/zephyr/base-box/setup.sh | 6 ++---- docker/Dockerfile.ci_qemu | 1 + docker/install/ubuntu_install_zephyr.sh | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/microtvm/reference-vm/zephyr/base-box/setup.sh b/apps/microtvm/reference-vm/zephyr/base-box/setup.sh index 6eab652067b3..1a4bd2e9c054 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 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_install_zephyr.sh b/docker/install/ubuntu_install_zephyr.sh index ff2d842769cb..74bccee03285 100644 --- a/docker/install/ubuntu_install_zephyr.sh +++ b/docker/install/ubuntu_install_zephyr.sh @@ -55,9 +55,8 @@ pip3 install west #EOF #chmod a+x /usr/local/bin/west -west init --mr v2.5.0 /opt/zephyrproject -cd /opt/zephyrproject -west update +# Init ZephyrProject +./ubuntu_init_zephyr_project.sh /opt/zephyrproject # 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 From 6987d91959b5b391e7e322784c7026ab82bffe5a Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 23 Apr 2021 11:56:56 -0700 Subject: [PATCH 2/6] script --- docker/install/ubuntu_init_zephyr_project.sh | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 docker/install/ubuntu_init_zephyr_project.sh diff --git a/docker/install/ubuntu_init_zephyr_project.sh b/docker/install/ubuntu_init_zephyr_project.sh new file mode 100755 index 000000000000..8e2e4a0c2156 --- /dev/null +++ b/docker/install/ubuntu_init_zephyr_project.sh @@ -0,0 +1,24 @@ +#!/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} + +west init --mr v2.5.0-branch $DOWNLOAD_DIR +cd $DOWNLOAD_DIR +west update +west zephyr-export From fc959906675f4c3c1470b401c315e0d1bbaca918 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 23 Apr 2021 13:50:38 -0700 Subject: [PATCH 3/6] update --- apps/microtvm/reference-vm/zephyr/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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] From 79553d849a27dfdfc26e8422afabcb741f82699b Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 23 Apr 2021 18:25:05 -0700 Subject: [PATCH 4/6] fix --- docker/install/ubuntu_init_zephyr_project.sh | 6 +++--- docker/install/ubuntu_install_zephyr.sh | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docker/install/ubuntu_init_zephyr_project.sh b/docker/install/ubuntu_init_zephyr_project.sh index 141734c465d5..e49fd9ff0c50 100755 --- a/docker/install/ubuntu_init_zephyr_project.sh +++ b/docker/install/ubuntu_init_zephyr_project.sh @@ -16,9 +16,9 @@ # specific language governing permissions and limitations # under the License. -DOWNLOAD_DIR={$1} +DOWNLOAD_DIR=$1 -west init --mr v2.5-branch $DOWNLOAD_DIR -cd $DOWNLOAD_DIR +west init --mr v2.5-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 74bccee03285..afadc7d99bf4 100644 --- a/docker/install/ubuntu_install_zephyr.sh +++ b/docker/install/ubuntu_install_zephyr.sh @@ -56,7 +56,10 @@ pip3 install west #chmod a+x /usr/local/bin/west # Init ZephyrProject -./ubuntu_init_zephyr_project.sh /opt/zephyrproject +ZEPHYR_PROJECT_PATH=/opt/zephyrproject +ZEPHYR_INIT_SCRIPT=$(find -name "ubuntu_init_zephyr_project.sh") +bash ${ZEPHYR_INIT_SCRIPT} ${ZEPHYR_PROJECT_PATH} +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 @@ -66,8 +69,6 @@ pip3 install west 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 From a9fa35ae6a715a5f363d8f471fe49c4a70434abb Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Mon, 26 Apr 2021 10:28:45 -0700 Subject: [PATCH 5/6] different zephyr branch --- apps/microtvm/reference-vm/zephyr/base-box/setup.sh | 2 +- docker/install/ubuntu_init_zephyr_project.sh | 3 ++- docker/install/ubuntu_install_zephyr.sh | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/microtvm/reference-vm/zephyr/base-box/setup.sh b/apps/microtvm/reference-vm/zephyr/base-box/setup.sh index 1a4bd2e9c054..8f7ed41af337 100644 --- a/apps/microtvm/reference-vm/zephyr/base-box/setup.sh +++ b/apps/microtvm/reference-vm/zephyr/base-box/setup.sh @@ -82,7 +82,7 @@ echo 'export PATH=$HOME/.local/bin:"$PATH"' >> ~/.profile source ~/.profile echo PATH=$PATH REPO_ROOT=$(git rev-parse --show-toplevel) -${REPO_ROOT}/docker/install/ubuntu_init_zephyr_project.sh ~/zephyr +${REPO_ROOT}/docker/install/ubuntu_init_zephyr_project.sh ~/zephyr v2.5.0 cd ~ echo "Downloading zephyr SDK..." diff --git a/docker/install/ubuntu_init_zephyr_project.sh b/docker/install/ubuntu_init_zephyr_project.sh index e49fd9ff0c50..2116a4d981f5 100755 --- a/docker/install/ubuntu_init_zephyr_project.sh +++ b/docker/install/ubuntu_init_zephyr_project.sh @@ -17,8 +17,9 @@ # under the License. DOWNLOAD_DIR=$1 +ZEPHYR_BRANCH=$2 -west init --mr v2.5-branch ${DOWNLOAD_DIR} +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 afadc7d99bf4..a092810eef4d 100644 --- a/docker/install/ubuntu_install_zephyr.sh +++ b/docker/install/ubuntu_install_zephyr.sh @@ -58,7 +58,7 @@ pip3 install west # Init ZephyrProject ZEPHYR_PROJECT_PATH=/opt/zephyrproject ZEPHYR_INIT_SCRIPT=$(find -name "ubuntu_init_zephyr_project.sh") -bash ${ZEPHYR_INIT_SCRIPT} ${ZEPHYR_PROJECT_PATH} +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 From 4bfff45543df1cee6c03344f463a7fca722c5ebb Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Mon, 26 Apr 2021 21:34:17 -0700 Subject: [PATCH 6/6] trigger build