forked from thesofproject/sof-bin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·48 lines (39 loc) · 868 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
·48 lines (39 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
set -e
# Default values, override on the command line
: "${FW_DEST:=/lib/firmware/intel}"
: "${TOOLS_DEST:=/usr/local/bin}"
usage()
{
cat <<EOF
Usage:
sudo $0 v1.7
EOF
exit 1
}
main()
{
test "$#" -eq 1 || usage
local ver="$1"
# Do this first so we can fail immediately and not leave a
# half-install behind
set -x
for sdir in sof sof-tplg; do
ln -s "$sdir-$ver" "${FW_DEST}/$sdir" || {
set +x
die '%s already installed? (Re)move it first.\n' "${FW_DEST}/$sdir"
}
done
# Trailing slash in srcdir/ ~= srcdir/*
rsync -a sof*"$ver" "${FW_DEST}"/
rsync -a tools-"$ver"/ "${TOOLS_DEST}"/
}
die()
{
>&2 printf '%s ERROR: ' "$0"
# We want die() to be usable exactly like printf
# shellcheck disable=SC2059
>&2 printf "$@"
exit 1
}
main "$@"