From 2ea63b4194b318ce2261af10229885eff337d59d Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 22 Jan 2023 17:56:28 +0100 Subject: [PATCH] Create 30-graphic_drivers.sh --- .../etc/cont-init.d/30-graphic_drivers.sh | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 photoprism/rootfs/etc/cont-init.d/30-graphic_drivers.sh diff --git a/photoprism/rootfs/etc/cont-init.d/30-graphic_drivers.sh b/photoprism/rootfs/etc/cont-init.d/30-graphic_drivers.sh new file mode 100644 index 000000000..0067de8e5 --- /dev/null +++ b/photoprism/rootfs/etc/cont-init.d/30-graphic_drivers.sh @@ -0,0 +1,36 @@ +#!/usr/bin/with-contenv bashio +# shellcheck shell=bash +# shellcheck disable=SC2015 + +if bashio::config.has_value 'graphic_drivers'; then + GRAPHIC_DRIVERS="$(bashio::config 'graphic_drivers')" + bashio::log.info "Installing selected graphic drivers : $GRAPHIC_DRIVERS..." + + ### Download WebUI + case "$GRAPHIC_DRIVERS" in + + "mesa") + apt-get update + apt-get install -yqq *mesa* >/dev/null + echo "... done" + ;; + + "nvidia") + apt-get update + apt-get install -yqq *nvidia* >/dev/null + echo "... done" + ;; + + "radeon") + apt-get update + apt-get install -yqq *radeon* >/dev/null + echo "... done" + ;; + + *) + exit 0 + echo "... no drivers selected" + ;; + + esac +fi