2022-11-22 02:31:39 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
apt-get -qq update
|
|
|
|
|
|
|
|
apt-get -qq install --no-install-recommends -y \
|
|
|
|
apt-transport-https \
|
|
|
|
gnupg \
|
|
|
|
wget \
|
2022-11-29 02:24:20 +01:00
|
|
|
procps vainfo \
|
2022-11-22 02:31:39 +01:00
|
|
|
unzip locales tzdata libxml2 xz-utils \
|
2023-07-26 12:50:41 +02:00
|
|
|
python3.9 \
|
2023-01-19 00:23:40 +01:00
|
|
|
python3-pip \
|
|
|
|
curl \
|
2023-05-18 03:01:56 +02:00
|
|
|
jq \
|
|
|
|
nethogs
|
2022-11-22 02:31:39 +01:00
|
|
|
|
2023-07-26 12:50:41 +02:00
|
|
|
# ensure python3 defaults to python3.9
|
|
|
|
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
|
|
|
|
|
2022-12-09 13:39:02 +01:00
|
|
|
mkdir -p -m 600 /root/.gnupg
|
2022-11-22 02:31:39 +01:00
|
|
|
|
|
|
|
# add coral repo
|
2023-05-21 14:14:53 +02:00
|
|
|
curl -fsSLo - https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
|
|
|
|
gpg --dearmor -o /etc/apt/trusted.gpg.d/google-cloud-packages-archive-keyring.gpg
|
|
|
|
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | tee /etc/apt/sources.list.d/coral-edgetpu.list
|
2022-11-22 02:31:39 +01:00
|
|
|
echo "libedgetpu1-max libedgetpu/accepted-eula select true" | debconf-set-selections
|
|
|
|
|
2023-07-26 12:50:41 +02:00
|
|
|
# enable non-free repo in Debian
|
|
|
|
if grep -q "Debian" /etc/issue; then
|
|
|
|
sed -i -e's/ main/ main contrib non-free/g' /etc/apt/sources.list
|
|
|
|
fi
|
2022-11-22 02:31:39 +01:00
|
|
|
|
|
|
|
# coral drivers
|
|
|
|
apt-get -qq update
|
|
|
|
apt-get -qq install --no-install-recommends --no-install-suggests -y \
|
|
|
|
libedgetpu1-max python3-tflite-runtime python3-pycoral
|
|
|
|
|
2023-01-08 14:04:58 +01:00
|
|
|
# btbn-ffmpeg -> amd64
|
|
|
|
if [[ "${TARGETARCH}" == "amd64" ]]; then
|
2022-11-22 02:31:39 +01:00
|
|
|
mkdir -p /usr/lib/btbn-ffmpeg
|
2023-01-08 16:23:58 +01:00
|
|
|
wget -qO btbn-ffmpeg.tar.xz "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2022-07-31-12-37/ffmpeg-n5.1-2-g915ef932a3-linux64-gpl-5.1.tar.xz"
|
2022-11-22 02:31:39 +01:00
|
|
|
tar -xf btbn-ffmpeg.tar.xz -C /usr/lib/btbn-ffmpeg --strip-components 1
|
|
|
|
rm -rf btbn-ffmpeg.tar.xz /usr/lib/btbn-ffmpeg/doc /usr/lib/btbn-ffmpeg/bin/ffplay
|
|
|
|
fi
|
|
|
|
|
2023-01-08 14:04:58 +01:00
|
|
|
# ffmpeg -> arm64
|
|
|
|
if [[ "${TARGETARCH}" == "arm64" ]]; then
|
2023-07-23 23:45:29 +02:00
|
|
|
mkdir -p /usr/lib/btbn-ffmpeg
|
|
|
|
wget -qO btbn-ffmpeg.tar.xz "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2022-07-31-12-37/ffmpeg-n5.1-2-g915ef932a3-linuxarm64-gpl-5.1.tar.xz"
|
|
|
|
tar -xf btbn-ffmpeg.tar.xz -C /usr/lib/btbn-ffmpeg --strip-components 1
|
|
|
|
rm -rf btbn-ffmpeg.tar.xz /usr/lib/btbn-ffmpeg/doc /usr/lib/btbn-ffmpeg/bin/ffplay
|
2022-11-22 02:31:39 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# arch specific packages
|
|
|
|
if [[ "${TARGETARCH}" == "amd64" ]]; then
|
2023-10-17 13:37:40 +02:00
|
|
|
# use debian bookworm for hwaccel packages
|
2023-10-18 03:18:50 +02:00
|
|
|
echo 'deb https://deb.debian.org/debian bookworm main contrib non-free' >/etc/apt/sources.list.d/debian-bookworm.list
|
2023-09-29 01:20:48 +02:00
|
|
|
apt-get -qq update
|
2022-11-22 02:31:39 +01:00
|
|
|
apt-get -qq install --no-install-recommends --no-install-suggests -y \
|
2022-12-03 17:19:34 +01:00
|
|
|
intel-opencl-icd \
|
2023-10-17 13:37:40 +02:00
|
|
|
mesa-va-drivers radeontop libva-drm2 intel-media-va-driver-non-free i965-va-driver libmfx1 intel-gpu-tools
|
2023-02-11 16:57:15 +01:00
|
|
|
# something about this dependency requires it to be installed in a separate call rather than in the line above
|
|
|
|
apt-get -qq install --no-install-recommends --no-install-suggests -y \
|
|
|
|
i965-va-driver-shaders
|
2023-10-17 13:37:40 +02:00
|
|
|
rm -f /etc/apt/sources.list.d/debian-bookworm.list
|
2022-11-22 02:31:39 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${TARGETARCH}" == "arm64" ]]; then
|
|
|
|
apt-get -qq install --no-install-recommends --no-install-suggests -y \
|
|
|
|
libva-drm2 mesa-va-drivers
|
|
|
|
fi
|
|
|
|
|
2023-07-06 21:20:33 +02:00
|
|
|
apt-get purge gnupg apt-transport-https xz-utils -y
|
2022-11-22 02:31:39 +01:00
|
|
|
apt-get clean autoclean -y
|
|
|
|
apt-get autoremove --purge -y
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2023-04-23 18:35:40 +02:00
|
|
|
|
|
|
|
# Install yq, for frigate-prepare and go2rtc echo source
|
|
|
|
curl -fsSL \
|
|
|
|
"https://github.com/mikefarah/yq/releases/download/v4.33.3/yq_linux_$(dpkg --print-architecture)" \
|
|
|
|
--output /usr/local/bin/yq
|
|
|
|
chmod +x /usr/local/bin/yq
|