File tree Expand file tree Collapse file tree 4 files changed +37
-24
lines changed Expand file tree Collapse file tree 4 files changed +37
-24
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ pipeline {
7272
7373 sh """ #!/bin/bash
7474 # Install dependencies
75- #./scripts/deps.sh
75+ #./scripts/install- deps.sh
7676 . "${ HOME} /.cargo/env"
7777
7878 # Reset
Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ For a list of important changes please see the [changelog](./CHANGELOG.md).
3232
3333Dependencies can be installed with the provided script.
3434
35- ```
36- ./scripts/deps.sh
35+ ``` sh
36+ ./scripts/install- deps.sh
3737```
3838
3939If rustup was installed for the first time, it will be required to source the
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2+ # SPDX-License-Identifier: GPL-3.0-only
23
34set -eE
45
@@ -101,22 +102,8 @@ curl -sSf https://review.coreboot.org/tools/hooks/commit-msg \
101102 -o .git/modules/coreboot/hooks/commit-msg && \
102103 chmod +x .git/modules/coreboot/hooks/commit-msg
103104
104- RUSTUP_NEW_INSTALL=0
105- if which rustup & > /dev/null; then
106- msg " Updating rustup"
107- rustup self update
108- else
109- RUSTUP_NEW_INSTALL=1
110- msg " Installing Rust"
111- curl --proto ' =https' --tlsv1.2 -sSf https://sh.rustup.rs \
112- | sh -s -- -y --default-toolchain stable
113-
114- msg " Loading Rust environment"
115- source " ${HOME} /.cargo/env"
116- fi
117-
118- msg " Installing pinned Rust toolchain and components"
119- rustup show
105+ msg " Installing Rust toolchain and components"
106+ ./scripts/install-rust.sh
120107
121108msg " Installing EC dependencies"
122109pushd ec
@@ -129,10 +116,5 @@ make CPUS="$(nproc)" crossgcc-i386
129116make CPUS=" $( nproc) " crossgcc-x64
130117popd
131118
132- if [[ $RUSTUP_NEW_INSTALL = 1 ]]; then
133- msg " \x1B[33m>> rustup was just installed. Ensure cargo is on the PATH with:"
134- echo -e " source ~/.cargo/env\n"
135- fi
136-
137119msg " \x1B[32mSuccessfully installed dependencies"
138120echo " Ready to run ./scripts/build.sh [model]" >&2
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # SPDX-License-Identifier: GPL-3.0-only
3+
4+ # Install Rust via rustup, along with the pinned toolchain.
5+
6+ # shellcheck shell=dash
7+ # shellcheck disable=SC1091
8+
9+ set -Ee
10+
11+ RUSTUP_NEW_INSTALL=0
12+
13+ # NOTE: rustup is used to allow multiple toolchain installations.
14+ if command -v rustup > /dev/null 2>&1 ; then
15+ rustup self update
16+ else
17+ RUSTUP_NEW_INSTALL=1
18+ curl --proto ' =https' --tlsv1.2 -sSf https://sh.rustup.rs \
19+ | sh -s -- -y --default-toolchain stable
20+
21+ . " ${HOME} /.cargo/env"
22+ fi
23+
24+ # XXX: rustup has no command to install a toolchain from a TOML file.
25+ # Rely on the fact that `show` will install the default toolchain.
26+ rustup show
27+
28+ if [ " $RUSTUP_NEW_INSTALL " = " 1" ]; then
29+ printf " \e[33m>> rustup was just installed. Ensure cargo is on the PATH with:\e[0m\n"
30+ printf " source ~/.cargo/env\n\n"
31+ fi
You can’t perform that action at this time.
0 commit comments