Skip to content

Commit

Permalink
[microTVM] Refactor zephyr installation + Update Zephyr RVM doc (apac…
Browse files Browse the repository at this point in the history
…he#7915)

* refactor

* script

* update

* fix

* different zephyr branch

* trigger build
  • Loading branch information
mehrdadh authored and Trevor Morris committed May 6, 2021
1 parent 9c4b950 commit 2fba8a5
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 11 deletions.
10 changes: 8 additions & 2 deletions apps/microtvm/reference-vm/zephyr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 2 additions & 4 deletions apps/microtvm/reference-vm/zephyr/base-box/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.ci_qemu
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
25 changes: 25 additions & 0 deletions docker/install/ubuntu_init_zephyr_project.sh
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions docker/install/ubuntu_install_zephyr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 2fba8a5

Please sign in to comment.