Files
debianito-post-install/modules/extras/java.sh
T
stornic56 3e96906d6e firmware & wireless refactor + extrepo Migration
- Created standalone modules/bluetooth.sh  for `_install_bluetooth_stack()` with desktop-aware frontend selection (bluedevil/KDE, blueman/XFCE/other). Extracted from `firmware.sh`, reducing it from 438 to 369 lines.

- Added `detect_desktop_environment()` and `detect_audio_server()` functions in `utils.sh` with new globals `DESKTOP_ENV=""` and `AUDIO_SERVER=""`.

- New `found_active_wifi` flag detects Qualcomm Atheros AR9485 PCI chips without loaded firmware, displaying `(no driver — install firmware)` instead of silently disappearing. Auto-installs `firmware-atheros + firmware-linux-nonfree` after Firmware & Wireless Setup.

- New `is_nvidia_blackwell()` detects GPUs in ranges `0x2900–0x29BF` and `0x2B80–0x31FF`. Added `_enable_cuda_repo()` helper for extrepo-based CUDA installation with APT pinning. DKMS verification blocks added to all `_install_nvidia_*` functions.

- Standardized repository enablement across 7 modules using `_enable_*_repo()` helpers:
  - `internet.sh`: Firefox/Floorp/LibreWolf, Pale Moon, Tailscale, Mullvad VPN/Browser, ProtonVPN
  - `jellyfin.sh`, `programming.sh` (VSCodium), `java.sh` (Temurin)
  - New `extras/office/office.sh`: OnlyOffice + LibreOffice with language detection

- The main script was reduced from 233 to 137 lines. Created new `modules/sysinfo.sh` (97 lines) for `_show_sysinfo()`. Source chain: `utils.sh → sysinfo.sh → sudo_config.sh → repos → firmware.sh → bluetooth.sh → gpu.sh → kernel.sh → gaming.sh → extras.sh → zram.sh → java.sh`.

- Renamed menu to `"Firmware, Wireless & Bluetooth"`. Translated NTP dialog (English), basic programs install message, and NVIDIA 32-bit legacy messages.
2026-06-19 22:32:50 -05:00

51 lines
1.7 KiB
Bash

#!/usr/bin/env bash
# java.sh — Adoptium Temurin repository setup (extrepo) and Java version selectors
# License GPL v3
_enable_temurin_repo() {
if [ -f /etc/apt/sources.list.d/extrepo_temurin.sources ]; then
return 0
fi
if ! command -v extrepo &>/dev/null; then
_run_cmd "extrepo" "sudo apt install -y extrepo" "Installing extrepo..."
fi
_run_cmd "Temurin" "sudo extrepo enable temurin" "Enabling Adoptium Temurin repository..."
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
}
_install_gaming_java() {
local ver
ver=$(whiptail --title "Java Runtimes for Gaming" --menu \
"Select Java version:" 12 65 3 \
"8" "Java 8 — For classic mods & Minecraft <= 1.16.5" \
"17" "Java 17 — For Minecraft era 1.17 to 1.20.4" \
"21" "Java 21 — For modern Minecraft >= 1.20.5 & 1.21+" \
3>&1 1>&2 2>&3)
[ -z "$ver" ] && { echo "No Java version selected."; return; }
_enable_temurin_repo
_run_install "temurin-${ver}-jre"
}
_install_dev_java() {
local ver
ver=$(whiptail --title "Java Development Kits (JDK)" --menu \
"Select JDK version:" 12 60 3 \
"17" "Java 17 LTS Development Kit" \
"21" "Java 21 LTS Development Kit" \
"25" "Java 25 LTS Development Kit" \
3>&1 1>&2 2>&3)
[ -z "$ver" ] && { echo "No JDK version selected."; return; }
_enable_temurin_repo
_run_install "temurin-${ver}-jdk"
}
_any_jdk_installed_desc() {
local inst
inst=$(dpkg -l 'temurin-*-jdk' 2>/dev/null | awk '/^ii/ {print $2; exit}')
[ -n "$inst" ] && echo " ($inst installed)" || echo ""
}
_any_jdk_state() {
dpkg -l 'temurin-*-jdk' 2>/dev/null | grep -q '^ii' && echo "ON" || echo "OFF"
}