diff --git a/scripts/tools/gpu-intel.func b/scripts/tools/gpu-intel.func index 1df8a31..791d8c2 100644 --- a/scripts/tools/gpu-intel.func +++ b/scripts/tools/gpu-intel.func @@ -55,14 +55,14 @@ function passthrough_intel_to_lxc() { function install_intel_tools_in_ct() { local ctid="$1" + local install_nonfree="$2" if is_alpine_ct "$ctid"; then msg warn "Skipping Intel tool install for Alpine CT $ctid" return 0 fi - read -rp "Install non-free intel-media-va-driver (Debian only)? [y/N]: " confirm - if [[ "${confirm,,}" =~ ^(y|yes)$ ]]; then + if [[ "$install_nonfree" == "yes" ]]; then msg info "Enabling non-free sources in $ctid..." pct exec "$ctid" -- bash -c "tee /etc/apt/sources.list.d/non-free.list >/dev/null" <<'EOF' deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware diff --git a/scripts/tools/hw-acceleration.sh b/scripts/tools/hw-acceleration.sh index 886c514..25a13bd 100644 --- a/scripts/tools/hw-acceleration.sh +++ b/scripts/tools/hw-acceleration.sh @@ -103,6 +103,14 @@ function main() { local updated_cts=() + local intel_nonfree="no" + if [[ " ${SELECTED_FEATURES[*]} " =~ " intel " ]]; then + read -rp "Install non-free intel-media-va-driver (Debian only)? [y/N]: " confirm + if [[ "${confirm,,}" =~ ^(y|yes)$ ]]; then + intel_nonfree="yes" + fi + fi + for ctid in $SELECTED_CTIDS; do local conf="/etc/pve/lxc/${ctid}.conf" local updated=0 @@ -115,7 +123,7 @@ function main() { ;; intel) msg info "Intel passthrough setup for CT $ctid" - passthrough_intel_to_lxc "$ctid" && install_intel_tools_in_ct "$ctid" && updated=1 + passthrough_intel_to_lxc "$ctid" && install_intel_tools_in_ct "$ctid" "$intel_nonfree" && updated=1 ;; nvidia) msg info "Validating NVIDIA setup..."