From 3a652c28e659439f31b6ebdff9221fffc8bac30d Mon Sep 17 00:00:00 2001 From: stornic56 <71296607+stornic56@users.noreply.github.com> Date: Tue, 16 Jun 2026 19:59:15 -0500 Subject: [PATCH] system overhaul and bug fixeds - Replaced the fragile upstream script installer with native Deb822 repository injection and automated GPG keyring management in `jellyfin.sh`. Eliminated external dependencies, checksums, and interactive flags for guaranteed non-interactive support across Bullseye/Bookworm/Trixie. - Upgraded the NVMe module (`modules/extras/system/system.sh`) to perform multi-drive scanning with dynamic `lsblk` parsing. Replaced single-disk detection logic with a `while read` loop to capture all devices, displaying formatted SMART health diagnostics (Critical Warning, Temperature, Percentage Used). - Overhauled the 'System Information' TUI into a multi-device dashboard featuring standalone GPU/Driver hierarchies and dynamic storage mapping. Added new globals (`DISPLAY_SERVER`, `STORAGE_SUMMARY`) and comprehensive arrays for Network/Wi-Fi interface indexing in `modules/utils.sh`. - Redesigned the graphics stack layout to fix multi-GPU text clipping and unified Mesa version prompting logic. Integrated post-install package telemetry to display live versions in the completion screen, separating planning visualization from installation decision points in `modules/gpu.sh`. - Fixed non-free-firmware conceptual documentation bugs and expanded Backports descriptions with hardware-focused educational text. Added non-free repository safeguards for Trixie/Bullseye compatibility under "Firmware & Wireless Drivers". - Refactored repository logic in modules/repos.sh to eliminate dead code (redundant default_text variables) and strict-hardcoded layout behaviors, standardizing dialog geometry to a clean matrix. - Updated README.md --- README.md | 16 ++--- debianito.sh | 108 ++++++++++++++++++++++++++------ modules/bullseye/extras.sh | 8 +++ modules/extras/dev/jellyfin.sh | 58 +++++++++-------- modules/extras/system/system.sh | 45 +++++++++---- modules/firmware.sh | 17 ++++- modules/gpu.sh | 54 ++++++++++------ modules/repos.sh | 32 ++++++++-- modules/utils.sh | 98 +++++++++++++++++++++++++++++ 9 files changed, 343 insertions(+), 93 deletions(-) diff --git a/README.md b/README.md index dd1408f..387e160 100644 --- a/README.md +++ b/README.md @@ -49,12 +49,12 @@ After running the script: |--------|-------------|--------------| | **1** | System Info | Show detected OS, CPU, RAM, GPU and hardware details | | **2** | [User Privileges & Feedback](#user-privileges--feedback) | Configure sudo group membership, enable passwordless sudo for frequent tasks, repair home directory ownership issues, and toggle visual password feedback (asterisks) in terminal | -| **3** | Configure Repositories | Setup official repos with/without backports (deb822 or classic format) and non-free/contrib| -| **4** | Setup Wireless & Firmware | Install WiFi firmware for Broadcom, Intel, and other chipsets| -| **5** | Configure Graphics Stack | AMD/Intel/NVIDIA drivers + monitoring tools | -| **6** | Update Kernel to Backports | Install latest kernel from Debian backports| -| **7** | Gaming Setup and Performance | Steam, Heroic Games Launcher, GameMode, MangoHud, OpenRGB Java JRE (Temurin 8/17/21) | -| **8** | Install ZRAM (compressed swap) | Configure compressed RAM for memory optimization| +| **3** | Configure Repositories | Setup official repos with non-free/contrib options, optional Backports support and Deb822/classic format injection.| +| **4** | Firmware & Wireless Drivers | Install essential firmware for GPUs and wireless| +| **5** | Graphics Drivers & Mesa Stack | Configure AMD/Intel/NVIDIA drivers and Mesa graphics stack + monitoring tools | +| **6** | Backports Kernel | Install latest kernel from Debian backports| +| **7** | Gaming Setup and Performance | Steam, Heroic Games Launcher, GameMode, MangoHud, OpenRGB, Java JRE (Temurin 8/17/21) | +| **8** | Install ZRAM (Swap) | Configure compressed RAM for memory optimization| | **9** | Install Programs and Software | Selection from several categories (Development, Themes, System, etc.) | | **10** | Exit | Return to terminal | @@ -73,8 +73,8 @@ The submenu offers the next categories: | **6** | Code Editors & IDEs | vim, vim-gtk3, Neovim, Helix, nano, Emacs, Kate, Mousepad, Gedit, Geany, GNOME Text Editor, and VSCodium (VS Code open-source) | | **7** | Servers & Dev Tools | Web servers (Nginx/Apache), databases (PostgreSQL/MariaDB), Java Development Kit (Temurin 17/21/25 JDK), Docker, Python, SSH tools, fail2ban, Jellyfin Server and essential utilities | | **8** | Security & Networking | Wireshark, tcpdump, Zenmap, ClamAV, UFW, Fail2ban | -| **9** | Software Centers | Choose a software store to install | -| **10** | System Tools | htop/btop, ncdu, Timeshift, tmux/screen, nvme-cli Flatpak support, extension repository manager and qemu/virtmanager | +| **9** | Software Centers | Choose a software store to install. | +| **10** | System Tools | htop/btop, ncdu, Timeshift, tmux/screen, nvme-cli, Flatpak support, extension repository manager and qemu/virtmanager | | **11** | Fetch / System Info | fastfetch/neofetch, hyfetch, Linux logo and screenfetch | | **12** | Back to Main Menu | Return directly to the main Debianito menu (exit submenu) | diff --git a/debianito.sh b/debianito.sh index 2ee7ce2..bde3403 100644 --- a/debianito.sh +++ b/debianito.sh @@ -53,8 +53,8 @@ main_menu() { "1" "System Info" \ "2" "User Privileges & Feedback" \ "3" "Configure repositories" \ - "4" "Wireless & Firmware" \ - "5" "Graphics Stack" \ + "4" "Firmware & Wireless Drivers" \ + "5" "Graphics Drivers & Mesa Stack" \ "6" "Backports Kernel" \ "7" "Gaming Setup" \ "8" "ZRAM (Swap)" \ @@ -113,27 +113,93 @@ kernels. Use the stable kernel provided by Bullseye." 10 60 } _show_sysinfo() { - local gpu_info="${GPU_DESC}" - [ -n "$GPU_VERSION" ] && gpu_info+=" (${GPU_VERSION})" + local msg="" - local network_info - if [ -n "$ETH_DESC" ] && [ -n "$WIFI_DESC" ]; then - network_info="Ethernet: ${ETH_DESC}\nWiFi: ${WIFI_DESC}" - elif [ -n "$ETH_DESC" ]; then - network_info="${ETH_DESC}" - elif [ -n "$WIFI_DESC" ]; then - network_info="${WIFI_DESC}" - else - network_info="No adapters detected" + # ── OS Block ── + msg+="OS: ${DEBIAN_VERSION} (${DEBIAN_CODENAME})\n" + msg+="Kernel: ${KERNEL_VERSION}\n" + msg+="Display: ${DISPLAY_SERVER}\n" + msg+="\n" + + # ── Hardware Block ── + msg+="CPU: ${CPU_SUMMARY}\n" + msg+="RAM: ${RAM_SUMMARY}\n" + msg+="Storage: ${STORAGE_SUMMARY}\n" + msg+="\n" + + # ── GPU Block ── + local found_gpu=false + if command -v lspci &>/dev/null; then + local gpu_count=0 + while IFS= read -r gpu_line; do + found_gpu=true + gpu_count=$((gpu_count + 1)) + local desc + desc=$(echo "$gpu_line" | sed -E 's/.*: //; s/ *\(rev.*//') + + if echo "$gpu_line" | grep -qi "nvidia"; then + local nv_ver="" + nv_ver=$(nvidia-smi --query-gpu=driver_version --format=csv,noheader 2>/dev/null | head -1) + [ -z "$nv_ver" ] && nv_ver=$(dpkg -l nvidia-driver 2>/dev/null | awk '/^ii/ {print $3}' | sed 's/-.*//') + msg+="GPU ${gpu_count}: ${desc}\n" + msg+=" Driver: ${nv_ver:+NVIDIA }${nv_ver:-not installed}\n" + else + local mesa_ver="" + mesa_ver=$(dpkg -l libgl1-mesa-dri 2>/dev/null | awk '/^ii/ {print $3; exit}' | sed 's/-.*//') + msg+="GPU ${gpu_count}: ${desc}\n" + msg+=" Driver: ${mesa_ver:+Mesa }${mesa_ver:-unknown}\n" + fi + done < <(lspci -nn | grep -E "VGA|3D" || true) fi - _msg "System Information" \ - "Debian: ${DEBIAN_VERSION} (${DEBIAN_CODENAME}) -Kernel: ${KERNEL_VERSION} -CPU: $(get_cpu_summary) -RAM: $(get_ram_summary) -GPU: ${gpu_info} -Network: ${network_info}" 13 65 + if ! $found_gpu; then + msg+="GPU: No GPU detected\n" + fi + msg+="\n" + + # ── Network Block ── + msg+="─── Network ───\n" + local has_network=false + local i + + if ! command -v ip &>/dev/null; then + msg+="(install iproute2 for interface details)\n" + else + for i in "${!ETH_NAMES[@]}"; do + has_network=true + local e_iface="${ETH_NAMES[$i]}" + local e_desc="${ETH_DESCS[$i]:-$ETH_DESC}" + local e_state="${ETH_STATES[$i]}" + local e_ip4="${ETH_IPS[$i]}" + if [ "$e_state" = "UP" ]; then + msg+="${e_iface}: ${e_desc}\n ↑ ${e_ip4:-no IP}\n" + else + msg+="${e_iface}: ${e_desc}\n ↓\n" + fi + done + + for i in "${!WIFI_NAMES[@]}"; do + has_network=true + local w_iface="${WIFI_NAMES[$i]}" + local w_desc="${WIFI_DESCS[$i]:-$WIFI_DESC}" + local w_state="${WIFI_STATES[$i]}" + local w_ip4="${WIFI_IPS[$i]}" + local w_ssid="${WIFI_SSIDS[$i]}" + if [ "$w_state" = "UP" ]; then + msg+="${w_iface}: ${w_desc}\n ↑ ${w_ip4:-no IP}" + [ -n "$w_ssid" ] && msg+=" \"${w_ssid}\"" + msg+="\n" + else + msg+="${w_iface}: ${w_desc}\n ↓\n" + fi + done + + if ! $has_network; then + msg+="No active interfaces detected\n" + fi + fi + + _msg "System Information" "$msg" 22 76 } check_root @@ -146,6 +212,8 @@ detect_cpu_ram detect_kernel detect_gpu detect_network +detect_displayserver +detect_storage # ── Bullseye-specific init (archive phase) ── if [ "$DEBIAN_VERSION" = "11" ] && type check_bullseye_archive_phase &>/dev/null; then diff --git a/modules/bullseye/extras.sh b/modules/bullseye/extras.sh index 34a9f56..14c87f1 100644 --- a/modules/bullseye/extras.sh +++ b/modules/bullseye/extras.sh @@ -24,6 +24,14 @@ _quick_install_bullseye() { install_firmware_bullseye() { echo -e "${YELLOW}Installing firmware-linux-nonfree (Bullseye)...${NC}" + # ── Safeguard: non-free repos must be enabled ── + if ! grep -qr "non-free" /etc/apt/sources.list /etc/apt/sources.list.d/ 2>/dev/null; then + _msg "Error" "Error: No 'non-free' repositories were detected.\n\ +Please first run the 'Configure repositories' option in the\n\ +main menu to install proprietary firmwares." 10 65 + return 1 + fi + if is_installed "firmware-linux-nonfree"; then echo "firmware-linux-nonfree already installed." return diff --git a/modules/extras/dev/jellyfin.sh b/modules/extras/dev/jellyfin.sh index 076fb22..5d3f60f 100644 --- a/modules/extras/dev/jellyfin.sh +++ b/modules/extras/dev/jellyfin.sh @@ -1,32 +1,38 @@ -# jellyfin.sh — Jellyfin Media Server installation +# jellyfin.sh — Jellyfin Media Server installation (native repo) install_jellyfin() { - local tmpdir="/tmp/jellyfin_install" - mkdir -p "${tmpdir}" + local ver + ver=$(apt-cache policy jellyfin 2>/dev/null | awk 'NR==3 {print $2; exit}') - _run_cmd "Jellyfin" "curl -sSL -o ${tmpdir}/install-debuntu.sh https://repo.jellyfin.org/install-debuntu.sh" "Downloading Jellyfin repository script..." - _run_cmd "Jellyfin" "curl -sSL -o ${tmpdir}/install-debuntu.sh.sha256sum https://repo.jellyfin.org/install-debuntu.sh.sha256sum" "Downloading checksum..." + if _confirm "Install: Jellyfin" "Install Jellyfin Media Server +Repository: repo.jellyfin.org/debian +Version: ${ver:-unknown}"; then - if [ ! -s "${tmpdir}/install-debuntu.sh" ] || [ ! -s "${tmpdir}/install-debuntu.sh.sha256sum" ]; then - echo -e "${RED}[-]${NC} Download failed: script or checksum is empty or missing." - rm -rf "${tmpdir}" - return 1 + # 1. Prerequisites + ! is_installed "curl" && _run_install "curl" + ! is_installed "gpg" && _run_install "gpg" + sudo install -d -m 0755 /etc/apt/keyrings + + # 2. GPG key + echo -e "${GREEN}[+]${NC} Adding Jellyfin GPG key..." + curl -fsSL "https://repo.jellyfin.org/jellyfin_team.gpg.key" \ + | sudo gpg --dearmor -o /etc/apt/keyrings/jellyfin.gpg + + # 3. Deb822 .sources file + echo -e "${GREEN}[+]${NC} Adding Jellyfin repository..." + sudo tee /etc/apt/sources.list.d/jellyfin.sources > /dev/null << EOF +Types: deb +URIs: https://repo.jellyfin.org/debian +Suites: ${DEBIAN_CODENAME} +Components: main +Architectures: $(dpkg --print-architecture) +Signed-By: /etc/apt/keyrings/jellyfin.gpg +EOF + + # 4. Update + install + _run_cmd "APT Update" "sudo apt update" "Updating package lists..." + _run_cmd "Jellyfin" "sudo DEBIAN_FRONTEND=noninteractive apt install -y jellyfin" "Installing Jellyfin..." + + echo -e "${GREEN}Jellyfin Server installed. Web interface available at http://localhost:8096${NC}" fi - - echo -e "${GREEN}[+]${NC} Verifying checksum..." - if ! (cd "${tmpdir}" && sha256sum -c install-debuntu.sh.sha256sum); then - echo -e "${RED}[-]${NC} Checksum verification failed. The downloaded script may be corrupted." - rm -rf "${tmpdir}" - return 1 - fi - - echo -e "${GREEN}[+]${NC} Running Jellyfin repository setup..." - if ! sudo bash "${tmpdir}/install-debuntu.sh"; then - echo -e "${RED}[-]${NC} Jellyfin installation failed." - rm -rf "${tmpdir}" - return 1 - fi - - rm -rf "${tmpdir}" - echo -e "${GREEN}Jellyfin Server installed. Web interface available at http://localhost:8096${NC}" } diff --git a/modules/extras/system/system.sh b/modules/extras/system/system.sh index b0456ff..4c7de2a 100644 --- a/modules/extras/system/system.sh +++ b/modules/extras/system/system.sh @@ -214,23 +214,44 @@ _cat_general() { nvme-cli) if ! lsblk -d -o TRAN 2>/dev/null | grep -q "^nvme$"; then echo "No NVMe controller detected. Skipping." - break + continue fi if ! is_installed "nvme-cli"; then _run_cmd "nvme-cli" "sudo apt install -y nvme-cli" "Installing nvme-cli..." fi - local nvme_dev - nvme_dev=$(lsblk -d -o NAME,TRAN 2>/dev/null | awk '/nvme/ {print $1; exit}') - if [ -n "$nvme_dev" ] && [ -e "/dev/${nvme_dev}" ]; then - if _confirm "NVMe Health" "Run smart-log on /dev/${nvme_dev}?"; then + local nvme_devs=() + while read -r dev; do + nvme_devs+=("$dev") + done < <(lsblk -d -o NAME,TRAN 2>/dev/null | awk '$2 == "nvme" {print $1}') + if [ ${#nvme_devs[@]} -eq 0 ]; then + echo "No NVMe block devices found for health check." + continue + fi + local dev_list="" + local dev + for dev in "${nvme_devs[@]}"; do + [ -n "$dev_list" ] && dev_list+=", " + dev_list+="/dev/${dev}" + done + if _confirm "NVMe Health" "Run smart-log on ${#nvme_devs[@]} NVMe device(s): ${dev_list}?"; then + echo "" + for dev in "${nvme_devs[@]}"; do + local cw="" temp="" pu="" + while IFS= read -r line; do + case "$line" in + *critical_warning*) cw="${line##*: }" ;; + *temperature*) temp="${line##*: }" ;; + *percentage_used*) pu="${line##*: }" ;; + esac + done < <(sudo nvme smart-log "/dev/${dev}" 2>/dev/null || true) + echo -e "${YELLOW}━━━ /dev/${dev} ━━━${NC}" + echo -e " ${GREEN}Critical Warning:${NC} ${cw:-N/A}" + echo -e " ${GREEN}Temperature:${NC} ${temp:-N/A}" + echo -e " ${GREEN}Percentage Used:${NC} ${pu:-N/A}" echo "" - sudo nvme smart-log "/dev/${nvme_dev}" - echo "" - echo "Press [ENTER] to continue..." - read -r - fi - else - echo "No NVMe device found for health check." + done + echo "Press [ENTER] to continue..." + read -r fi ;; *) diff --git a/modules/firmware.sh b/modules/firmware.sh index f1b4fe6..ce2855d 100644 --- a/modules/firmware.sh +++ b/modules/firmware.sh @@ -3,6 +3,14 @@ install_firmware() { echo -e "${YELLOW}Base firmware check...${NC}" + # ── Safeguard: non-free repos must be enabled ── + if ! grep -qr "non-free" /etc/apt/sources.list /etc/apt/sources.list.d/ 2>/dev/null; then + _msg "Error" "Error: No 'non-free' repositories were detected.\n\ +Please first run the 'Configure repositories' option in the\n\ +main menu to install proprietary firmwares." 10 65 + return 1 + fi + local fw_pkg="firmware-linux-nonfree" local fw_bpo fw_bpo=$(apt-cache madison "$fw_pkg" 2>/dev/null | \ @@ -28,8 +36,13 @@ install_firmware() { local msg="firmware-linux-nonfree provides hardware drivers for:\n" msg+=" WiFi, Bluetooth, GPU, audio, webcams, and more.\n\n" if [ -n "$fw_bpo" ]; then - msg+=" Backports: ${fw_bpo} (newer, recommended)\n" - msg+=" Stable: ${fw_stable}\n\n" + msg+=" ● Stable: ${fw_stable}\n" + msg+=" Ultra tested, but may lack support for\n" + msg+=" very recent hardware.\n\n" + msg+=" ● Backports: ${fw_bpo} (Recommended)\n" + msg+=" Updated firmware for modern hardware from\n" + msg+=" 2025/2026: recent GPUs (Intel Arc, Radeon,\n" + msg+=" NVIDIA), new processors, Wi-Fi 6E / Wi-Fi 7.\n\n" msg+="Choose version:" if _confirm_custom "Firmware" "$msg" "Backports" "Stable"; then _run_cmd "Firmware" "sudo apt install -y -t ${DEBIAN_CODENAME}-backports $fw_pkg" "Installing firmware from backports..." diff --git a/modules/gpu.sh b/modules/gpu.sh index ddbd34a..d0334ee 100644 --- a/modules/gpu.sh +++ b/modules/gpu.sh @@ -16,11 +16,13 @@ install_gpu_drivers() { info+="Components:\n" info+=" Mesa (OpenGL / Vulkan / VA-API)\n" if [ "$GPU_TYPE" != "unknown" ]; then - info+=" GPU firmware for ${GPU_DESC}\n" + info+=" GPU firmware\n" fi info+=" Monitoring tools (nvtop, vainfo, ...)" - if ! _confirm "Graphics Stack" "$info"; then + _msg "Graphics Stack" "$info" 16 70 + + if ! _confirm "Graphics Stack" "Proceed with the graphics stack setup?"; then echo "Skipping Graphics Stack." return fi @@ -66,21 +68,15 @@ install_gpu_drivers() { fi # ── Detectable GPU: build plan ── - local ref_ver - ref_ver=$(apt-cache policy mesa-vulkan-drivers 2>/dev/null | awk 'NR==3 {print $2; exit}') - local ref_bpo_ver - ref_bpo_ver=$(apt-cache madison mesa-vulkan-drivers 2>/dev/null | \ - grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1) - local comp_line="Components: Vulkan, OpenGL, GLX, EGL, VA-API (64-bit)" - - local src_line="Source: Debian Stable" - [ -n "$ref_bpo_ver" ] && [ "$(is_backports_enabled)" == "true" ] && src_line="Source: Debian ${DEBIAN_CODENAME^}-Backports" - - local plan="GPUs detected: ${GPU_DESC}\n\n" - plan+="${src_line}\n" - plan+="Mesa ${ref_bpo_ver:-$ref_ver}\n" - plan+="${comp_line}\n\n" - plan+="Components:\n" + local plan="" + local gpu_count=0 + while IFS= read -r gpu_line; do + gpu_count=$((gpu_count + 1)) + local desc + desc=$(echo "$gpu_line" | sed -E 's/.*: //; s/ *\(rev.*//') + plan+=" GPU ${gpu_count}: ${desc}\n" + done < <(lspci -nn | grep -E "VGA|3D" || true) + plan+="\nComponents:\n" if $HAS_INTEL; then local _gen; _gen=$(get_intel_generation) local _va; [ "$_gen" = "gen7-" ] && _va="i965-va-driver-shaders" || _va="intel-media-va-driver-non-free" @@ -90,10 +86,13 @@ install_gpu_drivers() { plan+=" [+] AMD firmware (firmware-amd-graphics)\n" fi if $HAS_NVIDIA; then - plan+=" [+] NVIDIA driver (details in next step)\n" + plan+=" [+] NVIDIA driver\n" fi + plan+=" [+] Mesa (version selected in next step)\n" - if ! _confirm "Graphics Stack — ${GPU_DESC}" "$plan" 14 70; then + _msg "Graphics Stack — Plan" "$plan" 16 70 + + if ! _confirm "Graphics Stack" "Install the components shown above?"; then echo "Skipping Graphics Stack." return fi @@ -140,6 +139,11 @@ install_gpu_drivers() { # ── Mesa (once) ── _install_mesa_backports + # ── Refresh GPU_VERSION after Mesa install ── + local mesa_ver + mesa_ver=$(dpkg -l libgl1-mesa-dri 2>/dev/null | awk '/^ii/ {print $3; exit}' | sed 's/-.*//') + [ -n "$mesa_ver" ] && GPU_VERSION="Mesa ${mesa_ver}" + # ── Vendor-specific tools ── if $HAS_INTEL; then offer_intel_tools @@ -151,5 +155,15 @@ install_gpu_drivers() { offer_generic_tools fi - echo -e "${GREEN}Graphics stack setup complete.${NC}" + # ── Build summary ── + local summary="" + summary+="Mesa: ${GPU_VERSION:-not available}\n" + if $HAS_NVIDIA; then + local nv_mode="${NVIDIA_DRIVER_MODE:-unknown}" + summary+="NVIDIA: ${nv_mode}\n" + fi + summary+="Firmware: installed for detected GPUs\n" + summary+="Tools: installed per vendor selection" + + _msg "Graphics Stack — Complete" "$summary" 12 65 } diff --git a/modules/repos.sh b/modules/repos.sh index e926ff9..0839fc7 100644 --- a/modules/repos.sh +++ b/modules/repos.sh @@ -273,6 +273,15 @@ configure_repos() { return 1 fi + # ── Informational banner ── + _msg "Repositories" \ +"This section will automatically enable the 'contrib' and 'non-free'\n\ +branches in your official Debian repositories. (The 'non-free-firmware'\n\ +branch is already enabled by default in Debian 12 and 13.)\n\n\ +This is CRUCIAL for obtaining proprietary software packages and\n\ +essential hardware drivers, including NVIDIA graphics drivers,\n\ +Wi-Fi firmware, and CPU microcode." 14 70 + # Detect current state local current_format current_format=$(detect_repo_format) @@ -288,12 +297,19 @@ configure_repos() { echo "Current format: ${current_format:-none}" echo "Backports: $bp_status (location: $bp_location)" - # Choose format (only Trixie gets the choice) + # ── Format selection dialog (only Trixie gets the choice) ── local use_deb822=false if [ "$DEBIAN_CODENAME" = "trixie" ]; then - local default_text="no" - [ "$current_format" = "deb822" ] && default_text="yes" - if whiptail --title "Repository Format" --defaultno --yesno "Use deb822 format (modern .sources)?" 8 60; then + if whiptail --title "Repository Format" --defaultno --yesno \ +"Do you want to migrate your repositories to the new +DEB822 (.sources) format? + +DEB822 is the modern, structured Debian standard. It won't +harm your system, and the script will handle the transition +safely if you accept. + +NOTE: 'NO' (default) is recommended to maintain the classic +linear format as it comes pre-configured in Debian 13 (Trixie)." 14 70; then use_deb822=true fi elif [ "$current_format" = "deb822" ]; then @@ -302,7 +318,13 @@ configure_repos() { # Choose backports local enable_backports=false - if _confirm "Backports" "Enable backports repository?\n\nProvides newer kernel, drivers, Mesa."; then + if _confirm "Backports" "Do you want to enable the official Debian Backports repository?\n\n\ +Backports provides newer, selectively updated packages from the\n\ +next Debian testing branch, recompiled to run stably on your\n\ +current system.\n\n\ +This is HIGHLY RECOMMENDED if you have modern hardware, as it\n\ +delivers newer Linux Kernels, updated display drivers, and modern\n\ +Mesa versions without compromising overall system stability." 15 70; then enable_backports=true fi diff --git a/modules/utils.sh b/modules/utils.sh index 5370cd2..ed527a2 100644 --- a/modules/utils.sh +++ b/modules/utils.sh @@ -16,6 +16,8 @@ HAS_NVIDIA=false HAS_AMD=false HAS_INTEL=false KERNEL_VERSION="" +DISPLAY_SERVER="unknown" +STORAGE_SUMMARY="" WIFI_CHIPSET="" # -------------------------- @@ -252,6 +254,17 @@ WIFI_CHIPSET="" WIFI_DESC="" ETH_DESC="" +declare -a ETH_NAMES=() +declare -a ETH_DESCS=() +declare -a ETH_STATES=() +declare -a ETH_IPS=() + +declare -a WIFI_NAMES=() +declare -a WIFI_DESCS=() +declare -a WIFI_STATES=() +declare -a WIFI_IPS=() +declare -a WIFI_SSIDS=() + detect_network() { local eth_line eth_line=$(lspci -nn | grep -i 'Ethernet controller' | head -n1) || true @@ -265,6 +278,91 @@ detect_network() { 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 + + # ── Safeguard: if ip is not installed, skip runtime parsing ── + if ! command -v ip &>/dev/null; then + return + fi + + local iface state ip4 ssid + + while IFS= read -r line; do + iface=$(echo "$line" | awk -F': ' '{print $2}' | sed 's/@.*//') + state=$(echo "$line" | awk '{print $9}') + case "$iface" in + eth*|enp*|ens*|enx*|eno*) + ip4=$(ip -4 -o addr show "$iface" 2>/dev/null | awk '{print $4}') + ETH_NAMES+=("$iface") + ETH_STATES+=("$state") + ETH_IPS+=("${ip4:-}") + ETH_DESCS+=("${ETH_DESC:-}") + ;; + wl*|wlp*|wlo*) + ip4=$(ip -4 -o addr show "$iface" 2>/dev/null | awk '{print $4}') + ssid="" + [ "$state" = "UP" ] && ssid=$(iwgetid -r "$iface" 2>/dev/null || true) + WIFI_NAMES+=("$iface") + WIFI_STATES+=("$state") + WIFI_IPS+=("${ip4:-}") + WIFI_SSIDS+=("${ssid:-}") + WIFI_DESCS+=("${WIFI_DESC:-}") + ;; + esac + done < <(ip -o link show 2>/dev/null) +} + +# --------------------------------------- +# Display Server detection (Wayland / X11 / tty) +# --------------------------------------- +detect_displayserver() { + local st="${XDG_SESSION_TYPE:-}" + case "$st" in + wayland) DISPLAY_SERVER="Wayland" ;; + x11) DISPLAY_SERVER="X11" ;; + tty) DISPLAY_SERVER="none (tty)" ;; + *) + if [ -n "${WAYLAND_DISPLAY:-}" ]; then + DISPLAY_SERVER="Wayland" + elif [ -n "${DISPLAY:-}" ]; then + DISPLAY_SERVER="X11" + else + DISPLAY_SERVER="unknown" + fi + ;; + esac +} + +# --------------------------------------- +# Storage summary via lsblk (NVMe / SSD / HDD) +# --------------------------------------- +detect_storage() { + local parts=() + local name size rota type + + while read -r name size rota; do + [ "$name" = "NAME" ] && continue + if echo "$name" | grep -q "nvme"; then + type="NVMe" + elif [ "$rota" = "1" ]; then + type="HDD" + else + type="SSD" + fi + parts+=("${size} ${type}") + done < <(lsblk -d -o NAME,SIZE,ROTA 2>/dev/null || true) + + if [ ${#parts[@]} -eq 0 ]; then + STORAGE_SUMMARY="No disks detected" + return + fi + + local result="" + local p + for p in "${parts[@]}"; do + [ -n "$result" ] && result+=" + " + result+="$p" + done + STORAGE_SUMMARY="$result" } # ---------------------------------------