Repository navigation
Expand file tree
/
Copy pathinstall
More file actions
executable file
·87 lines (71 loc) · 3.04 KB
/
Copy pathinstall
File metadata and controls
executable file
·87 lines (71 loc) · 3.04 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
#!/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)
# - Compute Module 4 (e.g., Voyager 3)
if ! grep --quiet \
--regexp '^Model\s*: Raspberry Pi 4 Model B' \
--regexp '^Model\s*: Raspberry Pi Compute Module 4' \
/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 32-bit / non-64-bit operating systems.
# Note: the distro ID for 64-bit Raspberry Pi OS is called "Debian"; for the
# 32-bit version, it would say "Raspbian".
if [[ "$(uname --machine)" != "aarch64" || "$(lsb_release --id --short)" != 'Debian' ]]; then
echo "TinyPilot currently only supports the 64-bit version of Raspberry Pi OS 13 \"Trixie\"." >&2
echo "To install TinyPilot, you'll need Raspberry Pi OS 13 \"Trixie\" (64-bit)." >&2
exit 1
fi
# Prevent installation on OS versions lower than Raspberry Pi OS 13 "Trixie".
if (( "$(lsb_release --release --short)" < 13 )); then
echo "TinyPilot no longer supports Raspberry Pi OS 11 \"Bullseye\" or lower." >&2
echo "To install TinyPilot, you'll need to upgrade your operating system to Raspberry Pi OS 13 \"Trixie\" (64-bit)." >&2
exit 1
fi
# Prevent installation on Raspberry Pi OS 13+.
if (( "$(lsb_release --release --short)" > 13 )); then
echo "TinyPilot is not compatible with Raspberry Pi OS greater than version 13 \"Trixie\"." >&2
echo "To install TinyPilot, you'll need to downgrade your operating system to Raspberry Pi OS 13 \"Trixie\" (64-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