feat(releng): add hardware detection and driver setup script
Add fws-setup-hardware script that automatically detects and installs: - GPU drivers (NVIDIA, AMD, Intel) based on lspci output - Hypervisor guest tools (VMware, VirtualBox, QEMU, Hyper-V) - Audio/mic/headset stack (PipeWire), Bluetooth (BlueZ), containers (Podman) - Optional desktop stack when non-CLI desktop is selected: Steam, Wine, VR support (Monado/OpenXR), and winboat-bin The script is integrated into the Anaconda kickstart post-installation phase and is non-blocking to prevent installation failures from missing packages or network issues. Also update profiledef.sh to set correct permissions (755) for the new script.
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
#!/bin/bash
|
||||
# ============================================================================
|
||||
# FWS — détection matérielle + drivers + stack « remplacement de Windows ».
|
||||
#
|
||||
# Appelé par le %post du kickstart : fws-setup-hardware <bureau>
|
||||
# (<bureau> = cli|gnome|kde|xfce|hyprland). Réseau requis ; CHAQUE étape est
|
||||
# NON bloquante (pas de set -e) : un paquet manquant ou pas de réseau ne casse
|
||||
# pas l'installation.
|
||||
#
|
||||
# Installe :
|
||||
# - les drivers GPU détectés via lspci (Intel / AMD / NVIDIA) + Mesa/Vulkan,
|
||||
# - les outils invité selon l'hyperviseur (VMware/VirtualBox/QEMU/Hyper-V),
|
||||
# - le son/micro/casque (PipeWire), le Bluetooth (BlueZ), les conteneurs
|
||||
# (Podman),
|
||||
# - et — si un bureau est choisi — la stack « comme Windows » : Steam, Wine,
|
||||
# VR (Monado/OpenXR → SteamVR pour HTC Vive / Valve Index ; Oculus n'a pas
|
||||
# de support Linux officiel), winboat-bin (apps Windows).
|
||||
# ============================================================================
|
||||
DESK="${1:-cli}"
|
||||
log() { echo "[FWS-hw] $*"; }
|
||||
|
||||
# ── 1) Drivers GPU (détection lspci) ─────────────────────────────────────────
|
||||
DRIVERS="mesa"
|
||||
GPU="$(lspci 2>/dev/null | grep -iE 'VGA compatible controller|3D controller|Display controller')"
|
||||
case "$GPU" in
|
||||
*NVIDIA*|*GeForce*) DRIVERS="$DRIVERS nvidia-dkms nvidia-utils linux-headers dkms" ;;
|
||||
*AMD*|*ATI*|*Radeon*) DRIVERS="$DRIVERS vulkan-radeon libva-mesa-driver" ;;
|
||||
*Intel*) DRIVERS="$DRIVERS vulkan-intel intel-media-driver" ;;
|
||||
esac
|
||||
|
||||
# ── 2) Outils invité selon l'hyperviseur ─────────────────────────────────────
|
||||
VMSVC=""
|
||||
case "$(systemd-detect-virt 2>/dev/null)" in
|
||||
vmware) DRIVERS="$DRIVERS open-vm-tools"; VMSVC="vmtoolsd vmware-vmblock-fuse" ;;
|
||||
oracle) DRIVERS="$DRIVERS virtualbox-guest-utils"; VMSVC="vboxservice" ;;
|
||||
qemu|kvm) DRIVERS="$DRIVERS qemu-guest-agent spice-vdagent"; VMSVC="qemu-guest-agent spice-vdagentd" ;;
|
||||
microsoft) DRIVERS="$DRIVERS hyperv"; VMSVC="hv_fcopy_daemon hv_kvp_daemon hv_vss_daemon" ;;
|
||||
esac
|
||||
|
||||
# ── 3) Stack de base : son / micro / casque, Bluetooth, conteneurs ───────────
|
||||
BASE="pipewire pipewire-alsa pipewire-pulse pipewire-jack wireplumber \
|
||||
pavucontrol bluez bluez-utils podman"
|
||||
|
||||
# ── 4) Stack desktop : jeux, Windows-compat, VR (si un bureau est choisi) ────
|
||||
DESKTOP=""
|
||||
if [ "$DESK" != "cli" ]; then
|
||||
# multilib requis (Steam / Wine 32 bits).
|
||||
grep -qE '^\[multilib\]' /etc/pacman.conf \
|
||||
|| printf '\n[multilib]\nInclude = /etc/pacman.d/mirrorlist\n' >> /etc/pacman.conf
|
||||
DESKTOP="steam wine winetricks wine-mono wine-gecko \
|
||||
lib32-mesa lib32-pipewire monado gamemode \
|
||||
noto-fonts ttf-liberation"
|
||||
fi
|
||||
|
||||
# ── Sync + filtre aux paquets RÉELLEMENT existants ───────────────────────────
|
||||
# (un nom de paquet manquant/renommé ne doit pas faire échouer tout le reste).
|
||||
pacman -Sy --noconfirm || log "synchro pacman échouée (réseau ?)"
|
||||
VALID=""
|
||||
for p in $DRIVERS $BASE $DESKTOP; do
|
||||
pacman -Si "$p" >/dev/null 2>&1 && VALID="$VALID $p"
|
||||
done
|
||||
if [ -n "$VALID" ]; then
|
||||
log "installation :$VALID"
|
||||
pacman -S --noconfirm --needed $VALID || log "certains paquets non installés"
|
||||
fi
|
||||
|
||||
# NB : winboat-bin (AUR) n'est PAS installé ici (fws-local n'existe pas sur la
|
||||
# cible) : il est intégré à l'image FWS via packages.x86_64 et recopié par le
|
||||
# payload LiveOS d'Anaconda → déjà présent sur le système installé.
|
||||
|
||||
# ── Services matériels ───────────────────────────────────────────────────────
|
||||
[ -n "$VMSVC" ] && systemctl enable $VMSVC 2>/dev/null
|
||||
systemctl enable bluetooth.service 2>/dev/null
|
||||
systemctl enable podman.socket 2>/dev/null
|
||||
exit 0
|
||||
Reference in New Issue
Block a user