xref: /aosp_15_r20/external/executorch/.ci/docker/common/install_base.sh (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1#!/bin/bash
2# Copyright (c) Meta Platforms, Inc. and affiliates.
3# All rights reserved.
4#
5# This source code is licensed under the BSD-style license found in the
6# LICENSE file in the root directory of this source tree.
7
8set -ex
9
10install_ubuntu() {
11  apt-get update
12
13  apt-get install -y --no-install-recommends \
14    build-essential \
15    ca-certificates \
16    curl \
17    git \
18    wget \
19    sudo \
20    vim \
21    jq \
22    vim \
23    unzip \
24    gdb \
25    rsync \
26    libssl-dev \
27    zip
28
29  # Cleanup package manager
30  apt-get autoclean && apt-get clean
31  rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
32}
33
34# Install base packages depending on the base OS
35ID=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
36case "$ID" in
37  ubuntu)
38    install_ubuntu
39    ;;
40  *)
41    echo "Unable to determine OS..."
42    exit 1
43    ;;
44esac
45