File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
overlays/firmware-extended/20-system-utils/scripts Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -eo pipefail
4+
5+ ROOT_DIR=" $( realpath " $( dirname " $0 " ) /../../../.." ) "
6+
7+ if [[ $# -ne 1 ]]; then
8+ echo " Usage: $0 <rootfs-dir>"
9+ exit 1
10+ fi
11+
12+ echo " >> Installing latest curl from precompiled tarball"
13+
14+ TARGET_DIR=" $ROOT_DIR /tmp"
15+
16+ VERSION=8.17.0
17+ FILENAME=curl-linux-aarch64-glibc-$VERSION .tar.xz
18+ URL=https://github.com/stunnel/static-curl/releases/download/$VERSION /$FILENAME
19+ BIN_SHA256=fa8d1db2f1651d94cdb061ede60f20b895edd31439d8e2eb25383606117c7316
20+
21+ if [[ ! -f " $TARGET_DIR /$FILENAME " ]]; then
22+ echo " >> Downloading $FILENAME ..."
23+ wget -O " $TARGET_DIR /$FILENAME " " $URL "
24+ fi
25+
26+ echo " >> Extracting $FILENAME ..."
27+ mkdir -p " $1 /usr/local/bin"
28+ if ! tar -xJvf " $TARGET_DIR /$FILENAME " -C " $1 /usr/local/bin" curl; then
29+ echo " [!] Failed to extract curl from $FILENAME "
30+ exit 1
31+ fi
32+
33+ echo " >> Verifying /usr/local/bin/curl checksum..."
34+ echo " $BIN_SHA256 $1 /usr/local/bin/curl" | sha256sum --check --status
35+
36+ echo " >> Verifying if curl is executable..."
37+ if [[ ! -x " $1 /usr/local/bin/curl" ]]; then
38+ echo " [!] /usr/local/bin/curl is not executable."
39+ exit 1
40+ fi
41+
42+ echo " >> curl installed to $1 /usr/local/bin"
43+
You can’t perform that action at this time.
0 commit comments