diff --git a/apps/microtvm/reference-vm/base-box-tool.py b/apps/microtvm/reference-vm/base-box-tool.py index 325b9bc0c4c9..0f2a1242e993 100755 --- a/apps/microtvm/reference-vm/base-box-tool.py +++ b/apps/microtvm/reference-vm/base-box-tool.py @@ -61,6 +61,7 @@ "docker/install/ubuntu_init_zephyr_project.sh", "docker/install/ubuntu_install_zephyr_sdk.sh", "docker/install/ubuntu_install_cmsis.sh", + "docker/install/ubuntu_install_nrfjprog.sh", ] PACKER_FILE_NAME = "packer.json" diff --git a/apps/microtvm/reference-vm/base-box/base_box_setup.sh b/apps/microtvm/reference-vm/base-box/base_box_setup.sh index a1959e5d3bf7..33487150f935 100755 --- a/apps/microtvm/reference-vm/base-box/base_box_setup.sh +++ b/apps/microtvm/reference-vm/base-box/base_box_setup.sh @@ -36,22 +36,8 @@ sed -i "/^# If not running interactively,/ i export ZEPHYR_BASE=$HOME/zephyr/zep sed -i "/^# If not running interactively,/ i\\ " ~/.bashrc # nrfjprog -NRF_COMMANDLINE_TOOLS_FILE=nRFCommandLineToolsLinuxamd64.tar.gz -NRF_COMMANDLINE_TOOLS_URL=https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-12-1/nRFCommandLineTools10121Linuxamd64.tar.gz -NRF_COMMANDLINE_TOOLS_INSTALLER=nRF-Command-Line-Tools_10_12_1_Linux-amd64.deb -JLINK_LINUX_INSTALLER=JLink_Linux_V688a_x86_64.deb - -cd ~ -mkdir -p nrfjprog -wget --no-verbose -O $NRF_COMMANDLINE_TOOLS_FILE $NRF_COMMANDLINE_TOOLS_URL -cd nrfjprog -tar -xzvf "../${NRF_COMMANDLINE_TOOLS_FILE}" -sudo apt install -y "./${JLINK_LINUX_INSTALLER}" -sudo apt install -y "./${NRF_COMMANDLINE_TOOLS_INSTALLER}" -source ~/.profile -nrfjprog --help -cd .. -rm -rf nrfjprog "${NRF_COMMANDLINE_TOOLS_FILE}" +sudo ~/ubuntu_install_nrfjprog.sh +rm -f ~/ubuntu_install_nrfjprog.sh # Zephyr pip3 install --user -U west diff --git a/docker/Dockerfile.ci_arm b/docker/Dockerfile.ci_arm index 2297e8f1e6e7..9bb34589b5f9 100644 --- a/docker/Dockerfile.ci_arm +++ b/docker/Dockerfile.ci_arm @@ -26,6 +26,9 @@ RUN apt-get update --fix-missing RUN apt-install-and-clear -y ca-certificates gnupg2 +COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh +RUN bash /install/ubuntu_setup_tz.sh + COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh diff --git a/docker/Dockerfile.ci_cortexm b/docker/Dockerfile.ci_cortexm index 8e8d2c0a4f9e..29a19454a9ee 100644 --- a/docker/Dockerfile.ci_cortexm +++ b/docker/Dockerfile.ci_cortexm @@ -23,6 +23,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear RUN apt-get update --fix-missing +COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh +RUN bash /install/ubuntu_setup_tz.sh + COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh @@ -81,6 +84,10 @@ RUN bash /install/ubuntu_install_zephyr.sh ENV ZEPHYR_BASE=/opt/zephyrproject/zephyr ENV PATH /opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin:$PATH +# NRF +COPY install/ubuntu_install_nrfjprog.sh /install/ubuntu_install_nrfjprog.sh +RUN bash /install/ubuntu_install_nrfjprog.sh + # FreeRTOS deps COPY install/ubuntu_install_freertos.sh /install/ubuntu_install_freertos.sh RUN bash /install/ubuntu_install_freertos.sh diff --git a/docker/Dockerfile.ci_cpu b/docker/Dockerfile.ci_cpu index 155f9ef7d914..a667501827be 100644 --- a/docker/Dockerfile.ci_cpu +++ b/docker/Dockerfile.ci_cpu @@ -22,6 +22,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear RUN apt-get update --fix-missing +COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh +RUN bash /install/ubuntu_setup_tz.sh + COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh diff --git a/docker/Dockerfile.ci_gpu b/docker/Dockerfile.ci_gpu index 4b729a5f516e..a9ddc22c97a2 100644 --- a/docker/Dockerfile.ci_gpu +++ b/docker/Dockerfile.ci_gpu @@ -29,6 +29,9 @@ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/ RUN rm -f /etc/apt/sources.list.d/nvidia-ml.list && apt-get clean RUN apt-get update --fix-missing +COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh +RUN bash /install/ubuntu_setup_tz.sh + COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh diff --git a/docker/Dockerfile.ci_hexagon b/docker/Dockerfile.ci_hexagon index f1fc7be52484..66a3f253db55 100644 --- a/docker/Dockerfile.ci_hexagon +++ b/docker/Dockerfile.ci_hexagon @@ -25,6 +25,9 @@ RUN apt-get update --fix-missing RUN apt-install-and-clear -y ca-certificates gnupg2 libxml2-dev +COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh +RUN bash /install/ubuntu_setup_tz.sh + COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh diff --git a/docker/Dockerfile.ci_i386 b/docker/Dockerfile.ci_i386 index b37e849819be..9a2e08eaab76 100644 --- a/docker/Dockerfile.ci_i386 +++ b/docker/Dockerfile.ci_i386 @@ -26,6 +26,9 @@ RUN apt-get update --fix-missing RUN apt-install-and-clear -y ca-certificates +COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh +RUN bash /install/ubuntu_setup_tz.sh + COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh diff --git a/docker/Dockerfile.ci_minimal b/docker/Dockerfile.ci_minimal index 2a3da14f0fe1..8ebcc6c9b9f2 100644 --- a/docker/Dockerfile.ci_minimal +++ b/docker/Dockerfile.ci_minimal @@ -22,6 +22,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear RUN apt-get update --fix-missing +COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh +RUN bash /install/ubuntu_setup_tz.sh + COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh diff --git a/docker/Dockerfile.ci_riscv b/docker/Dockerfile.ci_riscv index 0d03db15e39b..3dd1943d27e1 100644 --- a/docker/Dockerfile.ci_riscv +++ b/docker/Dockerfile.ci_riscv @@ -23,6 +23,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear RUN apt-get update --fix-missing +COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh +RUN bash /install/ubuntu_setup_tz.sh + COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh diff --git a/docker/Dockerfile.ci_wasm b/docker/Dockerfile.ci_wasm index 46f64b44dab5..3e794c312c66 100644 --- a/docker/Dockerfile.ci_wasm +++ b/docker/Dockerfile.ci_wasm @@ -20,6 +20,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear RUN apt-get update --fix-missing +COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh +RUN bash /install/ubuntu_setup_tz.sh + COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh diff --git a/docker/Dockerfile.demo_android b/docker/Dockerfile.demo_android index e66fb3aa3cfa..197914613a3a 100644 --- a/docker/Dockerfile.demo_android +++ b/docker/Dockerfile.demo_android @@ -22,6 +22,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear RUN apt-get update --fix-missing +COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh +RUN bash /install/ubuntu_setup_tz.sh + COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh diff --git a/docker/Dockerfile.demo_rocm b/docker/Dockerfile.demo_rocm index 1dd7d1bf119a..3f3ffef78e68 100644 --- a/docker/Dockerfile.demo_rocm +++ b/docker/Dockerfile.demo_rocm @@ -20,6 +20,9 @@ FROM ubuntu:18.04 COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear +COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh +RUN bash /install/ubuntu_setup_tz.sh + COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh diff --git a/docker/Dockerfile.demo_vitis_ai b/docker/Dockerfile.demo_vitis_ai index 445f74ced982..fa024767fd1e 100644 --- a/docker/Dockerfile.demo_vitis_ai +++ b/docker/Dockerfile.demo_vitis_ai @@ -22,6 +22,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear RUN apt-get update --fix-missing +COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh +RUN bash /install/ubuntu_setup_tz.sh + COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh diff --git a/docker/Dockerfile.docs b/docker/Dockerfile.docs index 9fe90a7302c0..f7904cabf750 100644 --- a/docker/Dockerfile.docs +++ b/docker/Dockerfile.docs @@ -23,6 +23,9 @@ COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear RUN apt-get update --fix-missing +COPY install/ubuntu_setup_tz.sh /install/ubuntu_setup_tz.sh +RUN bash /install/ubuntu_setup_tz.sh + COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh diff --git a/docker/install/ubuntu_install_core.sh b/docker/install/ubuntu_install_core.sh index 7f26c6def25d..c4c6f6b0bcc7 100755 --- a/docker/install/ubuntu_install_core.sh +++ b/docker/install/ubuntu_install_core.sh @@ -22,11 +22,6 @@ set -u set -x set -o pipefail -export DEBIAN_FRONTEND=noninteractive -export TZ=Etc/UTC -ln -snf /usr/share/zoneinfo/$TZ /etc/localtime -echo $TZ > /etc/timezone - # install libraries for building c++ core on ubuntu apt-get update && apt-install-and-clear -y --no-install-recommends \ apt-transport-https \ diff --git a/docker/install/ubuntu_install_nrfjprog.sh b/docker/install/ubuntu_install_nrfjprog.sh new file mode 100755 index 000000000000..372c39a06a58 --- /dev/null +++ b/docker/install/ubuntu_install_nrfjprog.sh @@ -0,0 +1,39 @@ +#!/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. + +set -e +set -u +set -o pipefail +set -x + +NRF_COMMANDLINE_TOOLS_FILE=nRFCommandLineToolsLinuxamd64.tar.gz +NRF_COMMANDLINE_TOOLS_URL=https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-12-1/nRFCommandLineTools10121Linuxamd64.tar.gz +NRF_COMMANDLINE_TOOLS_INSTALLER=nRF-Command-Line-Tools_10_12_1_Linux-amd64.deb +JLINK_LINUX_INSTALLER=JLink_Linux_V688a_x86_64.deb + +cd ~ +mkdir -p nrfjprog +wget --no-verbose -O $NRF_COMMANDLINE_TOOLS_FILE $NRF_COMMANDLINE_TOOLS_URL + +cd nrfjprog +tar -xzvf "../${NRF_COMMANDLINE_TOOLS_FILE}" +apt-install-and-clear -y "./${JLINK_LINUX_INSTALLER}" +apt-install-and-clear -y "./${NRF_COMMANDLINE_TOOLS_INSTALLER}" + +cd .. +rm -rf nrfjprog "${NRF_COMMANDLINE_TOOLS_FILE}" diff --git a/docker/install/ubuntu_setup_tz.sh b/docker/install/ubuntu_setup_tz.sh new file mode 100755 index 000000000000..adb8f5e06c17 --- /dev/null +++ b/docker/install/ubuntu_setup_tz.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. + +set -e +set -u +set -o pipefail + +export TZ=Etc/UTC +ln -snf /usr/share/zoneinfo/$TZ /etc/localtime +echo $TZ > /etc/timezone