WiFi Detection, vainfo & Java JRE

- Implemented multi-layered WiFi detection logic in `utils.sh`. Added PCI class text grep, exact `lspci -d ::0280` matching for wireless devices, Broadcom vendor ID fallback (`14e4`), and USB discovery via `lsusb`. Improved `sysinfo.sh` fallback message to guide users toward the Firmware option.
- Added `_pause()` execution after `vainfo` outputs in `gpu/_helpers.sh` (`offer_generic_tools`) and `gpu/amd_intel.sh` (`offer_amd_tools`, `offer_intel_tools`). Ensures users can review hardware info before proceeding with tool installation.
- Refactored Java selection in `extras/java.sh`. Switched from single-option `--menu` to multi-select `--checklist`, enabling simultaneous Temurin JRE installations with all versions enabled by default and iterative installation logic.
This commit is contained in:
stornic56
2026-06-28 11:48:48 -05:00
committed by GitHub
parent 8d1a05e3e0
commit 110d89baf8
5 changed files with 34 additions and 12 deletions
+13 -9
View File
@@ -14,17 +14,21 @@ _enable_temurin_repo() {
} }
install_minecraft_java() { install_minecraft_java() {
local ver local choices
ver=$(whiptail --title "Java Runtimes for Minecraft" --menu \ choices=$(whiptail --title "Java Runtimes for Minecraft" --checklist \
"Select Java version:" 12 65 3 \ "Select Java version(s) to install:" 14 65 3 \
"8" "Java 8 — Classic mods & Minecraft <= 1.16.5" \ "8" "Java 8 — Classic mods & Minecraft <= 1.16.5" ON \
"17" "Java 17 — Minecraft 1.17 to 1.20.4" \ "17" "Java 17 — Minecraft 1.17 to 1.20.4" ON \
"21" "Java 21 — Modern Minecraft >= 1.20.5 & 1.21+" \ "21" "Java 21 — Modern Minecraft >= 1.20.5 & 1.21+" ON \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
[ -z "$ver" ] && { echo "No Java version selected."; return; } [ -z "$choices" ] && { echo "No Java version selected."; return; }
_enable_temurin_repo _enable_temurin_repo
_run_cmd "Java" "sudo apt install -y temurin-${ver}-jre" \ local cleaned
"Installing Temurin JRE ${ver}..." cleaned=$(echo "$choices" | tr -d '"')
for ver in $cleaned; do
_run_cmd "Java" "sudo apt install -y temurin-${ver}-jre" \
"Installing Temurin JRE ${ver}..."
done
} }
_install_dev_java() { _install_dev_java() {
+1
View File
@@ -190,6 +190,7 @@ offer_generic_tools() {
if _confirm "GPU Tools" "Install monitoring and info tools?\n\n${tool_pkgs}"; then if _confirm "GPU Tools" "Install monitoring and info tools?\n\n${tool_pkgs}"; then
_run_cmd "GPU Tools" "sudo apt install -y nvtop vainfo" "Installing GPU tools..." _run_cmd "GPU Tools" "sudo apt install -y nvtop vainfo" "Installing GPU tools..."
vainfo vainfo
_pause
else else
echo "Skipping GPU monitoring tools." echo "Skipping GPU monitoring tools."
fi fi
+2
View File
@@ -42,6 +42,7 @@ offer_amd_tools() {
_run_cmd "AMD Tools" "sudo apt install -y ${amd_tools[*]} nvtop vainfo" "Installing AMD tools..." _run_cmd "AMD Tools" "sudo apt install -y ${amd_tools[*]} nvtop vainfo" "Installing AMD tools..."
fi fi
vainfo vainfo
_pause
if $corectrl_available; then if $corectrl_available; then
if [ "$DEBIAN_CODENAME" = "trixie" ]; then if [ "$DEBIAN_CODENAME" = "trixie" ]; then
@@ -108,6 +109,7 @@ offer_intel_tools() {
if _confirm "Intel Tools" "Intel GPU monitoring tools\n\n${driver_info}\n\nPackages:\n${pkg_info}"; then if _confirm "Intel Tools" "Intel GPU monitoring tools\n\n${driver_info}\n\nPackages:\n${pkg_info}"; then
_run_cmd "Intel Tools" "sudo apt install -y ${pkg_list[*]} vainfo" "Installing Intel monitoring tools..." _run_cmd "Intel Tools" "sudo apt install -y ${pkg_list[*]} vainfo" "Installing Intel monitoring tools..."
vainfo vainfo
_pause
else else
echo "Skipping Intel monitoring tools." echo "Skipping Intel monitoring tools."
fi fi
+1 -1
View File
@@ -87,7 +87,7 @@ _show_sysinfo() {
if ! $found_active_wifi && [ -n "$WIFI_DESC" ]; then if ! $found_active_wifi && [ -n "$WIFI_DESC" ]; then
has_network=true has_network=true
msg+="WiFi: ${WIFI_DESC}\n" msg+="WiFi: ${WIFI_DESC}\n"
msg+=" (no driver — install firmware)\n" msg+=" (no driver — use Firmware option in main menu)\n"
fi fi
if ! $has_network; then if ! $has_network; then
+17 -2
View File
@@ -283,14 +283,29 @@ detect_network() {
fi fi
local wifi_line local wifi_line
wifi_line=$(lspci -nn | grep -iE 'network controller|wireless|wi-fi|wlan|802\.11' | head -n1) || true # Layer 1: grep by PCI class description text
wifi_line=$(lspci -nn 2>/dev/null | grep -iE 'network controller|wireless|wi-fi|wlan|802\.11' | head -n1) || true
# Layer 2: grep by exact PCI class code 0x0280 (Network controller)
if [ -z "$wifi_line" ]; then if [ -z "$wifi_line" ]; then
wifi_line=$(lspci -nn | grep -i '14e4:' | head -n1) || true wifi_line=$(lspci -d ::0280 2>/dev/null | head -n1) || true
fi
# Layer 3: Broadcom vendor ID fallback (14e4)
if [ -z "$wifi_line" ]; then
wifi_line=$(lspci -nn 2>/dev/null | grep -i '14e4:' | head -n1) || true
fi fi
if [ -n "$wifi_line" ]; then if [ -n "$wifi_line" ]; then
WIFI_CHIPSET="$wifi_line" WIFI_CHIPSET="$wifi_line"
WIFI_DESC=$(echo "$wifi_line" | sed -E 's/^.*\]: //; s/ \[[0-9a-fA-F]{4}:[0-9a-fA-F]{4}\]//; s/ \(rev [0-9a-fA-F]+\)//') WIFI_DESC=$(echo "$wifi_line" | sed -E 's/^.*\]: //; s/ \[[0-9a-fA-F]{4}:[0-9a-fA-F]{4}\]//; s/ \(rev [0-9a-fA-F]+\)//')
fi fi
# Layer 4: USB WiFi adapter (no PCI device)
if [ -z "$wifi_line" ] && command -v lsusb &>/dev/null; then
local usb_wifi
usb_wifi=$(lsusb 2>/dev/null | grep -iE 'wireless|wifi|wlan|802\.11' | head -n1) || true
if [ -n "$usb_wifi" ]; then
WIFI_CHIPSET="$usb_wifi"
WIFI_DESC=$(echo "$usb_wifi" | sed 's/^.*ID //')
fi
fi
# ── Safeguard: if ip is not installed, skip runtime parsing ── # ── Safeguard: if ip is not installed, skip runtime parsing ──
if ! command -v ip &>/dev/null; then if ! command -v ip &>/dev/null; then