mirror of
https://github.com/stornic56/debianito-post-install.git
synced 2026-09-14 06:02:35 +00:00
nvidia & zram fixes
- Fixed critical NVIDIA driver bug on Debian 13 (Trixie) where repo configuration installed v550 instead of selected v595. Implemented version-specific enabling: cuda-keyring for Trixie, extrepo for Bookworm. Added explicit apt update after repo enable and candidate verification before pinning checks to abort cleanly if expected driver unavailable. - Rewrote `_install_nvidia_standard()` with auto-detected architecture via `_get_nvidia_arch_family()`. Turing/Ampere/Ada/Blackwell → nvidia-open-kernel-dkms (open module); Maxwell/Pascal/Volta/unknown/empty → nvidia-kernel-dkms (closed, safe fallback). Removed all `nvidia-detect` references across modules and docs. - Fixed `_install_nvidia_cuda_repo()` to use correct CUDA repository package names: v590/v595 → nvidia-open metapackage (includes nvidia-kernel-open-dkms); v550 and below → nvidia-driver. Added dynamic warning message based on installed module type. - Fixed uninitialized variable bug in `modules/gaming/tools.sh` causing script abortion under `set -u`. Initialized all local variables (`deb_url`, `sha256`, `json`, `deb_suffix`) with default values and added defensive initialization for `$USER` environment variable. - Fixed ZRAM configuration persistence bug where old config persisted after changes. Added device reset sequence (swapoff + modprobe -r) before writing new config, post-config verification check, and changed default recommendation from 50% to 25% for systems with >16GB RAM. - Added `_warn_nvidia_gnome_wayland()` function in `gpu.sh` to warn about Debian bug #1109409 (GDM3 + NVIDIA + Wayland black screen issue). Warning displays only when gdm3 present, GNOME Shell 4.x detected, and NVIDIA driver installed. - Standardized menu headers across all modules using centralized SCROLL_HINT variable, replacing hardcoded strings with uniform Whiptail instructions. Updated documentation for cuda-keyring (Trixie) and ZRAM configuration flow diagrams.
This commit is contained in:
+22
-4
@@ -85,7 +85,13 @@ _zram_create() {
|
||||
fi
|
||||
fi
|
||||
|
||||
local half_ram_mb=$(( ((RAM_KB / 1024 / 1024 + 1) / 2) * 1024 ))
|
||||
local ram_gb=$(( RAM_KB / 1024 / 1024 ))
|
||||
local recommended_mb
|
||||
if [ "$ram_gb" -gt 16 ]; then
|
||||
recommended_mb=$(( ((RAM_KB / 1024 / 1024 + 1) / 4) * 1024 ))
|
||||
else
|
||||
recommended_mb=$(( ((RAM_KB / 1024 / 1024 + 1) / 2) * 1024 ))
|
||||
fi
|
||||
|
||||
local algo
|
||||
algo=$(_menu "ZRAM Configuration" \
|
||||
@@ -100,10 +106,10 @@ _zram_create() {
|
||||
fi
|
||||
|
||||
local zram_size
|
||||
if _confirm "ZRAM Size" "Use recommended size for ZRAM? (${half_ram_mb} MB out of ${RAM_SUMMARY})"; then
|
||||
zram_size=$half_ram_mb
|
||||
if _confirm "ZRAM Size" "Use recommended size for ZRAM? (${recommended_mb} MB out of ${RAM_SUMMARY})"; then
|
||||
zram_size=$recommended_mb
|
||||
else
|
||||
zram_size=$(_inputbox "ZRAM Size" "Enter ZRAM size in MB:" 8 60 "$half_ram_mb")
|
||||
zram_size=$(_inputbox "ZRAM Size" "Enter ZRAM size in MB:" 8 60 "$recommended_mb")
|
||||
if [ -z "$zram_size" ] || ! [[ "$zram_size" =~ ^[0-9]+$ ]] || [ "$zram_size" -eq 0 ]; then
|
||||
echo "ZRAM configuration cancelled."
|
||||
return
|
||||
@@ -117,6 +123,10 @@ _zram_create() {
|
||||
|
||||
_run_cmd "ZRAM" "sudo apt install -y zram-tools" "Installing zram-tools..."
|
||||
|
||||
echo "Resetting existing ZRAM device..."
|
||||
sudo swapoff /dev/zram0 2>/dev/null || true
|
||||
sudo modprobe -r zram 2>/dev/null || true
|
||||
|
||||
echo "Writing configuration..."
|
||||
sudo tee /etc/default/zramswap > /dev/null <<EOF
|
||||
ALGO=$algo
|
||||
@@ -127,6 +137,10 @@ EOF
|
||||
echo "Restarting zramswap service..."
|
||||
sudo systemctl restart zramswap
|
||||
|
||||
if ! grep -q "\[${algo}\]" /sys/block/zram0/comp_algorithm 2>/dev/null; then
|
||||
echo -e "${YELLOW}Warning: ZRAM algorithm not applied yet. Reboot to finalize.${NC}"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo -e "${GREEN}ZRAM configured successfully.${NC}"
|
||||
echo ""
|
||||
@@ -151,6 +165,10 @@ _zram_remove() {
|
||||
echo "Stopping zramswap service..."
|
||||
sudo systemctl stop zramswap || true
|
||||
|
||||
echo "Releasing ZRAM device..."
|
||||
sudo swapoff /dev/zram0 2>/dev/null || true
|
||||
sudo modprobe -r zram 2>/dev/null || true
|
||||
|
||||
_run_cmd "ZRAM" "sudo apt purge -y zram-tools" "Purging zram-tools..."
|
||||
|
||||
echo "Removing configuration..."
|
||||
|
||||
Reference in New Issue
Block a user