From 7a5ff84be2ee7691b5def4868f423edd372c65f1 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 6 Jan 2023 15:02:23 -0800 Subject: [PATCH 1/4] Update nrfjprog script and LLVM script --- docker/Dockerfile.ci_cortexm | 6 ++--- docker/install/ubuntu2004_install_llvm.sh | 28 +++++++++++++++++++++++ docker/install/ubuntu_install_nrfjprog.sh | 19 +++++++++------ 3 files changed, 43 insertions(+), 10 deletions(-) create mode 100755 docker/install/ubuntu2004_install_llvm.sh diff --git a/docker/Dockerfile.ci_cortexm b/docker/Dockerfile.ci_cortexm index 29a19454a9ee..346c24c9df53 100644 --- a/docker/Dockerfile.ci_cortexm +++ b/docker/Dockerfile.ci_cortexm @@ -17,7 +17,7 @@ # CI docker CPU env # tag: v0.62 -FROM ubuntu:18.04 +FROM ubuntu:20.04 COPY utils/apt-install-and-clear.sh /usr/local/bin/apt-install-and-clear @@ -45,8 +45,8 @@ ENV PYTHONNOUSERSITE 1 # Disable .local directory from affecting CI. COPY install/ubuntu_install_python_package.sh /install/ubuntu_install_python_package.sh RUN bash /install/ubuntu_install_python_package.sh -COPY install/ubuntu1804_install_llvm.sh /install/ubuntu1804_install_llvm.sh -RUN bash /install/ubuntu1804_install_llvm.sh +COPY install/ubuntu2004_install_llvm.sh /install/ubuntu2004_install_llvm.sh +RUN bash /install/ubuntu2004_install_llvm.sh # Rust env (build early; takes a while) COPY install/ubuntu_install_rust.sh /install/ubuntu_install_rust.sh diff --git a/docker/install/ubuntu2004_install_llvm.sh b/docker/install/ubuntu2004_install_llvm.sh new file mode 100755 index 000000000000..4743f9e87d4c --- /dev/null +++ b/docker/install/ubuntu2004_install_llvm.sh @@ -0,0 +1,28 @@ +#!/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 -euxo pipefail + +wget https://apt.llvm.org/llvm.sh +chmod +x llvm.sh + +./llvm.sh 9 +./llvm.sh 10 +./llvm.sh 11 +./llvm.sh 12 +./llvm.sh 13 diff --git a/docker/install/ubuntu_install_nrfjprog.sh b/docker/install/ubuntu_install_nrfjprog.sh index 1a82f057a950..6c23d547aa50 100755 --- a/docker/install/ubuntu_install_nrfjprog.sh +++ b/docker/install/ubuntu_install_nrfjprog.sh @@ -21,19 +21,24 @@ set -u set -o pipefail set -x +TEMP_PATH_NAME="nrfjprog_tmp_path" + +# Install JLink NRF_COMMANDLINE_TOOLS_FILE=nRFCommandLineToolsLinuxamd64.tar.gz -NRF_COMMANDLINE_TOOLS_URL=https://nsscprodmedia.blob.core.windows.net/prod/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 +NRF_COMMANDLINE_TOOLS_URL=https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-18-1/nrf-command-line-tools-10.18.1_linux-amd64.tar.gz +JLINK_LINUX_INSTALLER=JLink_Linux_V780c_x86_64.deb cd ~ -mkdir -p nrfjprog +mkdir -p ${TEMP_PATH_NAME} wget --no-verbose -O $NRF_COMMANDLINE_TOOLS_FILE $NRF_COMMANDLINE_TOOLS_URL -cd nrfjprog +cd ${TEMP_PATH_NAME} tar -xzvf "../${NRF_COMMANDLINE_TOOLS_FILE}" apt-install-and-clear -y "./${JLINK_LINUX_INSTALLER}" -apt-install-and-clear -y "./${NRF_COMMANDLINE_TOOLS_INSTALLER}" + +# Install nrfjprog +wget --no-verbose https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-18-1/nrf-command-line-tools_10.18.1_amd64.deb +apt-install-and-clear -y ./nrf-command-line-tools_10.18.1_amd64.deb cd .. -rm -rf nrfjprog "${NRF_COMMANDLINE_TOOLS_FILE}" +rm -rf ${TEMP_PATH_NAME} "${NRF_COMMANDLINE_TOOLS_FILE}" From 388d0fdbad9c6b76f0ca2769631ce783782ba7cb Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Fri, 6 Jan 2023 15:06:20 -0800 Subject: [PATCH 2/4] cleanup --- docker/install/ubuntu2004_install_llvm.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/install/ubuntu2004_install_llvm.sh b/docker/install/ubuntu2004_install_llvm.sh index 4743f9e87d4c..a255c51d6d7e 100755 --- a/docker/install/ubuntu2004_install_llvm.sh +++ b/docker/install/ubuntu2004_install_llvm.sh @@ -26,3 +26,5 @@ chmod +x llvm.sh ./llvm.sh 11 ./llvm.sh 12 ./llvm.sh 13 + +rm llvm.sh From 410e5bb1ecfe8a0e82c52cb6377e577bb42c4cc4 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Mon, 9 Jan 2023 10:30:15 -0800 Subject: [PATCH 3/4] change llvm install to apt --- docker/install/ubuntu2004_install_llvm.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/docker/install/ubuntu2004_install_llvm.sh b/docker/install/ubuntu2004_install_llvm.sh index a255c51d6d7e..c924cdddf1f9 100755 --- a/docker/install/ubuntu2004_install_llvm.sh +++ b/docker/install/ubuntu2004_install_llvm.sh @@ -18,13 +18,16 @@ set -euxo pipefail -wget https://apt.llvm.org/llvm.sh -chmod +x llvm.sh +echo deb http://apt.llvm.org/focal/ llvm-toolchain-focal main\ + >> /etc/apt/sources.list.d/llvm.list -./llvm.sh 9 -./llvm.sh 10 -./llvm.sh 11 -./llvm.sh 12 -./llvm.sh 13 +echo deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main\ + >> /etc/apt/sources.list.d/llvm.list -rm llvm.sh +apt-get update && apt-install-and-clear -y \ + llvm-9 llvm-10 llvm-11 llvm-12 llvm-13 \ + clang-9 libclang-9-dev \ + clang-10 libclang-10-dev \ + clang-11 libclang-11-dev \ + clang-12 libclang-12-dev \ + clang-13 libclang-13-dev From 0dd4909fada86f13a151cef69ef43d7ca211ce8f Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Mon, 9 Jan 2023 10:36:49 -0800 Subject: [PATCH 4/4] add SHA to nrfjprog installation script --- docker/install/ubuntu_install_nrfjprog.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docker/install/ubuntu_install_nrfjprog.sh b/docker/install/ubuntu_install_nrfjprog.sh index 6c23d547aa50..7baedf54fb3b 100755 --- a/docker/install/ubuntu_install_nrfjprog.sh +++ b/docker/install/ubuntu_install_nrfjprog.sh @@ -27,18 +27,23 @@ TEMP_PATH_NAME="nrfjprog_tmp_path" NRF_COMMANDLINE_TOOLS_FILE=nRFCommandLineToolsLinuxamd64.tar.gz NRF_COMMANDLINE_TOOLS_URL=https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-18-1/nrf-command-line-tools-10.18.1_linux-amd64.tar.gz JLINK_LINUX_INSTALLER=JLink_Linux_V780c_x86_64.deb +NRF_COMMANDLINE_TOOLS_SHA=5611536ca3377d64131ccd51232f9e33cde6d289b03ea33db0581a1288be8b0b10f995e2d60fdd4a3ce5a5c7b12bc85ddc672b282c9af8c5808707ab41543a7d cd ~ mkdir -p ${TEMP_PATH_NAME} wget --no-verbose -O $NRF_COMMANDLINE_TOOLS_FILE $NRF_COMMANDLINE_TOOLS_URL +echo "$NRF_COMMANDLINE_TOOLS_SHA $NRF_COMMANDLINE_TOOLS_FILE" | sha512sum --check cd ${TEMP_PATH_NAME} tar -xzvf "../${NRF_COMMANDLINE_TOOLS_FILE}" apt-install-and-clear -y "./${JLINK_LINUX_INSTALLER}" # Install nrfjprog -wget --no-verbose https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-18-1/nrf-command-line-tools_10.18.1_amd64.deb -apt-install-and-clear -y ./nrf-command-line-tools_10.18.1_amd64.deb +NRF_DEB_FILE=nrf-command-line-tools_amd64.deb +NRF_DEB_FILE_SHA=1f0339e16d50345ddde9757c2a4211361bcc78ff7371aac09decfffa809d86329001f5bc135f33dd154000a8f0da8bee4a0e80d3865ceff229f63ff9ace5ea95 +wget --no-verbose -O $NRF_DEB_FILE https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-18-1/nrf-command-line-tools_10.18.1_amd64.deb +echo "$NRF_DEB_FILE_SHA $NRF_DEB_FILE" | sha512sum --check +apt-install-and-clear -y ./$NRF_DEB_FILE cd .. rm -rf ${TEMP_PATH_NAME} "${NRF_COMMANDLINE_TOOLS_FILE}"