|
| 1 | + |
| 2 | +#!/bin/bash |
| 3 | +# Copyright (c) Meta Platforms, Inc. and affiliates. |
| 4 | +# All rights reserved. |
| 5 | +# |
| 6 | +# This source code is licensed under the BSD-style license found in the |
| 7 | +# LICENSE file in the root directory of this source tree. |
| 8 | + |
| 9 | +set -ex |
| 10 | + |
| 11 | +# Double check if the NDK version is set |
| 12 | +[ -n "${ZEPHYR_SDK}" ] |
| 13 | + |
| 14 | +install_prerequiresites() { |
| 15 | + rm /var/lib/dpkg/info/libc-bin.* |
| 16 | + apt-get clean |
| 17 | + apt-get -y update |
| 18 | + apt-get install -y libc-bin |
| 19 | + apt-get -y update |
| 20 | + apt-get clean |
| 21 | + apt-get install --no-install-recommends -y dos2unix |
| 22 | + apt-get install --no-install-recommends -y ca-certificates |
| 23 | + apt-get install -y --reinstall libc-bin |
| 24 | + apt-get install --no-install-recommends -y file |
| 25 | + apt-get install --no-install-recommends -y locales |
| 26 | + apt-get install --no-install-recommends -y git |
| 27 | + apt-get install --no-install-recommends -y build-essential |
| 28 | + apt-get install --no-install-recommends -y cmake |
| 29 | + apt-get install --no-install-recommends -y ninja-build gperf |
| 30 | + apt-get install --no-install-recommends -y device-tree-compiler |
| 31 | + apt-get install --no-install-recommends -y wget |
| 32 | + apt-get install --no-install-recommends -y curl |
| 33 | + apt-get install --no-install-recommends -y xz-utils |
| 34 | + apt-get install --no-install-recommends -y dos2unix |
| 35 | + apt-get install --no-install-recommends -y vim |
| 36 | + apt-get install --no-install-recommends -y nano |
| 37 | + apt-get install --no-install-recommends -y mc |
| 38 | + apt-get install --no-install-recommends -y openssh-server |
| 39 | + apt-get install -y gdb |
| 40 | + |
| 41 | + # Zephyr SDK relies on python 3.12 |
| 42 | + apt install software-properties-common -y |
| 43 | + add-apt-repository ppa:deadsnakes/ppa -y |
| 44 | + apt update |
| 45 | + apt install -y python3.12 python3.12-dev python3.12-venv python3-pip |
| 46 | + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 |
| 47 | + |
| 48 | + # Upgrade cmake ot 3.24 |
| 49 | + apt update |
| 50 | + apt install cmake |
| 51 | + apt install software-properties-common lsb-release |
| 52 | + apt update |
| 53 | + test -f /usr/share/doc/kitware-archive-keyring/copyright || \ |
| 54 | + wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null |
| 55 | + "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/kitware.list > /dev/null |
| 56 | + apt update |
| 57 | + apt install cmake |
| 58 | + |
| 59 | + # Install additional required software for Zephyr |
| 60 | + apt install --no-install-recommends -y ccache \ |
| 61 | + dfu-util \ |
| 62 | + python3-setuptools \ |
| 63 | + python3-tk \ |
| 64 | + python3-wheel \ |
| 65 | + make \ |
| 66 | + gcc \ |
| 67 | + libsdl2-dev \ |
| 68 | + libmagic1 \ |
| 69 | + xterm \ |
| 70 | + telnet \ |
| 71 | + net-tools |
| 72 | +} |
| 73 | + |
| 74 | +install_prerequiresites |
0 commit comments