-
-
Notifications
You must be signed in to change notification settings - Fork 255
/
install
executable file
·73 lines (59 loc) · 2.66 KB
/
install
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# Installs TinyPilot and all dependencies.
# Exit on first error.
set -e
# Exit on unset variable.
set -u
# Echo commands before executing them, by default to stderr.
set -x
# Prevent installation on the Raspberry Pi 3.
if grep -q "^Model *: Raspberry Pi 3" /proc/cpuinfo ; then
echo 'You are trying to install on incompatible hardware.' >&2
echo 'Visit https://github.com/tiny-pilot/tinypilot/ for more details.' >&2
exit 1
fi
# Prevent installation on OS versions lower than Raspberry Pi OS 11 "Bullseye".
# Note: the distro ID is called "Raspbian" because the 32-bit version of the
# Raspberry Pi operating system is based on Raspbian repos (an independent
# open-source project). Similarly, the the 64-bit version of the Raspberry Pi
# operating system is based on Debian and its distro ID would be "Debian".
if [[ "$(lsb_release --id --short)" == 'Raspbian' ]] \
&& (( "$(lsb_release --release --short)" < 11 )); then
echo "TinyPilot no longer supports Raspberry Pi OS 10 \"Buster\" or lower." >&2
echo "To install TinyPilot, you'll need to upgrade your operating system to Raspberry Pi OS 11 \"Bullseye\"." >&2
exit 1
fi
# Prevent installation on Raspberry Pi OS 12 "Bookworm".
if [[ "$(lsb_release --id --short)" == 'Raspbian' ]] \
&& (( "$(lsb_release --release --short)" > 11 )); then
echo "TinyPilot is not yet compatible with Raspberry Pi OS 12 \"Bookworm\"." >&2
echo "You can track our progress by visiting https://github.com/tiny-pilot/tinypilot/issues/1668" >&2
echo "To install TinyPilot, you'll need to downgrade your operating system to Raspberry Pi OS 11 \"Bullseye\"." >&2
exit 1
fi
# Abort installation if the read-only filesystem is enabled
if grep -q "boot=overlay" /proc/cmdline ; then
echo 'The read-only filesystem is enabled.' >&2
echo 'Disable the read-only filesystem before proceeding.' >&2
echo 'See https://tinypilotkvm.com/faq/read-only-filesystem for details.' >&2
exit 1
fi
# Get the filename of the Janus Debian package.
JANUS_DEBIAN_PACKAGE="$(ls janus*.deb)"
readonly JANUS_DEBIAN_PACKAGE
# Get the filename of the uStreamer Debian package.
USTREAMER_DEBIAN_PACKAGE="$(ls ustreamer*.deb)"
readonly USTREAMER_DEBIAN_PACKAGE
# Get the filename of the TinyPilot Debian package.
TINYPILOT_DEBIAN_PACKAGE="$(ls tinypilot*.deb)"
readonly TINYPILOT_DEBIAN_PACKAGE
# Update apt package index files, allowing the apt repos to change suite name.
# See https://github.com/tiny-pilot/tinypilot/issues/764
apt-get update --allow-releaseinfo-change-suite
apt-get install -y \
"./${JANUS_DEBIAN_PACKAGE}" \
"./${USTREAMER_DEBIAN_PACKAGE}" \
"./${TINYPILOT_DEBIAN_PACKAGE}"
# Install yq.
mv yq /usr/bin/yq
chmod 0755 /usr/bin/yq