refactor(Anaconda)! : Changing the installator to Anaconda

'cause Calamares is a way to difficult for what we want and we want to try something else
This commit is contained in:
2026-06-12 23:30:29 +02:00
parent 98d47d497c
commit 05ae9c36c3
53 changed files with 0 additions and 1481 deletions
@@ -1,107 +0,0 @@
#!/bin/bash
# ============================================================
# FWS Linux — fws-installer
# Script de lancement de Calamares
# ============================================================
set -euo pipefail
# Vérifie que Calamares est installé
if ! command -v calamares >/dev/null 2>&1; then
echo "ERREUR : calamares n'est pas installé."
exit 1
fi
# Vérifie qu'on tourne bien en live
if [ ! -d /run/archiso ]; then
echo "ATTENTION : Ce script doit être lancé depuis le live FWS."
fi
choose_desktop() {
local selection
if command -v zenity >/dev/null 2>&1; then
selection=$(zenity --list \
--title="Choix de l'environnement" \
--width=520 \
--height=320 \
--radiolist \
--print-column=2 \
--column="Choisir" --column="Environnement" --column="Description" \
TRUE "xfce" "Léger et classique" \
FALSE "kde" "KDE Plasma" \
FALSE "gnome" "GNOME" \
FALSE "hyprland" "Wayland / Hyprland" \
--text="Sélectionne l'environnement desktop à installer") || exit 1
printf '%s' "$selection"
return 0
fi
printf 'xfce'
}
DESKTOP="${FWS_DESKTOP:-xfce}"
DESKTOP_EXPLICIT=0
CALAMARES_ARGS=()
while [ "$#" -gt 0 ]; do
case "$1" in
-d|--desktop)
shift
DESKTOP="${1:-xfce}"
DESKTOP_EXPLICIT=1
;;
--desktop=*)
DESKTOP="${1#*=}"
DESKTOP_EXPLICIT=1
;;
*)
CALAMARES_ARGS+=("$1")
;;
esac
shift || true
done
if [ "$DESKTOP_EXPLICIT" -eq 0 ] && [ -z "${FWS_DESKTOP:-}" ]; then
DESKTOP="$(choose_desktop)"
fi
case "$DESKTOP" in
xfce|kde|gnome|hyprland)
export FWS_DESKTOP="$DESKTOP"
;;
*)
echo "Environnement invalide: $DESKTOP"
exit 1
;;
esac
# Lance Calamares avec les droits root
# -D6 active les logs de debug (retirer en production)
if [ "$EUID" -ne 0 ]; then
if command -v sudo >/dev/null 2>&1; then
# Persist the chosen desktop for Calamares (read by shellprocess before chroot)
if [ -n "${FWS_DESKTOP:-}" ]; then
mkdir -p /run
printf '%s' "$FWS_DESKTOP" > /run/fws-desktop
fi
exec sudo -E calamares "${CALAMARES_ARGS[@]}"
elif command -v pkexec >/dev/null 2>&1; then
if [ -n "${FWS_DESKTOP:-}" ]; then
mkdir -p /run
printf '%s' "$FWS_DESKTOP" > /run/fws-desktop
fi
exec pkexec calamares "${CALAMARES_ARGS[@]}"
else
echo "ERREUR : Impossible de lancer Calamares en tant que root (sudo/pkexec non trouvés)."
exit 1
fi
else
if [ -n "${FWS_DESKTOP:-}" ]; then
mkdir -p /run
printf '%s' "$FWS_DESKTOP" > /run/fws-desktop
fi
exec calamares "${CALAMARES_ARGS[@]}"
fi
@@ -1,96 +0,0 @@
#!/bin/bash
set -euo pipefail
fws_first_user() {
awk -F: '$3 >= 1000 && $1 != "nobody" { print $1; exit }' /etc/passwd
}
FWS_LOG=/var/log/fws-desktop-init.log
# Paquets communs à TOUS les bureaux graphiques. La cible de base n'installe
# rien de tout ça (packages.conf ne fait que des « remove »), donc chaque
# bureau doit les tirer explicitement : audio (PipeWire), applet réseau NM,
# accès volumes (gvfs), dossiers utilisateur, trousseau, polices (dont emoji).
# (Xfce a déjà sa propre liste complète et n'utilise pas ce tableau.)
FWS_BASE_PACKAGES=(
pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol
networkmanager network-manager-applet
gvfs gvfs-mtp gvfs-gphoto2 gvfs-smb
xdg-user-dirs xdg-user-dirs-gtk xdg-utils
gnome-keyring libsecret polkit
noto-fonts noto-fonts-emoji ttf-dejavu ttf-liberation
)
fws_install_packages() {
# NE PAS faire « pacman -Sy <paquets> » : rafraîchir les bases sans
# upgrader le système (partial upgrade) provoque des « conflicting
# files » / dépendances cassées → pacman sort en code 1.
#
# 1) Rafraîchit d'abord archlinux-keyring (seule exception admise au
# partial upgrade) : son hook relance pacman-key --populate et évite
# les erreurs de signature dans le chroot.
pacman -Sy --noconfirm --needed archlinux-keyring 2>&1 | tee -a "$FWS_LOG" || true
# 2) -Syu COMPLET. On désactive CheckSpace à la volée via une conf
# temporaire (process substitution) : le calcul d'espace est non
# fiable pendant une install en chroot et peut faire échouer pacman.
# La conf du système installé (/etc/pacman.conf) reste intacte.
# --noconfirm sélectionne le provider par défaut (ex.
# qt6-multimedia-ffmpeg) sans bloquer sur une saisie.
if ! pacman --config <(sed 's/^[[:space:]]*CheckSpace/#CheckSpace/' /etc/pacman.conf) \
-Syu --noconfirm --needed "$@" 2>&1 | tee -a "$FWS_LOG"; then
# Surface l'erreur réelle (sinon noyée/tronquée dans la boîte
# Calamares). Tout est aussi conservé dans $FWS_LOG sur la cible.
echo "" >&2
echo "######## ÉCHEC pacman — log complet : $FWS_LOG (système installé) ########" >&2
echo "######## Lignes d'erreur détectées : ########" >&2
grep -iE "error|conflicting|exists in filesystem|no space|impossible|introuvable|failed" \
"$FWS_LOG" | tail -n 25 >&2
echo "#########################################################################" >&2
return 1
fi
}
fws_enable_services() {
for service in "$@"; do
systemctl enable "$service" >/dev/null 2>&1 || true
done
}
fws_disable_services() {
for service in "$@"; do
systemctl disable "$service" >/dev/null 2>&1 || true
done
}
fws_set_graphical_default() {
# Système installé : démarrer en mode graphique (lance le display manager).
# Idempotent ; le défaut systemd est déjà graphical.target mais on le rend
# explicite pour ne dépendre d'aucun héritage du squashfs archiso.
systemctl set-default graphical.target >/dev/null 2>&1 || true
}
fws_write_lightdm_config() {
local user_name="$1"
local session_name="$2"
if [ -z "$user_name" ]; then
return 0
fi
mkdir -p /etc/lightdm/lightdm.conf.d
printf '[Seat:*]\nautologin-user=%s\nautologin-user-timeout=0\nuser-session=%s\nautologin-session=%s\ngreeter-hide-users=true\nallow-guest=false\n' "$user_name" "$session_name" "$session_name" > /etc/lightdm/lightdm.conf.d/50-fws.conf
}
fws_write_sddm_config() {
local user_name="$1"
local session_name="$2"
if [ -z "$user_name" ]; then
return 0
fi
mkdir -p /etc/sddm.conf.d
printf '[Autologin]\nUser=%s\nSession=%s.desktop\nRelogin=false\n' "$user_name" "$session_name" > /etc/sddm.conf.d/50-fws.conf
}
@@ -1,12 +0,0 @@
#!/bin/bash
set -euo pipefail
. /usr/local/bin/fws-desktop-init-common
first_user="$(fws_first_user)"
fws_install_packages "${FWS_BASE_PACKAGES[@]}" gnome sddm
fws_disable_services lightdm.service gdm.service
fws_enable_services sddm.service
fws_set_graphical_default
fws_write_sddm_config "$first_user" gnome
@@ -1,50 +0,0 @@
#!/bin/bash
set -euo pipefail
. /usr/local/bin/fws-desktop-init-common
first_user="$(fws_first_user)"
# Config Hyprland minimale + autostart (agent polkit, barre, applet réseau,
# notifications). Sans config ni agent polkit, la session est inutilisable
# pour un non-technicien (pas de raccourcis, pas d'élévation de privilèges GUI).
fws_write_hyprland_config() {
local user_name="$1"
[ -n "$user_name" ] && [ -d "/home/$user_name" ] || return 0
local cfg_dir="/home/$user_name/.config/hypr"
install -d -m 755 "$cfg_dir"
if [ -f /usr/share/hypr/hyprland.conf ]; then
cp -f /usr/share/hypr/hyprland.conf "$cfg_dir/hyprland.conf"
else
cat > "$cfg_dir/hyprland.conf" <<'EOF'
$terminal = kitty
$menu = wofi --show drun
bind = SUPER, Q, exec, $terminal
bind = SUPER, R, exec, $menu
bind = SUPER, C, killactive
bind = SUPER, M, exit
EOF
fi
cat >> "$cfg_dir/hyprland.conf" <<'EOF'
# ── FWS : démarrage automatique de la session ──
exec-once = systemctl --user start hyprpolkitagent
exec-once = waybar
exec-once = nm-applet --indicator
exec-once = mako
EOF
chown -R "$user_name:$user_name" "/home/$user_name/.config"
}
# PipeWire/applet NM/polices viennent de FWS_BASE_PACKAGES ; hyprpolkitagent
# fournit l'agent d'authentification polkit pour Wayland/Hyprland.
fws_install_packages "${FWS_BASE_PACKAGES[@]}" \
hyprland xdg-desktop-portal-hyprland xdg-desktop-portal-gtk \
waybar wofi kitty mako swaybg swayidle swaylock \
xorg-xwayland wl-clipboard grim slurp \
qt5-wayland qt6-wayland hyprpolkitagent sddm
fws_disable_services lightdm.service gdm.service
fws_enable_services sddm.service
fws_set_graphical_default
fws_write_sddm_config "$first_user" hyprland
fws_write_hyprland_config "$first_user"
@@ -1,12 +0,0 @@
#!/bin/bash
set -euo pipefail
. /usr/local/bin/fws-desktop-init-common
first_user="$(fws_first_user)"
fws_install_packages "${FWS_BASE_PACKAGES[@]}" plasma-meta konsole dolphin sddm
fws_disable_services lightdm.service gdm.service
fws_enable_services sddm.service
fws_set_graphical_default
fws_write_sddm_config "$first_user" plasma
@@ -1,26 +0,0 @@
#!/bin/bash
set -euo pipefail
. /usr/local/bin/fws-desktop-init-common
first_user="$(fws_first_user)"
fws_install_packages \
xfce4 xfce4-goodies \
lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings \
gvfs gvfs-mtp gvfs-gphoto2 gvfs-smb gvfs-nfs \
pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol \
network-manager-applet \
xfce-polkit \
xdg-user-dirs xdg-user-dirs-gtk xdg-utils \
gnome-keyring libsecret \
noto-fonts noto-fonts-emoji ttf-dejavu ttf-liberation \
ffmpegthumbnailer tumbler \
blueman \
xorg-server xorg-xinit xorg-xrandr arandr \
accountsservice \
upower
fws_disable_services sddm.service gdm.service
fws_enable_services lightdm.service
fws_set_graphical_default
fws_write_lightdm_config "$first_user" xfce
@@ -1,41 +0,0 @@
#!/bin/bash
# ============================================================
# FWS — Sélecteur d'environnement de bureau (LIVE uniquement)
#
# Le paquet calamares (AUR) ne compile PAS le module packagechooser :
# on choisit donc le bureau ICI, dans le live, AVANT de lancer Calamares.
# Le choix est écrit dans /run/fws-desktop, lu ensuite par :
# - le module Calamares fws-desktop-choice (validation),
# - shellprocess.conf → /usr/local/bin/fws-desktop-init-<bureau>.
# ============================================================
set -u
STATE=/run/fws-desktop
DEFAULT=xfce
VALID_RE='^(xfce|kde|gnome|hyprland)$'
choice=""
# Dialogue graphique si zenity + X sont disponibles ; sinon repli silencieux.
if command -v zenity >/dev/null 2>&1 && [ -n "${DISPLAY:-}" ]; then
choice="$(zenity --list --radiolist \
--title="FWS — Environnement de bureau" \
--text="Choisissez le bureau à installer :" \
--width=560 --height=360 \
--column="Choix" --column="id" --column="Bureau" \
--hide-column=2 --print-column=2 \
TRUE xfce "Xfce — léger, stable et rapide (recommandé)" \
FALSE kde "KDE Plasma — moderne et très personnalisable" \
FALSE gnome "GNOME — épuré et intuitif" \
FALSE hyprland "Hyprland — compositeur Wayland dynamique" \
2>/dev/null)"
fi
# Normalisation : toute valeur vide / annulée / invalide → bureau par défaut.
choice="$(printf '%s' "$choice" | tr -d '[:space:]')"
if ! printf '%s' "$choice" | grep -Eq "$VALID_RE"; then
choice="$DEFAULT"
fi
printf '%s' "$choice" > "$STATE"
exit 0
@@ -1,13 +0,0 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=Installer FWS Linux
Name[fr]=Installer FWS Linux
Comment=Installe FWS Linux sur votre machine
Comment[fr]=Installe FWS Linux sur votre machine
Exec=fws-installer
Icon=/etc/calamares/branding/fws/logo.png
Terminal=false
Categories=System;
Keywords=install;installer;fws;calamares;
StartupNotify=true