-
-
Notifications
You must be signed in to change notification settings - Fork 289
Expand file tree
/
Copy pathinstall
More file actions
executable file
·88 lines (72 loc) · 3.19 KB
/
install
File metadata and controls
executable file
·88 lines (72 loc) · 3.19 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/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
# 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
# Check if the user is forcing an install.
if [[ -n "${FORCE_INSTALL+x}" ]]; then
echo 'Forcing installation on unsupported setup.'
else
# Restrict installation to only specific configurations.
# Install only on supported hardware:
# - Raspberry Pi 4 Model B (e.g., Voyager 2)
if ! grep --quiet \
--regexp '^Model\s*: Raspberry Pi 4 Model B' \
/proc/cpuinfo; then
echo 'You are trying to install on unsupported hardware.' >&2
echo 'Visit https://github.com/tiny-pilot/tinypilot/ for more details.' >&2
exit 1
fi
# Prevent installation on 64-bit operating systems.
# 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' ]]; then
echo "TinyPilot currently only supports the 32-bit version of Raspberry Pi OS 11 \"Bullseye\"." >&2
echo "To install TinyPilot, you'll need Raspberry Pi OS 11 \"Bullseye\" (32-bit)." >&2
exit 1
fi
# Prevent installation on OS versions lower than Raspberry Pi OS 11 "Bullseye".
if (( "$(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\" (32-bit)." >&2
exit 1
fi
# Prevent installation on Raspberry Pi OS 12 "Bookworm".
if (( "$(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\" (32-bit)." >&2
exit 1
fi
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