Files
stornic56 2708d6dcb5 add retroarch, nvidia - java - internet refactor
- NVIDIA CUDA extrepo refactor in `modules/gpu/nvidia.sh`: removed unnecessary `i386_active` lines, updated warning to reference `v590 (unified metapackage)`, simplified installation from 18+10 versioned packages → `nvidia-driver-pinning-590 nvidia-driver firmware-nvidia-gsp`, eliminated `apt-mark hold` since pinning packages now handle it. DKMS verification and `NVIDIA_DRIVER_MODE="cuda-repo"` preserved.
- CUDA repo case fix in `modules/gaming.sh`: replaced silent bypass with detection of `nvidia-driver-libs:i386` v590 installation; if missing, prompts user confirmation before installing via active CUDA repo + pinning.
- Palemoon internet module overhaul (`modules/extras/internet/internet.sh`): removed deprecated `_enable_palemoon_repo()`, created new `install_palemoon()` with AVX2→AVX→SSE2 CPU detection from `/proc/cpuinfo`, proper `extrepo enable` call, and package installation.
- ProtonVPN module rewrite (`modules/extras/internet/internet.sh`): removed broken `_enable_protonvpn_repo()` that failed due to missing suite; created new `install_protonvpn()` using `stable` suite + `proton-vpn-gtk-app` package with proper validation.
- Java/Minecraft rename across `modules/gaming.sh` and `modules/extras/java.sh`: renamed `_install_gaming_java()` → `install_minecraft_java()`, updated menu title from "Java Runtimes for Gaming" to "Java Runtimes for Minecraft", changed whiptail tag from `"java-jre"` to `"java"`.
- RetroArch + 4 classic cores (`modules/gaming/tools.sh` and `.sh`): added RetroArch entry to gaming menu, new case handler in `gaming.sh`, updated installation command to include `libretro-mgba libretro-snes9x libretro-nestopia libretro-gambatte`, enhanced notice with emojis, core enumeration, DFSG warning, and wiki link.
- OnlyOffice server status (`modules/extras/office/office.sh`): added fallback message for slow or down OnlyOffice servers to improve user experience during installation.
- Full syntax validation: all modified files pass `bash -n` without errors; no residual references to old variables (`i386_active`, `590.48.01`) or functions remain.
- Documentation about Debian and the script is added to supplement important information.
- update README.md
2026-06-20 21:54:59 -05:00

5.1 KiB

Option 1: Hardware Detection & System Information

1. What Does This Component Do?

This component serves as the System Abstraction Layer and diagnostic engine of the Debianito script. It is not merely a display utility; it acts as the foundational state initializer that runs prior to the main menu loop (main_menu). Its primary function is to perform pre-flight hardware enumeration, OS validation, and environment checks in "cold" mode (before any configuration changes are made).

By populating global variables such as DEBIAN_VERSION, GPU_TYPE, CPU_SUMMARY, and network interface states, it ensures that the subsequent menu options have access to accurate context. This prevents the user from making blind decisions—for example, attempting to install proprietary drivers on a system without detected hardware or selecting repositories incompatible with the current Debian codename. It transforms raw kernel data into actionable configuration parameters.

2. System Commands Used (Technical Mapping)

The following table details the native Linux tools and file descriptors utilized by utils.sh to extract specific diagnostic data points. This mapping demonstrates reliance on standard, non-intrusive system utilities rather than proprietary binaries.

Feature Command / Tool Technical Purpose & Logic
OS Version lsb_release -cs, /etc/os-release Parses VERSION_CODENAME to determine Debian release (Bullseye, Bookworm, Trixie). Critical for selecting correct repository backports.
CPU Info /proc/cpuinfo Reads model name and counts cores/threads. Provides cosmetic summary without needing heavy tools like lscpu.
Memory /proc/meminfo Extracts MemTotal to calculate RAM in GB. Used for compatibility warnings with specific software packages.
GPU Detection lspci -nn, nvidia-smi Identifies VGA/3D controllers via PCI IDs (10de for NVIDIA). Checks driver versions via dpkg if nvidia-smi fails.
Network (Eth) ip -o link show Enumerates Ethernet interfaces, state (UP/DOWN), and IP addresses using the iproute2 suite.
Network (Wi-Fi) iwgetid, lspci Identifies wireless chipsets via PCI and retrieves SSID/Connection status for network diagnostics.
Storage lsblk -d -o NAME,SIZE,ROTA Distinguishes between NVMe (nvme), SSD (RoT=0), and HDD (RoT=1) to provide storage topology summary.
Display Server Environment Vars (XDG_SESSION_TYPE) Checks WAYLAND_DISPLAY vs DISPLAY variables to determine if the system is running Wayland, X11, or TTY.

3. Strategic Importance for the Script

This diagnostic phase is vital for engineering stability and user experience (UX) integrity within the script architecture:

  • Context-Aware Configuration: The detection of HAS_NVIDIA, HAS_AMD, or HAS_INTEL directly dictates which sub-modules are loaded in debianito.sh. If no GPU is detected, graphics driver menus are skipped. This prevents "false positive" installation prompts that confuse the user.
  • Repository Compatibility Guardrails: The detect_debian_version function validates the OS against supported codenames (11, 12, 13). It specifically triggers Bullseye-specific logic (configure_repos_bullseye) only when necessary, preventing repository errors on newer or older distributions.
  • Time Synchronization Safety: The check_system_time function prevents package installation failures caused by clock skew (which breaks GPG signatures in APT). By offering an automated NTP sync before proceeding, it ensures the integrity of the entire software supply chain within the script.
  • Root/Sudo Enforcement: Early execution of check_root and check_sudo enforces security best practices. It prevents accidental privilege escalation or silent failures that often occur when scripts run with incorrect permissions.

4. Formatting and UX in the Terminal

The raw data collected by these functions is processed into a human-readable format before being passed to the TUI (Text User Interface) via whiptail.

  • Structured String Assembly: Functions like _show_sysinfo build multi-line strings (msg+="..."), appending newlines and conditional logic. This ensures that if multiple GPUs are found, they are listed sequentially with drivers identified below each entry.
  • Visual Hierarchy: The data is organized into logical blocks (OS, Hardware, GPU, Network) with clear separators (───). This allows the user to quickly scan specific subsystems without scrolling through a monolithic log.
  • Conditional Rendering: The script checks for command availability (e.g., if ! command -v ip &>/dev/null) before attempting to parse network data. If tools are missing, it gracefully degrades to a warning message rather than crashing the TUI.
  • TUI Integration: The final formatted string is passed to _msg, which wraps the output in a whiptail --msgbox. This ensures the diagnostic information appears as a modal dialog with consistent dimensions and styling (colors defined globally in debianito.sh), maintaining a professional look regardless of the underlying terminal emulator.