diff --git a/configs/releng/airootfs/usr/local/bin/fws-setup-hardware b/configs/releng/airootfs/usr/local/bin/fws-setup-hardware new file mode 100755 index 0000000..07a2fa5 --- /dev/null +++ b/configs/releng/airootfs/usr/local/bin/fws-setup-hardware @@ -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 +# ( = 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 diff --git a/configs/releng/airootfs/usr/share/anaconda/interactive-defaults.ks b/configs/releng/airootfs/usr/share/anaconda/interactive-defaults.ks index faeb1ef..e973570 100644 --- a/configs/releng/airootfs/usr/share/anaconda/interactive-defaults.ks +++ b/configs/releng/airootfs/usr/share/anaconda/interactive-defaults.ks @@ -298,6 +298,15 @@ HYEOF fi fi +# --- 4quater) ADN FWS : détection matériel + drivers + stack « Windows » ------ +# Script dédié (NON bloquant ; réseau requis) : drivers GPU détectés via lspci + +# outils invité VM, son/micro/casque (PipeWire), Bluetooth, Podman, et — si un +# bureau est choisi — Steam, Wine, VR (Monado/SteamVR), winboat-bin (apps +# Windows). C'est le cœur « remplacement de Windows » de FWS. +if [ -x /usr/local/bin/fws-setup-hardware ]; then + /usr/local/bin/fws-setup-hardware "$DESK" || true +fi + # --- Config Hyprland (si choisi) : clavier + apps + waybar ------------------- # Hyprland (Wayland) NE lit PAS /etc/X11/xorg.conf.d/00-keyboard.conf : sa # disposition est dans SA config (input { kb_layout }). Sans config il démarre nu diff --git a/configs/releng/profiledef.sh b/configs/releng/profiledef.sh index b9d8a31..f3869a9 100644 --- a/configs/releng/profiledef.sh +++ b/configs/releng/profiledef.sh @@ -24,4 +24,5 @@ file_permissions=( ["/usr/local/bin/livecd-sound"]="0:0:755" ["/usr/bin/load_policy"]="0:0:755" ["/usr/bin/setstatus"]="0:0:755" + ["/usr/local/bin/fws-setup-hardware"]="0:0:755" )