From f6ee07429b08528ef26f8b9d8d53d30a71f2401c Mon Sep 17 00:00:00 2001 From: fkDeath Date: Wed, 27 May 2026 19:22:42 +0200 Subject: [PATCH] feat(Installer): Add Multi Desktop environnement in the installer to allow the user to choose wich desktop env --- build.sh | 15 +++- .../etc/calamares/modules/desktop.conf | 71 +++++++++++++++++-- .../modules/fws-desktop-choice/main.py | 43 +++++++++++ .../modules/fws-desktop-choice/module.desc | 5 ++ .../etc/calamares/modules/packages.conf | 8 +-- .../etc/calamares/modules/shellprocess.conf | 19 ++--- .../airootfs/etc/calamares/settings.conf | 2 +- .../etc/systemd/system/calamares.service | 12 ++++ .../airootfs/usr/local/bin/calamares-launcher | 33 +++++++++ .../usr/local/bin/fws-desktop-init-common | 68 ++++++++++++++++++ .../usr/local/bin/fws-desktop-init-gnome | 13 ++++ .../usr/local/bin/fws-desktop-init-hyprland | 15 ++++ .../usr/local/bin/fws-desktop-init-kde | 13 ++++ .../usr/local/bin/fws-desktop-init-xfce | 13 ++++ configs/baseline/packages.x86_64 | 4 ++ configs/baseline/profiledef.sh | 6 ++ .../usr/local/bin/fws-desktop-init-common | 8 +++ .../usr/local/bin/fws-desktop-init-gnome | 1 + .../usr/local/bin/fws-desktop-init-hyprland | 1 + .../usr/local/bin/fws-desktop-init-kde | 1 + .../usr/local/bin/fws-desktop-init-xfce | 1 + configs/releng/packages.x86_64 | 4 ++ setup-calamares.sh | 27 ++++++- 23 files changed, 358 insertions(+), 25 deletions(-) create mode 100644 configs/baseline/airootfs/etc/calamares/modules/fws-desktop-choice/main.py create mode 100644 configs/baseline/airootfs/etc/calamares/modules/fws-desktop-choice/module.desc create mode 100644 configs/baseline/airootfs/etc/systemd/system/calamares.service create mode 100644 configs/baseline/airootfs/usr/local/bin/calamares-launcher create mode 100644 configs/baseline/airootfs/usr/local/bin/fws-desktop-init-common create mode 100644 configs/baseline/airootfs/usr/local/bin/fws-desktop-init-gnome create mode 100644 configs/baseline/airootfs/usr/local/bin/fws-desktop-init-hyprland create mode 100644 configs/baseline/airootfs/usr/local/bin/fws-desktop-init-kde create mode 100644 configs/baseline/airootfs/usr/local/bin/fws-desktop-init-xfce diff --git a/build.sh b/build.sh index 3da7f37..784ff71 100644 --- a/build.sh +++ b/build.sh @@ -5,7 +5,16 @@ export MSYS_NO_PATHCONV=1 set -e trap 'echo -e "\e[31mErreur lors de l execution (build.sh).\e[0m"; exit 1' ERR -DISTRO_NAME="Arch" +DISTRO_NAME="${ARCH_WSL_DISTRO:-Arch}" + +# Auto-détection si la distro par défaut est inaccessible +if [ -z "$IN_WSL" ] && ! wsl.exe -d "$DISTRO_NAME" -u root -- echo ok >/dev/null 2>&1; then + for _name in "Arch" "ArchLinux" "archlinux" "arch" "ArchWSL"; do + if wsl.exe -d "$_name" -u root -- echo ok >/dev/null 2>&1; then + DISTRO_NAME="$_name"; break + fi + done +fi if [ -n "$WSL_DISTRO_NAME" ]; then echo -e "\e[36mBuild exécuté depuis WSL ($WSL_DISTRO_NAME) en tant que root...\e[0m" @@ -28,9 +37,9 @@ WORK_DIR="${WORK_DIR_WSL}" echo "==> Dossier de travail : \$WORK_DIR" echo "==> Mise à jour des miroirs et installation de archiso..." -pacman -Sy --noconfirm reflector || true +pacman -Syu --noconfirm reflector || true reflector --verbose --latest 10 --sort rate --save /etc/pacman.d/mirrorlist || true -pacman -Sy --noconfirm archiso +pacman -Syu --noconfirm archiso echo "==> Préparation de l'environnement de build..." rm -rf /tmp/fws-build diff --git a/configs/baseline/airootfs/etc/calamares/modules/desktop.conf b/configs/baseline/airootfs/etc/calamares/modules/desktop.conf index e731b60..3fbc8e7 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/desktop.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/desktop.conf @@ -1,8 +1,65 @@ --- -# Minimal Calamares view module config for desktop selection -# This tells Calamares to use our QML page from the branding folder. -module: view -name: desktop -qml: "branding/fws/desktop.qml" -title: "Choix de l'environnement" -description: "Sélectionne le bureau à installer" +# Module packagechooser : sélection d'environnement de bureau +# Un seul choix possible (boutons radio) + +mode: required +id: desktop + +items: + - id: xfce + packages: [] + name: + - locale: "" + value: "Xfce (Recommandé)" + description: + - locale: "" + value: "Léger, rapide et stable — déjà inclus dans l'ISO, aucun téléchargement." + + - id: kde + packages: + - plasma-meta + - konsole + - dolphin + - sddm + name: + - locale: "" + value: "KDE Plasma" + description: + - locale: "" + value: "Bureau moderne, riche en fonctionnalités et très personnalisable." + + - id: gnome + packages: + - gnome + - gdm + name: + - locale: "" + value: "GNOME" + description: + - locale: "" + value: "Interface épurée centrée sur la productivité." + + - id: hyprland + packages: + - hyprland + - xdg-desktop-portal-hyprland + - xdg-desktop-portal-gtk + - waybar + - wofi + - kitty + - swaybg + - swayidle + - swaylock + - xorg-xwayland + - wl-clipboard + - grim + - slurp + - qt5-wayland + - qt6-wayland + - sddm + name: + - locale: "" + value: "Hyprland" + description: + - locale: "" + value: "Compositeur Wayland dynamique — tiling Wayland (utilisateurs avancés)." diff --git a/configs/baseline/airootfs/etc/calamares/modules/fws-desktop-choice/main.py b/configs/baseline/airootfs/etc/calamares/modules/fws-desktop-choice/main.py new file mode 100644 index 0000000..02ea0b7 --- /dev/null +++ b/configs/baseline/airootfs/etc/calamares/modules/fws-desktop-choice/main.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 +""" +Calamares job : lit le choix de bureau depuis GlobalStorage +(packagechooser_desktop) et l'écrit dans /run/fws-desktop pour +que shellprocess puisse appeler le bon fws-desktop-init-*. +""" +import libcalamares + +VALID_DESKTOPS = {"xfce", "kde", "gnome", "hyprland"} +FALLBACK = "xfce" + + +def pretty_name(): + return "Sauvegarde du choix d'environnement de bureau" + + +def run(): + gs = libcalamares.globalstorage + + raw = gs.value("packagechooser_desktop") + + # packagechooser peut renvoyer une str ou une liste selon la version + if isinstance(raw, list): + choice = raw[0] if raw else FALLBACK + elif isinstance(raw, str): + choice = raw.strip() + else: + choice = FALLBACK + + if choice not in VALID_DESKTOPS: + choice = FALLBACK + + try: + with open("/run/fws-desktop", "w") as fh: + fh.write(choice) + except OSError as exc: + return ( + "Impossible d'écrire /run/fws-desktop", + f"{exc}\nLe bureau sera xfce par défaut.", + ) + + libcalamares.utils.debug(f"fws-desktop-choice : bureau sélectionné = {choice}") + return None diff --git a/configs/baseline/airootfs/etc/calamares/modules/fws-desktop-choice/module.desc b/configs/baseline/airootfs/etc/calamares/modules/fws-desktop-choice/module.desc new file mode 100644 index 0000000..b01a8f9 --- /dev/null +++ b/configs/baseline/airootfs/etc/calamares/modules/fws-desktop-choice/module.desc @@ -0,0 +1,5 @@ +--- +type: "job" +name: "fws-desktop-choice" +interface: "python" +script: "main.py" diff --git a/configs/baseline/airootfs/etc/calamares/modules/packages.conf b/configs/baseline/airootfs/etc/calamares/modules/packages.conf index 8aefcd2..4f4e179 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/packages.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/packages.conf @@ -1,13 +1,11 @@ --- -# Étape post-unpackfs : retire les paquets live-only. -# Tous les paquets utiles sont déjà dans le squashfs. -# Pas besoin d'installer quoi que ce soit depuis internet. - backend: pacman -update_db: false +update_db: true update_system: false operations: + - install: + - packagechooser_desktop - remove: - calamares - kpmcore diff --git a/configs/baseline/airootfs/etc/calamares/modules/shellprocess.conf b/configs/baseline/airootfs/etc/calamares/modules/shellprocess.conf index 2064ce4..ca99ecf 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/shellprocess.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/shellprocess.conf @@ -1,21 +1,24 @@ --- # Exécuté HORS chroot (live system) pour accéder à l'ISO montée. -# But : restaurer le kernel (retiré du squashfs par mkarchiso) et -# corriger les fichiers mkinitcpio archiso-spécifiques. +# But : restaurer le kernel, détecter le bureau installé, lancer son init. dontChroot: true script: # Copie le kernel depuis l'ISO vers /boot du système cible - 'cp "$(find /run/archiso/bootmnt -name vmlinuz-linux 2>/dev/null | head -1)" "${ROOT}/boot/vmlinuz-linux"' - - 'DESKTOP="$(cat /run/fws-desktop 2>/dev/null || printf xfce)"' - - 'if [ -z "$DESKTOP" ]; then DESKTOP="xfce"; fi' - - 'if [ ! -f "${ROOT}/usr/local/bin/fws-desktop-init-$DESKTOP" ]; then echo "Script bureau introuvable: $DESKTOP" >&2; exit 1; fi' - - 'chroot "${ROOT}" /bin/bash "/usr/local/bin/fws-desktop-init-$DESKTOP"' - # Supprime le drop-in archiso (surcharge HOOKS avec des hooks inexistants post-install) + # Détecte le bureau installé en vérifiant les binaires présents dans la cible. + # (packagechooser a déjà installé les paquets via le module packages) + # Xfce est toujours présent (squashfs) donc on le garde en fallback. + - 'if [ -f "${ROOT}/usr/bin/plasmashell" ]; then DESKTOP=kde; elif [ -f "${ROOT}/usr/bin/gnome-shell" ]; then DESKTOP=gnome; elif [ -f "${ROOT}/usr/bin/hyprland" ]; then DESKTOP=hyprland; else DESKTOP=xfce; fi' + + # Lance le script d'initialisation du bureau choisi + - 'if [ ! -f "${ROOT}/usr/local/bin/fws-desktop-init-${DESKTOP}" ]; then echo "Script introuvable pour le bureau: ${DESKTOP}" >&2; exit 1; fi' + - 'chroot "${ROOT}" /bin/bash "/usr/local/bin/fws-desktop-init-${DESKTOP}"' + + # Supprime le drop-in archiso (surcharge HOOKS inexistants post-install) - 'rm -f "${ROOT}/etc/mkinitcpio.conf.d/archiso.conf"' # Remplace le linux.preset archiso par le preset standard (default + fallback) - # \x27 = ' et \x22 = " pour éviter les conflits de quotes dans YAML/bash - 'printf "PRESETS=(\x27default\x27 \x27fallback\x27)\nALL_kver=\x22/boot/vmlinuz-linux\x22\nALL_config=\x22/etc/mkinitcpio.conf\x22\nALL_microcode=(/boot/*-ucode.img)\ndefault_image=\x22/boot/initramfs-linux.img\x22\nfallback_image=\x22/boot/initramfs-linux-fallback.img\x22\nfallback_options=\x22-S autodetect\x22\n" > "${ROOT}/etc/mkinitcpio.d/linux.preset"' diff --git a/configs/baseline/airootfs/etc/calamares/settings.conf b/configs/baseline/airootfs/etc/calamares/settings.conf index 6775d1b..f0b697f 100644 --- a/configs/baseline/airootfs/etc/calamares/settings.conf +++ b/configs/baseline/airootfs/etc/calamares/settings.conf @@ -12,7 +12,7 @@ sequence: - keyboard - partition - users - - desktop + - packagechooser@desktop - summary - exec: - partition diff --git a/configs/baseline/airootfs/etc/systemd/system/calamares.service b/configs/baseline/airootfs/etc/systemd/system/calamares.service new file mode 100644 index 0000000..389e921 --- /dev/null +++ b/configs/baseline/airootfs/etc/systemd/system/calamares.service @@ -0,0 +1,12 @@ +[Unit] +Description=FWS Installer (Calamares) +After=display-manager.service +Requires=display-manager.service + +[Service] +Type=simple +ExecStartPre=/bin/sh -c 'DISPLAY=:0 xhost +local:root 2>/dev/null || true' +ExecStart=/usr/bin/calamares + +[Install] +WantedBy=graphical.target diff --git a/configs/baseline/airootfs/usr/local/bin/calamares-launcher b/configs/baseline/airootfs/usr/local/bin/calamares-launcher new file mode 100644 index 0000000..3dfcdf3 --- /dev/null +++ b/configs/baseline/airootfs/usr/local/bin/calamares-launcher @@ -0,0 +1,33 @@ +#!/bin/bash +# Sélection de l'environnement de bureau AVANT le démarrage de Calamares. +# Les services systemd n'héritent pas de $DISPLAY — on force :0 (session Xorg live). + +export DISPLAY=":0" + +DESKTOP="xfce" # valeur par défaut si zenity échoue + +CHOICE=$(zenity \ + --list \ + --title="FWS — Environnement de bureau" \ + --text="Quel environnement de bureau souhaitez-vous installer ?" \ + --column="Environnement" \ + --column="Description" \ + --width=580 \ + --height=340 \ + "Xfce (Recommandé)" "Léger et rapide — idéal pour tous les systèmes" \ + "KDE Plasma" "Moderne, riche en fonctionnalités et personnalisable" \ + "GNOME" "Interface épurée centrée sur la productivité" \ + "Hyprland" "Compositeur Wayland dynamique (utilisateurs avancés)" \ + 2>/dev/null) || true + +case "${CHOICE:-}" in + "Xfce (Recommandé)") DESKTOP="xfce" ;; + "KDE Plasma") DESKTOP="kde" ;; + "GNOME") DESKTOP="gnome" ;; + "Hyprland") DESKTOP="hyprland" ;; + *) DESKTOP="xfce" ;; +esac + +printf '%s' "$DESKTOP" > /run/fws-desktop + +exec /usr/bin/calamares "$@" diff --git a/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-common b/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-common new file mode 100644 index 0000000..9e00ec4 --- /dev/null +++ b/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-common @@ -0,0 +1,68 @@ +#!/bin/bash +set -euo pipefail + +fws_first_user() { + awk -F: '$3 >= 1000 && $1 != "nobody" { print $1; exit }' /etc/passwd +} + +fws_install_packages() { + pacman -Sy --noconfirm --needed "$@" +} + +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_write_dmrc() { + local user_name="$1" + local session_name="$2" + + if [ -n "$user_name" ] && [ -d "/home/$user_name" ]; then + printf '[Desktop]\nSession=%s\n' "$session_name" > "/home/$user_name/.dmrc" + fi +} + +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 +} + +# Paquets installés par défaut sur tous les bureaux +fws_install_base_apps() { + fws_install_packages firefox libreoffice-fresh mariadb mariadb-clients + # Initialise la base de données MariaDB + mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql \ + >/dev/null 2>&1 || true + fws_enable_services mariadb.service +} diff --git a/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-gnome b/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-gnome new file mode 100644 index 0000000..c275eb0 --- /dev/null +++ b/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-gnome @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail + +. /usr/local/bin/fws-desktop-init-common + +first_user="$(fws_first_user)" + +fws_install_base_apps +fws_install_packages gnome sddm +fws_disable_services lightdm.service gdm.service +fws_enable_services sddm.service +fws_write_sddm_config "$first_user" gnome +fws_write_dmrc "$first_user" gnome diff --git a/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-hyprland b/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-hyprland new file mode 100644 index 0000000..9eef460 --- /dev/null +++ b/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-hyprland @@ -0,0 +1,15 @@ +#!/bin/bash +set -euo pipefail + +. /usr/local/bin/fws-desktop-init-common + +first_user="$(fws_first_user)" + +fws_install_base_apps +fws_install_packages hyprland xdg-desktop-portal-hyprland xdg-desktop-portal-gtk \ + waybar wofi kitty swaybg swayidle swaylock xorg-xwayland wl-clipboard \ + grim slurp qt5-wayland qt6-wayland sddm +fws_disable_services lightdm.service gdm.service +fws_enable_services sddm.service +fws_write_sddm_config "$first_user" hyprland +fws_write_dmrc "$first_user" hyprland diff --git a/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-kde b/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-kde new file mode 100644 index 0000000..0163645 --- /dev/null +++ b/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-kde @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail + +. /usr/local/bin/fws-desktop-init-common + +first_user="$(fws_first_user)" + +fws_install_base_apps +fws_install_packages plasma-meta konsole dolphin sddm +fws_disable_services lightdm.service gdm.service +fws_enable_services sddm.service +fws_write_sddm_config "$first_user" plasma +fws_write_dmrc "$first_user" plasma diff --git a/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-xfce b/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-xfce new file mode 100644 index 0000000..55dbfbc --- /dev/null +++ b/configs/baseline/airootfs/usr/local/bin/fws-desktop-init-xfce @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail + +. /usr/local/bin/fws-desktop-init-common + +first_user="$(fws_first_user)" + +fws_install_base_apps +fws_install_packages xfce4 xfce4-goodies lightdm lightdm-gtk-greeter +fws_disable_services sddm.service gdm.service +fws_enable_services lightdm.service +fws_write_lightdm_config "$first_user" xfce +fws_write_dmrc "$first_user" xfce diff --git a/configs/baseline/packages.x86_64 b/configs/baseline/packages.x86_64 index 4c85b8f..896e219 100644 --- a/configs/baseline/packages.x86_64 +++ b/configs/baseline/packages.x86_64 @@ -106,6 +106,10 @@ kpmcore qt5-base qt5-svg qt6-base +# Dépendances runtime du module packagechooser de Calamares +kcoreaddons +ki18n +kwidgetsaddons # --- Agents VM (pratique pour tester l'ISO) --- qemu-guest-agent diff --git a/configs/baseline/profiledef.sh b/configs/baseline/profiledef.sh index 68c1c64..06e20f6 100644 --- a/configs/baseline/profiledef.sh +++ b/configs/baseline/profiledef.sh @@ -16,4 +16,10 @@ airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-b' '1M' '-Xdict-size' bootstrap_tarball_compression=(xz -9e) file_permissions=( ["/etc/shadow"]="0:0:400" + ["/usr/local/bin/calamares-launcher"]="0:0:755" + ["/usr/local/bin/fws-desktop-init-common"]="0:0:755" + ["/usr/local/bin/fws-desktop-init-xfce"]="0:0:755" + ["/usr/local/bin/fws-desktop-init-kde"]="0:0:755" + ["/usr/local/bin/fws-desktop-init-gnome"]="0:0:755" + ["/usr/local/bin/fws-desktop-init-hyprland"]="0:0:755" ) diff --git a/configs/releng/airootfs/usr/local/bin/fws-desktop-init-common b/configs/releng/airootfs/usr/local/bin/fws-desktop-init-common index c52910b..bb3b3cf 100644 --- a/configs/releng/airootfs/usr/local/bin/fws-desktop-init-common +++ b/configs/releng/airootfs/usr/local/bin/fws-desktop-init-common @@ -53,4 +53,12 @@ fws_write_sddm_config() { 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 +} + +# Paquets installés par défaut sur tous les bureaux +fws_install_base_apps() { + fws_install_packages firefox libreoffice-fresh mariadb mariadb-clients + mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql \ + >/dev/null 2>&1 || true + fws_enable_services mariadb.service } \ No newline at end of file diff --git a/configs/releng/airootfs/usr/local/bin/fws-desktop-init-gnome b/configs/releng/airootfs/usr/local/bin/fws-desktop-init-gnome index 4d3ed8b..784efef 100644 --- a/configs/releng/airootfs/usr/local/bin/fws-desktop-init-gnome +++ b/configs/releng/airootfs/usr/local/bin/fws-desktop-init-gnome @@ -5,6 +5,7 @@ set -euo pipefail first_user="$(fws_first_user)" +fws_install_base_apps fws_install_packages gnome sddm fws_disable_services lightdm.service gdm.service fws_enable_services sddm.service diff --git a/configs/releng/airootfs/usr/local/bin/fws-desktop-init-hyprland b/configs/releng/airootfs/usr/local/bin/fws-desktop-init-hyprland index 8370387..a4b80a2 100644 --- a/configs/releng/airootfs/usr/local/bin/fws-desktop-init-hyprland +++ b/configs/releng/airootfs/usr/local/bin/fws-desktop-init-hyprland @@ -5,6 +5,7 @@ set -euo pipefail first_user="$(fws_first_user)" +fws_install_base_apps fws_install_packages hyprland xdg-desktop-portal-hyprland xdg-desktop-portal-gtk waybar wofi kitty swaybg swayidle swaylock xorg-xwayland wl-clipboard grim slurp qt5-wayland qt6-wayland sddm fws_disable_services lightdm.service gdm.service fws_enable_services sddm.service diff --git a/configs/releng/airootfs/usr/local/bin/fws-desktop-init-kde b/configs/releng/airootfs/usr/local/bin/fws-desktop-init-kde index 1a0d32e..4fd4a98 100644 --- a/configs/releng/airootfs/usr/local/bin/fws-desktop-init-kde +++ b/configs/releng/airootfs/usr/local/bin/fws-desktop-init-kde @@ -5,6 +5,7 @@ set -euo pipefail first_user="$(fws_first_user)" +fws_install_base_apps fws_install_packages plasma-meta konsole dolphin sddm fws_disable_services lightdm.service gdm.service fws_enable_services sddm.service diff --git a/configs/releng/airootfs/usr/local/bin/fws-desktop-init-xfce b/configs/releng/airootfs/usr/local/bin/fws-desktop-init-xfce index ba868ff..6d5f84b 100644 --- a/configs/releng/airootfs/usr/local/bin/fws-desktop-init-xfce +++ b/configs/releng/airootfs/usr/local/bin/fws-desktop-init-xfce @@ -5,6 +5,7 @@ set -euo pipefail first_user="$(fws_first_user)" +fws_install_base_apps fws_install_packages xfce4 xfce4-goodies lightdm lightdm-gtk-greeter fws_disable_services sddm.service gdm.service fws_enable_services lightdm.service diff --git a/configs/releng/packages.x86_64 b/configs/releng/packages.x86_64 index f94ce57..ab2356c 100644 --- a/configs/releng/packages.x86_64 +++ b/configs/releng/packages.x86_64 @@ -105,6 +105,10 @@ kpmcore qt5-base qt5-svg qt6-base +# Dépendances runtime du module packagechooser de Calamares +kcoreaddons +ki18n +kwidgetsaddons # --- Agents VM (pratique pour tester l'ISO) --- qemu-guest-agent diff --git a/setup-calamares.sh b/setup-calamares.sh index 1429195..dcad142 100644 --- a/setup-calamares.sh +++ b/setup-calamares.sh @@ -50,7 +50,7 @@ fi # Vérifications # ============================================================ command -v pacman >/dev/null || error "pacman introuvable (lance depuis Arch / WSL)" -[ "$EUID" -eq 0 ] || exec su -c "bash $0" root +[ "$EUID" -eq 0 ] || exec su -c "bash '$0'" root success "Arch Linux (root) ✓" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -120,6 +120,31 @@ for pkg in "${AUR_PACKAGES[@]}"; do su - "$BUILD_USER" -c "git clone https://aur.archlinux.org/${pkg}.git $BUILD_DIR/$pkg" \ || error "Clonage $pkg échoué" + # Patch spécifique au paquet calamares : + # — s'assurer que packagechooser n'est pas dans SKIP_MODULES + # — s'assurer que le support Python est activé + if [ "$pkg" = "calamares" ]; then + info "Patch du PKGBUILD calamares (activation packagechooser)…" + + PKGBUILD_FILE="$BUILD_DIR/$pkg/PKGBUILD" + + # Dépendances de build pour packagechooser + pacman -S --needed --noconfirm extra-cmake-modules kcoreaddons ki18n kwidgetsaddons + + # Le PKGBUILD utilise un tableau bash : local _skip_modules=(... packagechooser ...) + # On supprime simplement les mots du fichier, quelle que soit la structure. + sed -i -E 's/\bpackagechooserq\b[[:space:]]?//g' "$PKGBUILD_FILE" + sed -i -E 's/\bpackagechooser\b[[:space:]]?//g' "$PKGBUILD_FILE" + + # Vérification + if grep -qE '\bpackagechooser' "$PKGBUILD_FILE"; then + warn "packagechooser encore présent dans le PKGBUILD !" + grep -n 'packagechooser' "$PKGBUILD_FILE" + else + success "packagechooser retiré du SKIP_MODULES ✓" + fi + fi + info "Build $pkg (peut prendre plusieurs minutes)…" su - "$BUILD_USER" -c "cd $BUILD_DIR/$pkg && makepkg -s --noconfirm" \ || error "Build $pkg échoué"