fix(Calamares): Installater will ask the desktop env before the calamares install
- The installer is still W.I.P
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import calamares 1.0
|
||||
|
||||
Page {
|
||||
id: page
|
||||
title: qsTr("Choix de l'environnement")
|
||||
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 20
|
||||
spacing: 12
|
||||
|
||||
Text {
|
||||
text: qsTr("Choisissez l'environnement de bureau à installer :")
|
||||
font.pixelSize: 20
|
||||
color: "#00d4ff"
|
||||
}
|
||||
|
||||
RadioButton { id: rb_xfce; text: "Xfce"; checked: true; onCheckedChanged: if (checked) saveChoice() }
|
||||
RadioButton { id: rb_kde; text: "KDE"; onCheckedChanged: if (checked) saveChoice() }
|
||||
RadioButton { id: rb_gnome; text: "GNOME"; onCheckedChanged: if (checked) saveChoice() }
|
||||
RadioButton { id: rb_hypr; text: "Hyprland"; onCheckedChanged: if (checked) saveChoice() }
|
||||
|
||||
Button {
|
||||
text: qsTr("Enregistrer le choix")
|
||||
onClicked: saveChoice()
|
||||
}
|
||||
|
||||
function saveChoice() {
|
||||
var choice = rb_xfce.checked ? "xfce" : (rb_kde.checked ? "kde" : (rb_gnome.checked ? "gnome" : "hyprland"))
|
||||
try {
|
||||
calamares.globalStorage.insert("FWS_DESKTOP", choice)
|
||||
} catch (e) {
|
||||
// ignore if unavailable
|
||||
}
|
||||
try {
|
||||
calamares.utils.runCommand("/bin/sh", ["-c", "printf '%s' \"" + choice + "\" > /run/fws-desktop"], true)
|
||||
} catch (e) {
|
||||
// best effort
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,39 @@
|
||||
|
||||
dontChroot: true
|
||||
|
||||
# Timeout par défaut (secondes) appliqué à chaque commande.
|
||||
# La valeur par défaut de Calamares est 30 s — beaucoup trop courte
|
||||
# pour l'installation d'un bureau complet (pacman télécharge des
|
||||
# centaines de Mo). On relève le défaut et on accorde un délai
|
||||
# spécifique très large à la commande d'init du bureau.
|
||||
timeout: 300
|
||||
|
||||
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"'
|
||||
- 'chroot "${ROOT}" /bin/bash "/usr/local/bin/fws-desktop-init-$(cat /run/fws-desktop 2>/dev/null || printf xfce)"'
|
||||
# Installation du bureau choisi : peut être long (réseau + gros DE
|
||||
# comme KDE/GNOME) → 1 h de marge pour ne jamais expirer à tort.
|
||||
#
|
||||
# arch-chroot (et non « chroot » brut) : monte /proc /sys /dev /run et
|
||||
# copie resolv.conf dans la cible. Indispensable, sinon les hooks
|
||||
# post-transaction de pacman (systemd daemon-reload, udev, tmpfiles…)
|
||||
# échouent faute de ces points de montage → pacman sort en code 1
|
||||
# alors même que les téléchargements ont réussi.
|
||||
# Le nom du bureau est validé contre une allow-list (mêmes valeurs que
|
||||
# les scripts fws-desktop-init-* présents) : toute valeur vide / inconnue
|
||||
# / avec espace parasite retombe sur xfce → jamais d'abandon d'install sur
|
||||
# un script d'init manquant.
|
||||
- command: 'd="$(cat /run/fws-desktop 2>/dev/null)"; d="${d%%[[:space:]]*}"; case "$d" in xfce|kde|gnome|hyprland) ;; *) d=xfce ;; esac; arch-chroot "${ROOT}" /bin/bash "/usr/local/bin/fws-desktop-init-$d"'
|
||||
timeout: 3600
|
||||
|
||||
# ── Nettoyage des artefacts « live-only » qui ne doivent PAS persister
|
||||
# sur le système installé (le squashfs du live devient le root cible) ──
|
||||
# 1) Autologin root SANS mot de passe sur tty1 (drop-in getty du live) :
|
||||
# trou de sécurité + conflit avec le display manager sur vt1.
|
||||
- 'rm -rf "${ROOT}/etc/systemd/system/getty@tty1.service.d"'
|
||||
# 2) Provisionnement auto archiso (param noyau script=) : ne doit jamais
|
||||
# tourner sur la machine installée.
|
||||
- 'rm -f "${ROOT}/root/.zlogin" "${ROOT}/root/.automated_script.sh"'
|
||||
|
||||
# Supprime le drop-in archiso (surcharge HOOKS avec des hooks inexistants post-install)
|
||||
- 'rm -f "${ROOT}/etc/mkinitcpio.conf.d/archiso.conf"'
|
||||
|
||||
@@ -6,13 +6,16 @@
|
||||
modules-search: [ local, /usr/lib/calamares/modules ]
|
||||
|
||||
sequence:
|
||||
# NB : pas de module `packagechooser` ici — il n'est pas compilé dans le
|
||||
# paquet calamares (AUR). Le choix du bureau se fait dans le live via
|
||||
# /usr/local/bin/fws-pick-desktop (écrit /run/fws-desktop), validé ensuite
|
||||
# par le job `fws-desktop-choice` ci-dessous.
|
||||
- show:
|
||||
- welcome
|
||||
- locale
|
||||
- keyboard
|
||||
- partition
|
||||
- users
|
||||
- packagechooser
|
||||
- summary
|
||||
- exec:
|
||||
- partition
|
||||
|
||||
Reference in New Issue
Block a user