mirror of
https://github.com/arthur-pbty/archinstallscript.git
synced 2026-08-01 20:28:08 +02:00
Amélioration de la gestion de la mémoire : ajout de la configuration ZRAM pour un swap plus stable et remplacement de paru par paru-bin pour une installation plus rapide.
This commit is contained in:
+12
-19
@@ -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
|
#!/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 \
|
mesa wayland xdg-desktop-portal xdg-desktop-portal-hyprland \
|
||||||
hyprland wofi waybar swaybg ttf-jetbrains-mono-nerd \
|
hyprland wofi waybar swaybg ttf-jetbrains-mono-nerd \
|
||||||
bluez bluez-utils thunar playerctl \
|
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
|
# 7. Génération fstab optimisée
|
||||||
echo "[INFO] Génération du fstab..."
|
echo "[INFO] Génération du fstab..."
|
||||||
@@ -183,6 +176,14 @@ systemctl enable thermald
|
|||||||
systemctl enable acpid
|
systemctl enable acpid
|
||||||
systemctl enable bluetooth
|
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)
|
# Connexion TTY automatique (demande juste le mot de passe)
|
||||||
mkdir -p /etc/systemd/system/getty@tty1.service.d
|
mkdir -p /etc/systemd/system/getty@tty1.service.d
|
||||||
cat << GETTYCONF > /etc/systemd/system/getty@tty1.service.d/override.conf
|
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
|
ExecStart=-/usr/bin/agetty --autologin $USERNAME --noclear %I \$TERM
|
||||||
GETTYCONF
|
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
|
# 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 "[INFO] Configuration de sudo sans mot de passe temporaire pour l'installation AUR..."
|
||||||
echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/temp
|
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
|
while true; do
|
||||||
read -s -p "Entrez votre mot de passe pour demarrer Hyprland: " PASS
|
read -s -p "Entrez votre mot de passe pour demarrer Hyprland: " PASS
|
||||||
echo ""
|
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
|
exec Hyprland
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
@@ -563,5 +557,4 @@ echo " INSTALLATION TERMINEE AVEC SUCCES !"
|
|||||||
echo "=================================================="
|
echo "=================================================="
|
||||||
echo "Redémarrage dans 3 secondes..."
|
echo "Redémarrage dans 3 secondes..."
|
||||||
sleep 3
|
sleep 3
|
||||||
reboot
|
reboot
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user