Amélioration du script d'installation : nettoyage des commentaires, ajout de dépendances de compilation pour ghostty et hyprland, et mise à jour des messages d'information.

This commit is contained in:
Puechberty Arthur
2026-07-30 21:22:32 +02:00
parent 1d7621375c
commit de9b43f056
+19 -58
View File
@@ -10,8 +10,6 @@ ROOT_PASS="rootpassword123"
HOSTNAME="arch-laptop"
# ==============================================================================
# Ne pas utiliser set -e pour éviter que le script ne plante sur des avertissements (ex: umount)
echo "=================================================="
echo " INSTALLATION ARCH LINUX + HYPRLAND (ZEN/OPTI) "
echo "=================================================="
@@ -74,7 +72,7 @@ mdadm --stop --scan 2>/dev/null
swapoff -a 2>/dev/null
dmsetup remove_all 2>/dev/null
# Destruction totale des tables de partition (bien plus puissant que dd)
# Destruction totale des tables de partition
echo "[INFO] Destruction des tables de partition..."
sgdisk --zap-all "$DISK" 2>/dev/null
wipefs -a -f "$DISK" 2>/dev/null
@@ -90,13 +88,13 @@ sgdisk -o "$DISK"
sgdisk -n 1:0:+300M -t 1:ef00 "$DISK"
sgdisk -n 2:0:0 -t 2:8300 "$DISK"
# Attente critique pour que le noyau crée /dev/sda1 et /dev/sda2
# Attente critique pour que le noyau crée les partitions
partprobe "$DISK" 2>/dev/null
udevadm settle
sleep 3
if [ ! -b "$PART_EFI" ] || [ ! -b "$PART_ROOT" ]; then
echo "[ERROR] Les partitions $PART_EFI ou $PART_ROOT n'existent pas après 3 secondes."
echo "[ERROR] Les partitions $PART_EFI ou $PART_ROOT n'existent pas."
lsblk
exit 1
fi
@@ -104,7 +102,6 @@ echo "[OK] Partitions créées : EFI=$PART_EFI, ROOT=$PART_ROOT"
# 5. Formatage et Montage BTRFS optimisé
echo "[INFO] Formatage BTRFS et FAT32..."
# On force le nettoyage des signatures juste avant le formatage pour éviter le "resource busy"
wipefs -a -f "$PART_EFI" 2>/dev/null
wipefs -a -f "$PART_ROOT" 2>/dev/null
sleep 1
@@ -117,6 +114,7 @@ mkdir -p /mnt/boot
mount "$PART_EFI" /mnt/boot
# 6. Installation du système strict minimum et optimisé
# AJOUT DE TOUTES LES DÉPENDANCES DE COMPILATION (pour ghostty, hyprland, paru)
echo "[INFO] Installation des paquets officiels..."
pacstrap /mnt --noconfirm base base-devel linux-zen linux-zen-headers linux-firmware btrfs-progs \
networkmanager sudo git neovim curl wget unzip rsync \
@@ -127,7 +125,8 @@ pacstrap /mnt --noconfirm base base-devel linux-zen linux-zen-headers linux-firm
bluez bluez-utils thunar playerctl \
fastfetch btop htop ncdu yazi lazygit \
rust cargo go zig wayland-protocols scdoc \
fontconfig freetype2 harfbuzz libxkbcommon pkgconf
fontconfig freetype2 harfbuzz libxkbcommon pkgconf \
cmake ninja gcc make gnupg pacman-contrib xcb-util xcb-util-cursor xcb-util-wm xcb-util-keysyms
# 7. Génération fstab optimisée
echo "[INFO] Génération du fstab..."
@@ -138,8 +137,8 @@ echo "[INFO] Configuration du système..."
cat > /mnt/setup.sh << EOF
#!/bin/bash
# Mise à jour de la keyring et du système
echo "[INFO] Mise à jour de la keyring et du système..."
# Mise à jour de la keyring
echo "[INFO] Mise à jour de la keyring..."
pacman -Sy --noconfirm archlinux-keyring
pacman -Su --noconfirm
@@ -168,7 +167,7 @@ useradd -m -G wheel,video,audio,input,storage -s /bin/bash $USERNAME
echo "$USERNAME:$USER_PASS" | chpasswd
sed -i '/^# %wheel ALL=(ALL:ALL) ALL/s/^# //' /etc/sudoers
# Initramfs optimisé avec systemd
# Initramfs optimisé
sed -i 's/^HOOKS=.*/HOOKS=(base systemd autodetect modconf block filesystems keyboard btrfs)/' /etc/mkinitcpio.conf
sed -i 's/^#COMPRESSION="zstd"/COMPRESSION="zstd"/' /etc/mkinitcpio.conf
mkinitcpio -P
@@ -199,15 +198,15 @@ options root=UUID=\$ROOT_UUID rw rootflags=compress=zstd:1 quiet loglevel=3 rd.s
ARCHOPTS
bootctl update
# Services modernes
# Services
systemctl enable NetworkManager
systemctl enable power-profiles-daemon
systemctl enable thermald
systemctl enable acpid
systemctl enable bluetooth
# Configuration SWAP (Fichier d'échange de 4 Go compatible BTRFS)
echo "[INFO] Création d'un swapfile de 4Go..."
# Configuration SWAP (Créée AVANT la compilation pour éviter le Out of Memory)
echo "[INFO] Création d'un swapfile de 4Go (Anti-OOM)..."
truncate -s 0 /swapfile
chattr +C /swapfile
fallocate -l 4G /swapfile
@@ -225,7 +224,7 @@ ExecStart=-/usr/bin/agetty --autologin $USERNAME --noclear %I \$TERM
GETTYCONF
# Configuration AUR (paru)
echo "[INFO] Configuration de sudo sans mot de passe temporaire..."
echo "[INFO] Configuration sudo sans mot de passe temporaire..."
echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/temp
chmod 0440 /etc/sudoers.d/temp
@@ -242,13 +241,14 @@ PARUCONF
chown -R $USERNAME:$USERNAME /home/$USERNAME/.config/paru
echo "[INFO] Compilation de paru..."
yes | sudo -u $USERNAME bash -c "cd /tmp && git clone https://aur.archlinux.org/paru.git && cd paru && makepkg -si --noconfirm --skippgpcheck" || echo "[WARNING] Paru install failed"
sudo -u $USERNAME bash -c "cd /tmp && git clone https://aur.archlinux.org/paru.git && cd paru && makepkg -si --noconfirm --skippgpcheck" || echo "[WARNING] Paru install failed"
if ! command -v paru &> /dev/null; then
echo "[ERROR] paru n'a pas pu être installé."
echo "[ERROR] paru n'a pas pu être installé. Ghostty ne sera pas installé."
else
echo "[INFO] Installation de ghostty et bluetui..."
yes | sudo -u $USERNAME bash -c "paru -S --noconfirm --skipreview ghostty-git bluetui" || echo "[WARNING] Erreur pendant l'install de ghostty/bluetui"
echo "[INFO] Installation de ghostty et bluetui (Cela peut prendre 10-20 minutes et beaucoup de RAM)..."
# --useask permet de mieux gérer les conflits de dépendances
sudo -u $USERNAME paru -S --noconfirm --skipreview --useask ghostty-git bluetui || echo "[WARNING] Erreur pendant l'install de ghostty/bluetui (Vérifiez votre RAM)"
fi
echo "[INFO] Restauration de la sécurité sudo..."
@@ -330,14 +330,7 @@ window#waybar {
WAYBARCSS
cat << 'HYPRCONF' > \$USER_HOME/.config/hypr/hyprland.lua
-- This is an example Hyprland Lua config file.
-- Refer to the wiki for more information.
-- https://wiki.hypr.land/Configuring/Start/
------------------
---- MONITORS ----
------------------
-- Hyprland Lua config
hl.monitor({
output = "",
mode = "preferred",
@@ -345,34 +338,18 @@ hl.monitor({
scale = "auto",
})
---------------------
---- MY PROGRAMS ----
---------------------
local terminal = "ghostty"
local fileManager = "thunar"
local menu = "wofi --show drun"
-------------------
---- AUTOSTART ----
-------------------
hl.on("hyprland.start", function ()
hl.exec_cmd("waybar")
hl.exec_cmd("swaybg -c '#000000'")
end)
-------------------------------
---- ENVIRONMENT VARIABLES ----
-------------------------------
hl.env("XCURSOR_SIZE", "24")
hl.env("HYPRCURSOR_SIZE", "24")
-----------------------
---- LOOK AND FEEL ----
-----------------------
hl.config({
general = {
gaps_in = 5,
@@ -452,10 +429,6 @@ hl.config({
},
})
----------------
---- MISC ----
----------------
hl.config({
misc = {
force_default_wallpaper = -1,
@@ -463,10 +436,6 @@ hl.config({
},
})
---------------
---- INPUT ----
---------------
hl.config({
input = {
kb_layout = "fr",
@@ -488,10 +457,6 @@ hl.gesture({
action = "workspace"
})
---------------------
---- KEYBINDINGS ----
---------------------
local mainMod = "SUPER"
hl.bind(mainMod .. " + Return", hl.dsp.exec_cmd(terminal))
@@ -535,10 +500,6 @@ hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = tr
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true })
--------------------------------
---- WINDOWS AND WORKSPACES ----
--------------------------------
hl.window_rule({
name = "suppress-maximize-events",
match = { class = ".*" },