summaryrefslogtreecommitdiff
path: root/archsetup
diff options
context:
space:
mode:
Diffstat (limited to 'archsetup')
-rwxr-xr-xarchsetup56
1 files changed, 55 insertions, 1 deletions
diff --git a/archsetup b/archsetup
index 495ae5a..c656e25 100755
--- a/archsetup
+++ b/archsetup
@@ -31,6 +31,7 @@ fi
skip_slow_packages=false
fresh_install=false
show_status_only=false
+skip_gpu_drivers=false
while [ $# -gt 0 ]; do
case "$1" in
@@ -46,6 +47,10 @@ while [ $# -gt 0 ]; do
show_status_only=true
shift
;;
+ --no-gpu-drivers)
+ skip_gpu_drivers=true
+ shift
+ ;;
--help|-h)
echo "Usage: $0 [OPTIONS]"
echo ""
@@ -53,12 +58,13 @@ while [ $# -gt 0 ]; do
echo " --skip-slow-packages Skip texlive-meta and topgrade"
echo " --fresh Start fresh, ignore previous progress"
echo " --status Show installation progress and exit"
+ echo " --no-gpu-drivers Skip GPU driver detection/installation"
echo " --help, -h Show this help message"
exit 0
;;
*)
echo "Unknown option: $1"
- echo "Usage: $0 [--skip-slow-packages] [--fresh] [--status]"
+ echo "Usage: $0 [--skip-slow-packages] [--fresh] [--status] [--no-gpu-drivers]"
exit 1
;;
esac
@@ -331,6 +337,49 @@ is_zfs_root() {
[ "$(findmnt -n -o FSTYPE /)" = "zfs" ]
}
+# GPU Driver Installation
+install_gpu_drivers() {
+ if $skip_gpu_drivers; then
+ display "task" "Skipping GPU driver installation (--no-gpu-drivers)"
+ return 0
+ fi
+
+ display "subtitle" "GPU Drivers"
+
+ # Detect GPU vendors via lspci
+ gpu_info=$(lspci 2>/dev/null | grep -E "VGA|3D")
+
+ if echo "$gpu_info" | grep -qi "intel"; then
+ display "task" "Intel GPU detected - installing drivers"
+ pacman_install mesa
+ pacman_install intel-media-driver # hardware video acceleration
+ pacman_install vulkan-intel # Vulkan support
+ fi
+
+ if echo "$gpu_info" | grep -qi "amd\|radeon"; then
+ display "task" "AMD GPU detected - installing drivers"
+ pacman_install mesa
+ pacman_install xf86-video-amdgpu
+ pacman_install vulkan-radeon
+ pacman_install libva-mesa-driver # hardware video acceleration
+ fi
+
+ if echo "$gpu_info" | grep -qi "nvidia"; then
+ display "task" "NVIDIA GPU detected - installing drivers"
+ pacman_install nvidia-dkms # DKMS version for kernel flexibility
+ pacman_install nvidia-utils
+ pacman_install nvidia-settings
+ pacman_install libva-nvidia-driver # hardware video acceleration
+ fi
+
+ # Fallback for VMs or unknown hardware
+ if ! echo "$gpu_info" | grep -qiE "intel|amd|radeon|nvidia"; then
+ display "task" "No discrete GPU detected - installing generic drivers"
+ pacman_install mesa
+ pacman_install xf86-video-vesa
+ fi
+}
+
### Prerequisites
prerequisites() {
# why these software packages are 'required'
@@ -885,6 +934,9 @@ EndSection
EOF
action="configuring xorg server" && display "task" "$action"
chmod 644 /etc/X11/xorg.conf.d/00-no-vt-or-zap.conf >> "$logfile" 2>&1 || error "error" "$action" "$?"
+
+ # Install GPU-specific drivers
+ install_gpu_drivers
}
### DWM Window Manager
@@ -1356,6 +1408,8 @@ EOF
echo "blacklist iTCO_wdt" >/etc/modprobe.d/nowatchdog.conf || error "error" "$action" "$?"
# GRUB: reset timeouts, adjust log levels, larger menu for HiDPI screens, and show splashscreen
+ # Note: nvme.noacpi=1 disables NVMe ACPI power management to prevent freezes on some drives.
+ # Safe to keep on newer drives (minor power cost), remove if battery life is critical.
action="configuring boot menu for silence and bootsplash" && display "task" "$action"
if [ -f /etc/default/grub ]; then
action="resetting timeouts and adjusting log levels on grub boot" && display "task" "$action"