2019-09-11 17:43:59 -06:00
|
|
|
#!/usr/bin/env bash
|
2023-08-30 10:54:12 -06:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-only
|
2019-09-11 17:43:59 -06:00
|
|
|
|
2023-10-13 21:53:41 -06:00
|
|
|
# shellcheck disable=SC1091
|
|
|
|
|
2019-09-11 17:43:59 -06:00
|
|
|
set -eE
|
|
|
|
|
2023-10-13 21:53:41 -06:00
|
|
|
msg() {
|
2019-09-11 17:43:59 -06:00
|
|
|
echo -e "\x1B[1m$*\x1B[0m" >&2
|
|
|
|
}
|
|
|
|
|
|
|
|
trap 'msg "\x1B[31mFailed to install dependencies!"' ERR
|
|
|
|
|
2023-10-13 21:53:41 -06:00
|
|
|
. /etc/os-release
|
2021-02-22 00:17:28 -05:00
|
|
|
|
2021-02-22 15:10:43 -07:00
|
|
|
msg "Installing system build dependencies"
|
2021-02-22 00:17:28 -05:00
|
|
|
if [[ "${ID}" =~ "debian" ]] || [[ "${ID_LIKE}" =~ "debian" ]]; then
|
2022-08-29 12:55:07 -06:00
|
|
|
sudo apt-get --quiet update
|
|
|
|
sudo apt-get --quiet install \
|
|
|
|
--no-install-recommends \
|
|
|
|
--assume-yes \
|
2020-11-11 15:10:04 -07:00
|
|
|
build-essential \
|
2019-09-11 17:43:59 -06:00
|
|
|
ccache \
|
2020-11-11 15:10:04 -07:00
|
|
|
cmake \
|
2020-06-18 14:22:24 -06:00
|
|
|
curl \
|
|
|
|
dosfstools \
|
2020-08-04 21:49:14 -06:00
|
|
|
flashrom \
|
2019-09-11 17:43:59 -06:00
|
|
|
git-lfs \
|
2020-08-04 21:49:14 -06:00
|
|
|
libncurses-dev \
|
2024-04-17 11:40:51 -06:00
|
|
|
libssl-dev \
|
2020-10-15 10:50:39 +02:00
|
|
|
libudev-dev \
|
2019-09-11 17:43:59 -06:00
|
|
|
mtools \
|
2020-08-04 21:49:14 -06:00
|
|
|
parted \
|
2024-04-17 11:40:51 -06:00
|
|
|
pkgconf \
|
2021-09-13 16:08:41 -06:00
|
|
|
python-is-python3 \
|
2019-10-10 21:15:03 -06:00
|
|
|
python3-distutils \
|
2019-09-11 17:43:59 -06:00
|
|
|
uuid-dev \
|
|
|
|
zlib1g-dev
|
2021-02-22 00:17:28 -05:00
|
|
|
elif [[ "${ID}" =~ "fedora" ]] || [[ "${ID_LIKE}" =~ "fedora" ]]; then
|
2020-06-18 14:22:24 -06:00
|
|
|
sudo dnf group install c-development
|
|
|
|
sudo dnf install \
|
2022-08-29 12:55:07 -06:00
|
|
|
--assumeyes \
|
2021-05-13 10:10:04 -06:00
|
|
|
ccache \
|
2020-11-11 15:10:04 -07:00
|
|
|
cmake \
|
2020-06-18 14:22:24 -06:00
|
|
|
curl \
|
|
|
|
dosfstools \
|
2020-08-04 21:49:14 -06:00
|
|
|
flashrom \
|
2020-06-18 14:22:24 -06:00
|
|
|
git-lfs \
|
|
|
|
libuuid-devel \
|
|
|
|
mtools \
|
2020-08-04 21:49:14 -06:00
|
|
|
ncurses-devel \
|
2024-04-17 11:40:51 -06:00
|
|
|
openssl-devel \
|
2020-08-04 21:49:14 -06:00
|
|
|
parted \
|
2020-06-18 14:22:24 -06:00
|
|
|
patch \
|
2021-09-29 08:10:27 -06:00
|
|
|
python-unversioned-command \
|
|
|
|
python3 \
|
2020-10-15 16:08:11 +02:00
|
|
|
systemd-devel \
|
2020-06-18 14:22:24 -06:00
|
|
|
zlib-devel
|
2021-03-26 22:56:19 +01:00
|
|
|
elif [[ "${ID}" =~ "arch" ]] || [[ "${ID_LIKE}" =~ "arch" ]]; then
|
2021-05-12 17:25:17 -06:00
|
|
|
sudo pacman -S \
|
2023-04-24 13:01:07 -04:00
|
|
|
--noconfirm \
|
2021-05-13 10:10:04 -06:00
|
|
|
ccache \
|
2021-05-12 17:25:17 -06:00
|
|
|
cmake \
|
2021-03-26 22:56:19 +01:00
|
|
|
curl \
|
|
|
|
dosfstools \
|
|
|
|
flashrom \
|
|
|
|
git-lfs \
|
|
|
|
mtools \
|
2021-05-12 17:25:17 -06:00
|
|
|
ncurses \
|
2021-03-26 22:56:19 +01:00
|
|
|
parted \
|
|
|
|
patch \
|
2021-05-12 17:25:17 -06:00
|
|
|
python \
|
|
|
|
python-distutils-extra \
|
2022-05-25 09:20:46 -06:00
|
|
|
systemd-libs
|
2019-09-11 17:43:59 -06:00
|
|
|
else
|
2021-02-22 15:10:43 -07:00
|
|
|
msg "Unknown system ID: ${ID}"
|
|
|
|
msg "Please add support for your distribution to: $0"
|
2019-09-11 17:43:59 -06:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-08-14 11:07:52 -06:00
|
|
|
# Don't run on Jenkins
|
|
|
|
if [ -z "${CI}" ]; then
|
|
|
|
msg "Installing GIT LFS hooks"
|
|
|
|
git lfs install
|
2019-09-11 17:43:59 -06:00
|
|
|
|
2023-08-14 11:07:52 -06:00
|
|
|
msg "Downloading GIT LFS artifacts"
|
|
|
|
git lfs pull
|
|
|
|
fi
|
2019-09-11 17:43:59 -06:00
|
|
|
|
2020-08-04 21:49:14 -06:00
|
|
|
msg "Initializing submodules"
|
2023-05-23 07:26:01 -06:00
|
|
|
git submodule update --init --recursive --checkout --progress
|
2020-08-04 21:49:14 -06:00
|
|
|
|
2023-10-13 20:13:36 -06:00
|
|
|
msg "Building coreboot toolchains"
|
|
|
|
./scripts/coreboot-sdk.sh
|
2020-08-04 21:49:14 -06:00
|
|
|
|
2023-08-30 10:54:12 -06:00
|
|
|
msg "Installing Rust toolchain and components"
|
|
|
|
./scripts/install-rust.sh
|
2019-09-11 17:43:59 -06:00
|
|
|
|
2022-05-25 09:20:46 -06:00
|
|
|
msg "Installing EC dependencies"
|
|
|
|
pushd ec
|
|
|
|
./scripts/deps.sh
|
|
|
|
popd
|
|
|
|
|
2019-09-11 17:43:59 -06:00
|
|
|
msg "\x1B[32mSuccessfully installed dependencies"
|
|
|
|
echo "Ready to run ./scripts/build.sh [model]" >&2
|