|
2 | 2 |
|
3 | 3 | set -euo pipefail |
4 | 4 |
|
| 5 | +# Defaults |
| 6 | +SKIP_RISCV=${SKIP_RISCV-0} |
| 7 | +if git clone https://git.savannah.nongnu.org/git/git2cl.git; then |
| 8 | + SKIP_OPENOCD=${SKIP_OPENOCD-0} |
| 9 | +else |
| 10 | + # Clone is failing, so skip build |
| 11 | + echo "Skipping openocd build, as likely to fail" |
| 12 | + SKIP_OPENOCD=${SKIP_OPENOCD-1} |
| 13 | +fi |
| 14 | + |
5 | 15 | # Install prerequisites |
6 | 16 | sudo apt install -y jq cmake libtool automake libusb-1.0-0-dev libhidapi-dev libftdi1-dev |
7 | 17 | # Risc-V prerequisites |
@@ -36,7 +46,9 @@ if [[ "$SKIP_RISCV" != 1 ]]; then |
36 | 46 | # Takes ages to build |
37 | 47 | ../packages/linux/riscv/build-riscv-gcc.sh |
38 | 48 | fi |
39 | | -../packages/linux/openocd/build-openocd.sh |
| 49 | +if [[ "$SKIP_OPENOCD" != 1 ]]; then |
| 50 | + ../packages/linux/openocd/build-openocd.sh |
| 51 | +fi |
40 | 52 | ../packages/linux/picotool/build-picotool.sh |
41 | 53 | cd .. |
42 | 54 |
|
@@ -64,21 +76,23 @@ pushd "$builddir/picotool-install/" |
64 | 76 | tar -a -cf "$topd/bin/$filename" * .keep |
65 | 77 | popd |
66 | 78 |
|
67 | | -# Package OpenOCD separately as well |
| 79 | +if [[ "$SKIP_OPENOCD" != 1 ]]; then |
| 80 | + # Package OpenOCD separately as well |
68 | 81 |
|
69 | | -version=($("./$builddir/openocd-install/usr/local/bin/openocd" --version 2>&1)) |
70 | | -version=${version[0]} |
71 | | -version=${version[3]} |
72 | | -version=$(echo $version | cut -d "-" -f 1) |
| 82 | + version=($("./$builddir/openocd-install/usr/local/bin/openocd" --version 2>&1)) |
| 83 | + version=${version[0]} |
| 84 | + version=${version[3]} |
| 85 | + version=$(echo $version | cut -d "-" -f 1) |
73 | 86 |
|
74 | | -echo "OpenOCD version $version" |
| 87 | + echo "OpenOCD version $version" |
75 | 88 |
|
76 | | -filename="openocd-${version}-${suffix}.tar.gz" |
| 89 | + filename="openocd-${version}-${suffix}.tar.gz" |
77 | 90 |
|
78 | | -echo "Saving OpenOCD package to $filename" |
79 | | -pushd "$builddir/openocd-install/usr/local/bin" |
80 | | -tar -a -cf "$topd/bin/$filename" * -C "../share/openocd" "scripts" |
81 | | -popd |
| 91 | + echo "Saving OpenOCD package to $filename" |
| 92 | + pushd "$builddir/openocd-install/usr/local/bin" |
| 93 | + tar -a -cf "$topd/bin/$filename" * -C "../share/openocd" "scripts" |
| 94 | + popd |
| 95 | +fi |
82 | 96 |
|
83 | 97 | if [[ "$SKIP_RISCV" != 1 ]]; then |
84 | 98 | # Package riscv toolchain separately as well |
|
0 commit comments