From 55fa1ca03622166234b5dc7ed668af0321f52e16 Mon Sep 17 00:00:00 2001 From: Puechberty Arthur Date: Thu, 30 Jul 2026 02:39:46 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20de=20la=20gestion=20de=20la?= =?UTF-8?q?=20m=C3=A9moire=20:=20ajout=20de=20la=20configuration=20ZRAM=20?= =?UTF-8?q?pour=20un=20swap=20plus=20stable=20et=20remplacement=20de=20`pa?= =?UTF-8?q?ru`=20par=20`paru-bin`=20pour=20une=20installation=20plus=20rap?= =?UTF-8?q?ide.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/install.sh b/install.sh index 8e696f7..67806a7 100644 --- a/install.sh +++ b/install.sh @@ -1,10 +1,3 @@ -Le compilateur Rust (utilisé pour compiler `paru`) est célèbre pour consommer énormément de RAM. Sur un PC portable avec 4 ou 8 Go de RAM, le noyau Linux tue le processus (OOM Killer) pour protéger le système. - -Pour régler ce problème définitivement, j'ai ajouté la création d'un **fichier d'échange (Swap) de 4 Go** juste avant la compilation, ce qui donnera de la marge au système. De plus, j'ai remplacé `paru` par `paru-bin` (une version précompilée), ce qui évite de compiler Rust et rend l'installation instantanée. - -Voici le script corrigé (sans emoji) : - -```bash #!/bin/bash # ============================================================================== @@ -108,7 +101,7 @@ pacstrap /mnt base base-devel linux-zen linux-zen-headers linux-firmware btrfs-p mesa wayland xdg-desktop-portal xdg-desktop-portal-hyprland \ hyprland wofi waybar swaybg ttf-jetbrains-mono-nerd \ bluez bluez-utils thunar playerctl \ - fastfetch btop htop ncdu yazi lazygit + fastfetch btop htop ncdu yazi lazygit zram-generator # 7. Génération fstab optimisée echo "[INFO] Génération du fstab..." @@ -183,6 +176,14 @@ systemctl enable thermald systemctl enable acpid systemctl enable bluetooth +# Configuration ZRAM (Swap dans la RAM, beaucoup plus stable que swapfile sur BTRFS) +cat << ZRAMCONF > /etc/systemd/zram-generator.conf +[zram0] +zram-size = ram / 2 +swap-priority = 100 +fs-type = swap +ZRAMCONF + # Connexion TTY automatique (demande juste le mot de passe) mkdir -p /etc/systemd/system/getty@tty1.service.d cat << GETTYCONF > /etc/systemd/system/getty@tty1.service.d/override.conf @@ -191,14 +192,6 @@ ExecStart= ExecStart=-/usr/bin/agetty --autologin $USERNAME --noclear %I \$TERM GETTYCONF -# Création d'un fichier SWAP de 4 Go (pour éviter le crash OOM pendant les compilations) -echo "[INFO] Création d'un swapfile de 4Go..." -fallocate -l 4G /swapfile -chmod 600 /swapfile -mkswap /swapfile -swapon /swapfile -echo "/swapfile none swap defaults 0 0" >> /etc/fstab - # Configuration AUR (paru-bin) et mots de passe automatisés echo "[INFO] Configuration de sudo sans mot de passe temporaire pour l'installation AUR..." echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/temp @@ -537,7 +530,8 @@ if [ -z "\${WAYLAND_DISPLAY}" ] && [ "\${XDG_VTNR}" -eq 1 ]; then while true; do read -s -p "Entrez votre mot de passe pour demarrer Hyprland: " PASS echo "" - if echo "\$PASS" | sudo -S true 2>/dev/null; then + # Utilisation de sudo -k pour réinitialiser le cache et forcer la demande + if echo "\$PASS" | sudo -S -k true 2>/dev/null; then exec Hyprland break else @@ -563,5 +557,4 @@ echo " INSTALLATION TERMINEE AVEC SUCCES !" echo "==================================================" echo "Redémarrage dans 3 secondes..." sleep 3 -reboot -``` \ No newline at end of file +reboot \ No newline at end of file