mirror of
https://github.com/stornic56/debianito-post-install.git
synced 2026-07-16 05:49:49 +00:00
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:
+11
-7
@@ -14,17 +14,21 @@ _enable_temurin_repo() {
|
||||
}
|
||||
|
||||
install_minecraft_java() {
|
||||
local ver
|
||||
ver=$(whiptail --title "Java Runtimes for Minecraft" --menu \
|
||||
"Select Java version:" 12 65 3 \
|
||||
"8" "Java 8 — Classic mods & Minecraft <= 1.16.5" \
|
||||
"17" "Java 17 — Minecraft 1.17 to 1.20.4" \
|
||||
"21" "Java 21 — Modern Minecraft >= 1.20.5 & 1.21+" \
|
||||
local choices
|
||||
choices=$(whiptail --title "Java Runtimes for Minecraft" --checklist \
|
||||
"Select Java version(s) to install:" 14 65 3 \
|
||||
"8" "Java 8 — Classic mods & Minecraft <= 1.16.5" ON \
|
||||
"17" "Java 17 — Minecraft 1.17 to 1.20.4" ON \
|
||||
"21" "Java 21 — Modern Minecraft >= 1.20.5 & 1.21+" ON \
|
||||
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
|
||||
local cleaned
|
||||
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() {
|
||||
|
||||
@@ -190,6 +190,7 @@ offer_generic_tools() {
|
||||
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..."
|
||||
vainfo
|
||||
_pause
|
||||
else
|
||||
echo "Skipping GPU monitoring tools."
|
||||
fi
|
||||
|
||||
@@ -42,6 +42,7 @@ offer_amd_tools() {
|
||||
_run_cmd "AMD Tools" "sudo apt install -y ${amd_tools[*]} nvtop vainfo" "Installing AMD tools..."
|
||||
fi
|
||||
vainfo
|
||||
_pause
|
||||
|
||||
if $corectrl_available; 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
|
||||
_run_cmd "Intel Tools" "sudo apt install -y ${pkg_list[*]} vainfo" "Installing Intel monitoring tools..."
|
||||
vainfo
|
||||
_pause
|
||||
else
|
||||
echo "Skipping Intel monitoring tools."
|
||||
fi
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ _show_sysinfo() {
|
||||
if ! $found_active_wifi && [ -n "$WIFI_DESC" ]; then
|
||||
has_network=true
|
||||
msg+="WiFi: ${WIFI_DESC}\n"
|
||||
msg+=" (no driver — install firmware)\n"
|
||||
msg+=" (no driver — use Firmware option in main menu)\n"
|
||||
fi
|
||||
|
||||
if ! $has_network; then
|
||||
|
||||
+17
-2
@@ -283,14 +283,29 @@ detect_network() {
|
||||
fi
|
||||
|
||||
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
|
||||
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
|
||||
if [ -n "$wifi_line" ]; then
|
||||
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]+\)//')
|
||||
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 ──
|
||||
if ! command -v ip &>/dev/null; then
|
||||
|
||||
Reference in New Issue
Block a user