Compare commits

..

1 Commits

Author SHA1 Message Date
9d8c18b489 -Fix AMD GPU firmware installation by adding non-free-firmware repository
- Add non-free-firmware repository for Debian before attempting to install firmware-amd-graphics
- Support both Debian Bookworm (12) and Trixie (13)/Sid
- Install firmware-amd-graphics for all AMD GPUs detected, not just APUs
- Improve error handling with warning message if firmware installation fails

Fixes #10177
2025-12-21 22:46:39 +01:00
3 changed files with 48 additions and 19 deletions

View File

@ -28,8 +28,6 @@ function update_script() {
exit
fi
JAVA_VERSION="21" setup_java
msg_info "Updating ${APP}"
$STD apt update --allow-releaseinfo-change
$STD apt install -y unifi

View File

@ -17,6 +17,7 @@ msg_info "Installing Dependencies"
$STD apt install -y apt-transport-https
msg_ok "Installed Dependencies"
JAVA_VERION="17" setup_java
setup_deb822_repo \
"unifi" \
"https://dl.ui.com/unifi/unifi-repo.gpg" \
@ -25,22 +26,17 @@ setup_deb822_repo \
"ubiquiti" \
"amd64"
JAVA_VERSION="21" setup_java
if lscpu | grep -q 'avx'; then
MONGO_VERSION="8.0" setup_mongodb
if ! grep -q -m1 'avx[^ ]*' /proc/cpuinfo; then
msg_warn "No AVX Support Detected. MongoDB v4.4 will be installed"
if ! dpkg -l | grep -q "libssl1.1"; then
curl -fsSL "https://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1w-0+deb11u4_amd64.deb" -o "libssl1.1_1.1.1w-0+deb11u4_amd64.deb"
$STD dpkg -i libssl1.1_1.1.1w-0+deb11u4_amd64.deb
fi
MONGO_VERSION="4.4" setup_mongodb
else
msg_error "No AVX detected (CPU-Flag)! We have discontinued support for this. You are welcome to try it manually with a Debian LXC, but due to the many issues with Unifi, we currently only support AVX CPUs."
exit 10
fi
if ! dpkg -l | grep -q 'libssl1.1'; then
msg_info "Installing libssl (if needed)"
curl -fsSL "https://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1w-0+deb11u4_amd64.deb" -o "/tmp/libssl.deb"
$STD dpkg -i /tmp/libssl.deb
rm -f /tmp/libssl.deb
msg_ok "Installed libssl1.1"
MONGO_VERSION="7.0" setup_mongodb
fi
msg_ok "Installed MongoDB"
msg_info "Installing UniFi Network Server"
$STD apt install -y unifi

View File

@ -2734,11 +2734,46 @@ EOF
return 1
}
# AMD firmware for better GPU support
# For AMD GPUs, firmware-amd-graphics is needed but requires non-free repositories
if [[ "$os_id" == "debian" ]]; then
$STD apt -y install firmware-amd-graphics 2>/dev/null || true
# Add non-free-firmware repository if not already present
if [[ ! -f /etc/apt/sources.list.d/non-free-firmware.sources ]]; then
if [[ "$os_codename" == "bookworm" ]]; then
cat <<EOF >/etc/apt/sources.list.d/non-free-firmware.sources
Types: deb
URIs: http://deb.debian.org/debian
Suites: bookworm bookworm-updates
Components: non-free-firmware
Types: deb
URIs: http://deb.debian.org/debian-security
Suites: bookworm-security
Components: non-free-firmware
EOF
elif [[ "$os_codename" == "trixie" || "$os_codename" == "sid" ]]; then
cat <<EOF >/etc/apt/sources.list.d/non-free-firmware.sources
Types: deb
URIs: http://deb.debian.org/debian
Suites: trixie trixie-updates
Components: non-free-firmware
Types: deb
URIs: http://deb.debian.org/debian-security
Suites: trixie-security
Components: non-free-firmware
EOF
fi
$STD apt update
fi
# Now install AMD firmware and libdrm
$STD apt -y install libdrm-amdgpu1 firmware-amd-graphics 2>/dev/null || {
msg_warn "Failed to install AMD firmware - may need manual installation"
}
else
# For non-Debian (Ubuntu, etc), try to install without adding repos
$STD apt -y install libdrm-amdgpu1 firmware-amd-graphics 2>/dev/null || true
fi
$STD apt -y install libdrm-amdgpu1 2>/dev/null || true
;;
NVIDIA)