mirror of
https://github.com/stornic56/debianito-post-install.git
synced 2026-09-14 06:02:35 +00:00
dual-gpu fix & lspci cache
- Replaced the restrictive Broadcom firmware installation flow with a persistent, step-by-step process in modules/firmware.sh. Now installs dkms, wireless-tools, and linux-headers-amd64 separately, then applies blacklist configuration, updates initramfs, and loads conflicting modules properly. - Fixed conky package name across system.sh and bullseye/extras.sh. Changed from "conky" to "conky-all" with corresponding state variable updates for correct installation via apt. - Corrected broken GRUB sed command in modules/gpu.sh for AMD GCN support. Added grep guard to prevent duplicate parameter insertion and fixed regex pattern for proper cmdline modification. - Added whiptail pre-flight check in debianito.sh. Auto-installs required TUI dependencies if missing before the main menu, preventing runtime failures. - Fixed home directory path resolution bug in modules/sudo_config.sh. Replaced eval echo "~$USER" with getent passwd approach for reliable user home detection across SUDO_USER contexts. - Implemented global lspci output caching across 18+ locations. Single cache population via _init_lspci_cache() before detect_gpu, all subsequent reads use LSPCI_OUTPUT variable to eliminate redundant hardware polling calls. - Added apt update deduplication helper in modules/utils.sh. _ensure_apt_updated() with APT_UPDATED flag bypasses redundant package list refreshes across extras/, gaming/, firmware/, and desktop_display/ modules while preserving transactional rollback paths in repos.sh. - Fixed STATE_REFRESHED logic in debianito.sh main_menu case statement. Added STATE_REFRESHED=true to branches 3, 5, 7, 9, 11, 12, and 13 that mutate system state, ensuring refresh_system_state() triggers correctly after configuration changes. - Removed dead REPOS_CONFIGURED variable from debianito.sh and modules/repos.sh. Variable was written but never read, eliminated to clean up global namespace without affecting repository functionality.
This commit is contained in:
+38
-38
@@ -37,7 +37,7 @@ _show_sysinfo() {
|
||||
msg+="GPU ${gpu_count}: ${desc}\n"
|
||||
msg+=" Driver: ${mesa_ver:+Mesa }${mesa_ver:-unknown}\n"
|
||||
fi
|
||||
done < <(timeout 2 lspci -nn | grep -E "VGA|3D" || true)
|
||||
done < <(echo "$LSPCI_OUTPUT" | grep -E "VGA|3D" || true)
|
||||
fi
|
||||
|
||||
if ! $found_gpu; then
|
||||
@@ -52,13 +52,13 @@ _show_sysinfo() {
|
||||
declare -a pci_eth_lines=()
|
||||
while IFS= read -r line; do
|
||||
pci_eth_lines+=("$line")
|
||||
done < <(timeout 2 lspci -d ::0200 2>/dev/null || true)
|
||||
done < <(echo "$LSPCI_OUTPUT" | grep -i 'ethernet controller' || true)
|
||||
|
||||
# ── 2. Detect ALL WiFi chipsets (class 0x0280 + vendor fallbacks) ──
|
||||
declare -a pci_wifi_lines=()
|
||||
while IFS= read -r line; do
|
||||
pci_wifi_lines+=("$line")
|
||||
done < <(timeout 2 lspci -d ::0280 2>/dev/null || true)
|
||||
done < <(echo "$LSPCI_OUTPUT" | grep -i 'network controller' || true)
|
||||
|
||||
# Broadcom vendor-ID fallback (14e4) — include only if not already captured
|
||||
while IFS= read -r line; do
|
||||
@@ -69,7 +69,7 @@ _show_sysinfo() {
|
||||
done
|
||||
! $already && pci_wifi_lines+=("$line")
|
||||
fi
|
||||
done < <(timeout 2 lspci -nn 2>/dev/null || true)
|
||||
done < <(echo "$LSPCI_OUTPUT" || true)
|
||||
|
||||
# USB WiFi fallback
|
||||
local usb_wifi_lines=()
|
||||
@@ -111,7 +111,7 @@ _show_sysinfo() {
|
||||
state=$(echo "$line" | awk '{print $9}')
|
||||
|
||||
case "$iface" in
|
||||
lo|docker*|veth*|br-*|virbr*|tun*|tap*|bond*) continue ;;
|
||||
lo | docker* | veth* | br-* | virbr* | tun* | tap* | bond*) continue ;;
|
||||
esac
|
||||
|
||||
ip4=$(timeout 2 ip -4 -o addr show "$iface" 2>/dev/null | awk '{print $4}')
|
||||
@@ -121,13 +121,24 @@ _show_sysinfo() {
|
||||
pci_class=$(cat "/sys/class/net/${iface}/device/class" 2>/dev/null || true)
|
||||
|
||||
case "$pci_class" in
|
||||
0x0200*)
|
||||
has_eth=true
|
||||
desc="${eth_descs[$eth_idx]:-Unknown Ethernet chipset}"
|
||||
shown_eth_descs+=("${eth_descs[$eth_idx]:-$desc}")
|
||||
eth_idx=$((eth_idx + 1))
|
||||
;;
|
||||
0x0280*)
|
||||
0x0200*)
|
||||
has_eth=true
|
||||
desc="${eth_descs[$eth_idx]:-Unknown Ethernet chipset}"
|
||||
shown_eth_descs+=("${eth_descs[$eth_idx]:-$desc}")
|
||||
eth_idx=$((eth_idx + 1))
|
||||
;;
|
||||
0x0280*)
|
||||
has_wifi=true
|
||||
desc="${wifi_descs[$wifi_idx]:-Unknown WiFi chipset}"
|
||||
shown_wifi_descs+=("${wifi_descs[$wifi_idx]:-$desc}")
|
||||
wifi_idx=$((wifi_idx + 1))
|
||||
ssid=""
|
||||
[ "$state" = "UP" ] && ssid=$(timeout 2 iwgetid -r "$iface" 2>/dev/null || true)
|
||||
;;
|
||||
*)
|
||||
# Fallback: classify by interface name pattern
|
||||
case "$iface" in
|
||||
wl* | wlp* | wlo* | wlan*)
|
||||
has_wifi=true
|
||||
desc="${wifi_descs[$wifi_idx]:-Unknown WiFi chipset}"
|
||||
shown_wifi_descs+=("${wifi_descs[$wifi_idx]:-$desc}")
|
||||
@@ -135,29 +146,18 @@ _show_sysinfo() {
|
||||
ssid=""
|
||||
[ "$state" = "UP" ] && ssid=$(timeout 2 iwgetid -r "$iface" 2>/dev/null || true)
|
||||
;;
|
||||
*)
|
||||
# Fallback: classify by interface name pattern
|
||||
case "$iface" in
|
||||
wl*|wlp*|wlo*|wlan*)
|
||||
has_wifi=true
|
||||
desc="${wifi_descs[$wifi_idx]:-Unknown WiFi chipset}"
|
||||
shown_wifi_descs+=("${wifi_descs[$wifi_idx]:-$desc}")
|
||||
wifi_idx=$((wifi_idx + 1))
|
||||
ssid=""
|
||||
[ "$state" = "UP" ] && ssid=$(timeout 2 iwgetid -r "$iface" 2>/dev/null || true)
|
||||
;;
|
||||
eth*|enp*|ens*|enx*|eno*)
|
||||
has_eth=true
|
||||
desc="${eth_descs[$eth_idx]:-Unknown Ethernet chipset}"
|
||||
shown_eth_descs+=("${eth_descs[$eth_idx]:-$desc}")
|
||||
eth_idx=$((eth_idx + 1))
|
||||
;;
|
||||
*)
|
||||
has_other=true
|
||||
desc="(network interface)"
|
||||
;;
|
||||
esac
|
||||
eth* | enp* | ens* | enx* | eno*)
|
||||
has_eth=true
|
||||
desc="${eth_descs[$eth_idx]:-Unknown Ethernet chipset}"
|
||||
shown_eth_descs+=("${eth_descs[$eth_idx]:-$desc}")
|
||||
eth_idx=$((eth_idx + 1))
|
||||
;;
|
||||
*)
|
||||
has_other=true
|
||||
desc="(network interface)"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$state" = "UP" ]; then
|
||||
@@ -214,7 +214,7 @@ _show_sysinfo() {
|
||||
term_cols=$(tput cols 2>/dev/null || echo 80)
|
||||
[ "$term_cols" -lt 50 ] && term_cols=50
|
||||
|
||||
local max_pct=$(( term_cols * 95 / 100 ))
|
||||
local max_pct=$((term_cols * 95 / 100))
|
||||
[ "$max_pct" -lt 50 ] && max_pct=50
|
||||
|
||||
local longest=0
|
||||
@@ -223,7 +223,7 @@ _show_sysinfo() {
|
||||
[ "$len" -gt "$longest" ] && longest=$len
|
||||
done < <(echo -e "$msg")
|
||||
|
||||
local width=$(( longest + 6 ))
|
||||
local width=$((longest + 6))
|
||||
[ "$width" -lt 80 ] && width=80
|
||||
[ "$width" -gt "$max_pct" ] && width=$max_pct
|
||||
|
||||
@@ -238,8 +238,8 @@ _show_sysinfo() {
|
||||
|
||||
local lines
|
||||
lines=$(echo -e "$truncated" | wc -l)
|
||||
local height=$(( lines + 6 ))
|
||||
local max_height=$(( ${LINES:-24} - 4 > 10 ? ${LINES:-24} - 4 : 10 ))
|
||||
local height=$((lines + 6))
|
||||
local max_height=$((${LINES:-24} - 4 > 10 ? ${LINES:-24} - 4 : 10))
|
||||
[ "$height" -gt "$max_height" ] && height=$max_height
|
||||
[ "$height" -lt 10 ] && height=10
|
||||
|
||||
|
||||
Reference in New Issue
Block a user