firmware-open/scripts/install-deps.sh

105 lines
2 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-only
set -eE
function msg {
echo -e "\x1B[1m$*\x1B[0m" >&2
}
trap 'msg "\x1B[31mFailed to install dependencies!"' ERR
source /etc/os-release
msg "Installing system build dependencies"
if [[ "${ID}" =~ "debian" ]] || [[ "${ID_LIKE}" =~ "debian" ]]; then
sudo apt-get --quiet update
sudo apt-get --quiet install \
--no-install-recommends \
--assume-yes \
build-essential \
ccache \
cmake \
2020-06-18 14:22:24 -06:00
curl \
devmem2 \
2020-06-18 14:22:24 -06:00
dosfstools \
flashrom \
git-lfs \
libncurses-dev \
libudev-dev \
msr-tools \
mtools \
parted \
python-is-python3 \
2019-10-10 21:15:03 -06:00
python3-distutils \
uuid-dev \
zlib1g-dev
elif [[ "${ID}" =~ "fedora" ]] || [[ "${ID_LIKE}" =~ "fedora" ]]; then
2020-06-18 14:22:24 -06:00
sudo dnf group install c-development
sudo dnf install \
--assumeyes \
2021-05-13 10:10:04 -06:00
ccache \
cmake \
2020-06-18 14:22:24 -06:00
curl \
dosfstools \
flashrom \
2020-06-18 14:22:24 -06:00
git-lfs \
libuuid-devel \
msr-tools \
2020-06-18 14:22:24 -06:00
mtools \
ncurses-devel \
parted \
2020-06-18 14:22:24 -06:00
patch \
python-unversioned-command \
python3 \
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
sudo pacman -S \
2023-04-24 13:01:07 -04:00
--noconfirm \
2021-05-13 10:10:04 -06:00
ccache \
cmake \
2021-03-26 22:56:19 +01:00
curl \
dosfstools \
flashrom \
git-lfs \
msr-tools \
mtools \
ncurses \
2021-03-26 22:56:19 +01:00
parted \
patch \
python \
python-distutils-extra \
systemd-libs
else
msg "Unknown system ID: ${ID}"
msg "Please add support for your distribution to: $0"
exit 1
fi
# Don't run on Jenkins
if [ -z "${CI}" ]; then
msg "Installing GIT LFS hooks"
git lfs install
msg "Downloading GIT LFS artifacts"
git lfs pull
fi
msg "Initializing submodules"
git submodule update --init --recursive --checkout --progress
msg "Building coreboot toolchains"
./scripts/coreboot-sdk.sh
msg "Installing Rust toolchain and components"
./scripts/install-rust.sh
msg "Installing EC dependencies"
pushd ec
./scripts/deps.sh
popd
msg "\x1B[32mSuccessfully installed dependencies"
echo "Ready to run ./scripts/build.sh [model]" >&2