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