From 0abcdad78edfecbf9d2c5dc97b50e5fbfbc902c2 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 27 Mar 2022 08:22:36 +0200 Subject: [PATCH] Create 99-video_drivers.sh --- .../etc/cont-init.d/99-video_drivers.sh | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 jellyfin/rootfs/etc/cont-init.d/99-video_drivers.sh diff --git a/jellyfin/rootfs/etc/cont-init.d/99-video_drivers.sh b/jellyfin/rootfs/etc/cont-init.d/99-video_drivers.sh new file mode 100644 index 000000000..ecb68ff7d --- /dev/null +++ b/jellyfin/rootfs/etc/cont-init.d/99-video_drivers.sh @@ -0,0 +1,45 @@ +#!/usr/bin/with-contenv bashio + +exit 0 + +# Determine if setup is needed +if [ ! -f "/usr/bin/apt" ]; then + echo "**** Image is not Ubuntu, skipping drivers install ****" + exit 0 +fi + +bashio::log.info "Installing graphic drivers" + +#Add source +if [ ! -f "/etc/apt/sources.list.d/kisak-mesa-focal.list" ]; then + echo "**** Adding kisak-mesa repo ****" + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F63F0F2B90935439 + echo "deb http://ppa.launchpad.net/kisak/kisak-mesa/ubuntu focal main" > /etc/apt/sources.list.d/kisak-mesa-focal.list +fi + +if [ $(uname -m) = "x86_64" ]; then + apt-get install -y clinfo + if [ -d /opencl-intel ]; then + echo "**** Installing/updating opencl-intel debs ****" + pkgs='intel-opencl-icd' + else + echo "**** Installing/updating AMD drivers ****" + apt-get update >/dev/null + pkgs='mesa-vdpau-drivers mesa-va-drivers mesa-vdpau-drivers libdrm-radeon1' + fi +else + pkgs='libgles2-mesa libgles2-mesa-dev xorg-dev' +fi + + install=false + for pkg in $pkgs; do + status="$(dpkg-query -W --showformat='${db:Status-Status}' "$pkg" 2>&1)" + if [ ! $? = 0 ] || [ ! "$status" = installed ]; then + install=true + break + fi + done + if "$install"; then + apt-get install -y $pkgs + fi + fi