Split building coreboot toolchains to a separate file
Specify dependencies specifically for building coreboot toolchains in the file, so they are not conflated with the dependencies required for building firmware-open. Remove building the toolchain when building firmware, so that the new script is the single source for building coreboot toolchains. Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
committed by
Jeremy Soller
parent
5fb1624187
commit
b379c94b76
@ -32,10 +32,6 @@ function check_configs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pushd coreboot >/dev/null
|
pushd coreboot >/dev/null
|
||||||
if [ ! -d util/crossgcc/xgcc ]
|
|
||||||
then
|
|
||||||
make CPUS="$(nproc)" crossgcc-i386
|
|
||||||
fi
|
|
||||||
make distclean
|
make distclean
|
||||||
make defconfig KBUILD_DEFCONFIG="${CONFIG}"
|
make defconfig KBUILD_DEFCONFIG="${CONFIG}"
|
||||||
check_configs "${CONFIG}"
|
check_configs "${CONFIG}"
|
||||||
|
63
scripts/coreboot-sdk.sh
Executable file
63
scripts/coreboot-sdk.sh
Executable file
@ -0,0 +1,63 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
|
# Build the coreboot toolchains
|
||||||
|
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
. /etc/os-release
|
||||||
|
if [ "$ID" = "arch" ] || [[ "$ID_LIKE" =~ "arch" ]]; then
|
||||||
|
sudo pacman -S --noconfirm \
|
||||||
|
bison \
|
||||||
|
bzip2 \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
flex \
|
||||||
|
gcc \
|
||||||
|
gcc-ada \
|
||||||
|
make \
|
||||||
|
patch \
|
||||||
|
tar \
|
||||||
|
xz \
|
||||||
|
zlib
|
||||||
|
elif [ "$ID" = "fedora" ] || [[ "$ID_LIKE" =~ "fedora" ]]; then
|
||||||
|
sudo dnf install --assumeyes \
|
||||||
|
bison \
|
||||||
|
bzip2 \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
flex \
|
||||||
|
gcc \
|
||||||
|
gcc-c++ \
|
||||||
|
gcc-gnat \
|
||||||
|
make \
|
||||||
|
patch \
|
||||||
|
tar \
|
||||||
|
xz \
|
||||||
|
zlib-devel
|
||||||
|
elif [ "$ID" = "ubuntu" ] || [[ "$ID_LIKE" =~ "debian" ]]; then
|
||||||
|
sudo apt-get --quiet update
|
||||||
|
sudo apt-get --quiet install --no-install-recommends --assume-yes \
|
||||||
|
bison \
|
||||||
|
bzip2 \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
flex \
|
||||||
|
g++ \
|
||||||
|
gcc \
|
||||||
|
gnat \
|
||||||
|
make \
|
||||||
|
patch \
|
||||||
|
tar \
|
||||||
|
xz-utils \
|
||||||
|
zlib1g-dev
|
||||||
|
else
|
||||||
|
printf "\e[1;31munsupported host:\e[0m %s\n" "$ID"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
make -C coreboot CPUS="$(nproc)" crossgcc-i386
|
||||||
|
make -C coreboot CPUS="$(nproc)" crossgcc-x64
|
||||||
|
make -C coreboot gitconfig
|
@ -11,14 +11,12 @@ trap 'msg "\x1B[31mFailed to install dependencies!"' ERR
|
|||||||
|
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
|
|
||||||
|
|
||||||
msg "Installing system build dependencies"
|
msg "Installing system build dependencies"
|
||||||
if [[ "${ID}" =~ "debian" ]] || [[ "${ID_LIKE}" =~ "debian" ]]; then
|
if [[ "${ID}" =~ "debian" ]] || [[ "${ID_LIKE}" =~ "debian" ]]; then
|
||||||
sudo apt-get --quiet update
|
sudo apt-get --quiet update
|
||||||
sudo apt-get --quiet install \
|
sudo apt-get --quiet install \
|
||||||
--no-install-recommends \
|
--no-install-recommends \
|
||||||
--assume-yes \
|
--assume-yes \
|
||||||
bison \
|
|
||||||
build-essential \
|
build-essential \
|
||||||
ccache \
|
ccache \
|
||||||
cmake \
|
cmake \
|
||||||
@ -26,9 +24,7 @@ if [[ "${ID}" =~ "debian" ]] || [[ "${ID_LIKE}" =~ "debian" ]]; then
|
|||||||
devmem2 \
|
devmem2 \
|
||||||
dosfstools \
|
dosfstools \
|
||||||
flashrom \
|
flashrom \
|
||||||
flex \
|
|
||||||
git-lfs \
|
git-lfs \
|
||||||
gnat \
|
|
||||||
libncurses-dev \
|
libncurses-dev \
|
||||||
libudev-dev \
|
libudev-dev \
|
||||||
msr-tools \
|
msr-tools \
|
||||||
@ -47,7 +43,6 @@ elif [[ "${ID}" =~ "fedora" ]] || [[ "${ID_LIKE}" =~ "fedora" ]]; then
|
|||||||
curl \
|
curl \
|
||||||
dosfstools \
|
dosfstools \
|
||||||
flashrom \
|
flashrom \
|
||||||
gcc-gnat \
|
|
||||||
git-lfs \
|
git-lfs \
|
||||||
libuuid-devel \
|
libuuid-devel \
|
||||||
msr-tools \
|
msr-tools \
|
||||||
@ -62,14 +57,11 @@ elif [[ "${ID}" =~ "fedora" ]] || [[ "${ID_LIKE}" =~ "fedora" ]]; then
|
|||||||
elif [[ "${ID}" =~ "arch" ]] || [[ "${ID_LIKE}" =~ "arch" ]]; then
|
elif [[ "${ID}" =~ "arch" ]] || [[ "${ID_LIKE}" =~ "arch" ]]; then
|
||||||
sudo pacman -S \
|
sudo pacman -S \
|
||||||
--noconfirm \
|
--noconfirm \
|
||||||
bison \
|
|
||||||
ccache \
|
ccache \
|
||||||
cmake \
|
cmake \
|
||||||
curl \
|
curl \
|
||||||
dosfstools \
|
dosfstools \
|
||||||
flashrom \
|
flashrom \
|
||||||
flex \
|
|
||||||
gcc-ada \
|
|
||||||
git-lfs \
|
git-lfs \
|
||||||
msr-tools \
|
msr-tools \
|
||||||
mtools \
|
mtools \
|
||||||
@ -97,10 +89,8 @@ fi
|
|||||||
msg "Initializing submodules"
|
msg "Initializing submodules"
|
||||||
git submodule update --init --recursive --checkout --progress
|
git submodule update --init --recursive --checkout --progress
|
||||||
|
|
||||||
msg "Installing coreboot commit hook"
|
msg "Building coreboot toolchains"
|
||||||
curl -sSf https://review.coreboot.org/tools/hooks/commit-msg \
|
./scripts/coreboot-sdk.sh
|
||||||
-o .git/modules/coreboot/hooks/commit-msg && \
|
|
||||||
chmod +x .git/modules/coreboot/hooks/commit-msg
|
|
||||||
|
|
||||||
msg "Installing Rust toolchain and components"
|
msg "Installing Rust toolchain and components"
|
||||||
./scripts/install-rust.sh
|
./scripts/install-rust.sh
|
||||||
@ -110,11 +100,5 @@ pushd ec
|
|||||||
./scripts/deps.sh
|
./scripts/deps.sh
|
||||||
popd
|
popd
|
||||||
|
|
||||||
msg "Building coreboot toolchains"
|
|
||||||
pushd coreboot
|
|
||||||
make CPUS="$(nproc)" crossgcc-i386
|
|
||||||
make CPUS="$(nproc)" crossgcc-x64
|
|
||||||
popd
|
|
||||||
|
|
||||||
msg "\x1B[32mSuccessfully installed dependencies"
|
msg "\x1B[32mSuccessfully installed dependencies"
|
||||||
echo "Ready to run ./scripts/build.sh [model]" >&2
|
echo "Ready to run ./scripts/build.sh [model]" >&2
|
||||||
|
Reference in New Issue
Block a user