36 Commits
Author SHA1 Message Date
BlackAngelTV 1b59e5e5ab Chore(PacManager): Update to 1.6.2
Update to 1.6.2 for new update system
2026-10-30 20:20:03 +01:00
BlackAngelTV c27ae55587 Merge pull request 'Feat/pacmanager replaces winboat' (#23) from feat/pacmanager-replaces-winboat into Main
Reviewed-on: #23
2026-10-30 11:31:25 +00:00
BlackAngelTV a7f3f48884 chore(Agents): Add new Agents.md 2026-10-30 12:26:57 +01:00
BlackAngelTV 318233fbb3 refactor(airootfs): drop WinBoat from the installer and hardware texts
The install summary, the hardware setup header and the About dialog still
announced Windows apps through WinBoat. They now name PacManager, which is the
package the image actually ships.
2026-10-30 10:06:42 +01:00
BlackAngelTV 0ef6087eb8 docs: describe PacManager in place of WinBoat
The quick start, changelog, attribution notice, license inventory and trademark
page all still advertised WinBoat. PacManager is first-party FWS software under a
restrictive source-available license, so it is documented outside the
third-party tables, and the install path is described because that directory is
what makes its automatic updates possible.
2026-10-30 10:06:42 +01:00
BlackAngelTV 92bd93141a refactor(packages): replace winboat-bin with fws-pacmanage
WinBoat went unused, so both ISO profiles now list PacManager instead.
fws-pacmanage is built locally like the other FWS packages, so it joins the
local build order in setup-aur.sh rather than the AUR package list.
2026-10-30 10:06:42 +01:00
BlackAngelTV f2ddb9603f feat(pkgbuilds): package PacManager 1.6.0 for the FWS image
PacManager ships only sources from its Gitea releases, so the image needs a
recipe to carry the compiled app. It is installed under a dedicated
/opt/fws-pacmanage prefix because its self-update rewrites the directory of the
running binary: a bare bin/ install would drop a `version` marker and a
`plugins/` folder straight into /usr/bin. The upstream CMakeLists also declares
its plugin install rules above the FWS_BUILD_*_PLUGIN options, so the Flatpak
and AUR providers are installed by hand into that same directory.
2026-10-30 10:06:42 +01:00
BlackAngelTV a1201a2664 fix(fastfetch): keep the standard information beside the logo
A config file replaces fastfetch's default module structure, so the FWS logo
was printed alone: no OS, kernel, CPU or disk lines at all. List the default
modules explicitly so the output looks like a normal fastfetch call, with the
FWS logo on the left and the machine's real information on the right; OS: comes
from /etc/os-release and therefore reads "FWS Linux", not "Arch Linux".
2026-10-29 21:42:46 +01:00
BlackAngelTV 57cf6d1937 Merge pull request 'fix(build): install the pyanaconda overlays after pacstrap' (#22) from fix/anaconda-overlay into Main
Reviewed-on: #22
2026-10-29 20:22:52 +00:00
BlackAngelTV 157dfc07cb fix(build): install the pyanaconda overlays after pacstrap
mkarchiso copies the profile airootfs before it installs packages, so shipping
files that replace files owned by the anaconda package aborted the build with
"exists in filesystem" and unpacstrapped root. Keep the two overlays in a
staging directory outside the package paths and copy them from
customize_airootfs.sh, which runs after pacstrap; fail the build loudly if they
do not land, and drop the staging copy so it never reaches the ISO.
2026-10-29 21:19:18 +01:00
BlackAngelTV 0788c729c4 Merge pull request 'feat(installer): show each install phase on the progress screen' (#21) from feat/installer-progress into Main
Reviewed-on: #21
2026-10-29 20:13:22 +00:00
BlackAngelTV 30b76d9644 feat(installer): show each install phase on the progress screen
The progress screen sat on "Running post-installation scripts" for the whole
%post with a bar that never moved, so a slow desktop install looked like a
hang. The kickstart phases now publish what they are doing through
fws-install-step, the scripts task turns those percentages into one step per
phase with a message naming the running script, and the boss reserves the same
number of steps so the bar actually follows them. A title is taken from each
script's "# FWS-TITLE:" line, and progress stays cosmetic: a missing file or a
D-Bus failure falls back to the previous single step.
2026-10-29 21:09:47 +01:00
BlackAngelTV 5c1cdc1ea7 Merge pull request 'feat(fastfetch): show the FWS logo whatever launches fastfetch' (#20) from feat/fastfetch-logo into Main
Reviewed-on: #20
2026-10-29 19:45:37 +00:00
BlackAngelTV e406889236 feat(fastfetch): show the FWS logo whatever launches fastfetch
The FWS logo only came from the flags passed by the login-shell hook, so
running fastfetch from a desktop terminal, a TTY or any non-login shell fell
back to the Arch logo. Move the logo (and its colours) into a system-wide
config that fastfetch reads for every account, live or installed, and keep the
hook down to a plain call. The module list is left to fastfetch defaults so it
does not rot with upstream versions; a user's own config still wins.
2026-10-29 20:42:04 +01:00
BlackAngelTV fbc6237f20 Merge pull request 'feat(fonts): ship a configured default emoji font' (#19) from feat/default-emoji-font into Main
Reviewed-on: #19
2026-10-29 19:37:52 +00:00
BlackAngelTV f17dfbb6fc feat(fonts): ship a configured default emoji font
Emoji showed up as empty boxes almost everywhere: no emoji font was installed
by default, and nothing told fontconfig which family to use for them, so
GTK/Qt/Electron apps and the installer fell back to whatever the system had.
Install Noto Color Emoji on the live image, with the desktop transaction and in
the hardware base, and add a fontconfig rule that resolves the "emoji" family,
appends it as a last resort for generic families without displacing the primary
font, and keeps bitmap emoji enabled when a no-bitmap rule is active. The
desktop font stacks (waybar, wofi, polybar) list it explicitly, and the
fontconfig cache is refreshed after installation.
2026-10-29 20:02:55 +01:00
BlackAngelTV dc90658be1 fix(hardware): install Vulkan for every detected GPU
Hybrid laptops expose two GPUs, but the driver detection kept only the first
matching vendor, so the second GPU got no Vulkan ICD at all; the Vulkan loader
was never installed explicitly and 32-bit games (Steam/Proton) had no ICD on
any machine. NVIDIA also had no VA-API driver, leaving video decode on the CPU.
Detect each vendor independently, add the loader, vulkaninfo and the 32-bit
ICDs, ship libva-nvidia-driver, and log the ICDs actually present so a missing
Vulkan driver is diagnosable from the install log.
2026-10-29 19:25:04 +01:00
BlackAngelTV 7b3f59a3ac Merge pull request 'feat(installer): ship a default FWS wallpaper for fresh installs' (#18) from feat/default-wallpaper into Main
Reviewed-on: #18
2026-10-29 18:09:24 +00:00
BlackAngelTV 64f8e918e4 feat(installer): ship a default FWS wallpaper for fresh installs
New installs landed on a bare background (especially Hyprland and i3, which
declared no wallpaper at all), so the desktop did not look like FWS on first
boot. The image is bundled in the ISO instead of downloaded: it works without
network during the first boot, renders identically everywhere and needs no
hosting. A per-user marker stops the script once the wallpaper is set, so the
choice made afterwards by the user is never overwritten.
2026-10-29 19:07:14 +01:00
BlackAngelTV 58af4d3ddf Ajouter AGENTS.md 2026-09-04 12:22:12 +00:00
BlackAngelTV d881e4f185 feat(scripts): auto-fallback to Docker container when no Arch WSL distro is found
setup-aur.sh, build.sh and build-offi.sh now fall back to an archlinux
Docker container (repo mounted on /fws, shared pacman cache) instead of
erroring on Windows hosts without an Arch WSL distro. Also install sudo
in the container so makepkg -s can resolve makedepends as the non-root
fwsbuild user (the cause of the recurring anaconda build failure).
2026-09-04 14:16:16 +02:00
BlackAngelTV bdfc231a2b chore: bump FWS version from 0.6.0 to 0.7.0
0.7.0 ships the post-language network picker, the bare-metal dualboot
GRUB hardening and the self-healing setup-aur. The single os-release
overlay feeds the live /etc/os-release, the installer header and the
installed system's branding.
2026-09-03 21:57:13 +02:00
BlackAngelTV 1bd203d52f fix(setup-aur): self-heal interrupted package transactions
An interrupted pacman -Syu leaves unowned files on disk; every later
install then fails with "exists in filesystem" and the whole AUR build
cascades into cryptic errors. A failed -Syu is now retried with
--overwrite, and all pacman -U installs go through a new pacman_ur()
helper that removes only files owned by no package and retries (up to
8 times) instead of dying on stale leftovers.
2026-09-03 21:57:09 +02:00
BlackAngelTV c6595e1563 fix(installer): make GRUB reliable on bare-metal dualboot installs
Three gaps left real machines booting straight into Windows after a
successful install (menu empty, no GRUB entry, no NVRAM record):

- os-prober was disabled (Arch default GRUB_DISABLE_OS_PROBER=true),
  so Windows never appeared in the generated menu; the airootfs
  overlay /etc/default/grub now ships GRUB_DISABLE_OS_PROBER=false.
- The %post chroot often had no ESP mounted and no efivars access, so
  grub-install silently did nothing on real hardware; it now finds and
  mounts an EFI FAT32 partition (including another OS's ESP, e.g.
  Windows) before installing.
- No safety net remained if the first attempt failed; the kickstart
  enables a new fws-grub-finalize.service that, on the installed
  system's first boot, re-installs GRUB with the --removable fallback
  (EFI/BOOT/BOOTX64.EFI) plus an NVRAM entry and regenerates the menu
  with os-prober active - automating the manual TTY repair.
2026-09-03 21:57:06 +02:00
BlackAngelTV 0022186f2f feat(installer): simple network picker screen after language selection
Replace the complex anaconda NetworkStandaloneSpoke with a minimal
post-language "Connexion à Internet" screen: one list of detected
Wi-Fi networks plus Ethernet, click a network, enter the password,
done. Hostname typed there is kept (written to /tmp/fws-hostname and
prefilled into the User spoke via the anaconda PKGBUILD patch), and
the chosen Wi-Fi profile is copied to the installed system so it
works at first boot without re-entering the password.
2026-09-03 21:56:58 +02:00
BlackAngelTV bbc5cb10a1 docs(trademarks): update fws version number from 0.6 to 0.7 2026-09-03 21:37:10 +02:00
BlackAngelTV 02deda68c5 docs(licensing): update fws version from 0.6 to 0.7 in installation header example 2026-09-03 21:37:10 +02:00
BlackAngelTV 7d53451900 docs(changelog): add 0.7.0 release notes (network screen, dualboot GRUB, setup-aur) 2026-09-03 21:37:10 +02:00
BlackAngelTV 064366edba docs(readme): describe simple network picker and dualboot GRUB hardening 2026-09-03 21:37:09 +02:00
BlackAngelTV 9172f5d68d chore: untrack .freebuff session data
.freebuff holds local app state and was committed by accident in PR #4;
remove it from the tree and ignore the directory going forward.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-09-03 18:45:35 +02:00
BlackAngelTV fcf50528a0 Merge pull request 'Fix desktop autostart' (#4) from fix-desktop-autostart into Main
Reviewed-on: #4
2026-08-26 17:46:54 +00:00
BlackAngelTV 5661fb08dc fix(autoinstall): desktop install 2026-08-26 19:46:11 +02:00
nocode 7730ac7b00 feat(build): add preflight package resolution and fws-dnd package
Add preflight package resolution step in build-offi.sh to validate all profile
packages against pacman repositories before mkarchiso execution. This prevents
'target not found' errors during ISO creation by catching missing packages early
with helpful error messages and recovery instructions.

Introduce fws-dnd package (D&D 5e manager for FWS with GTK4 interface) to the
local package build process in setup-aur.sh. Include PKGBUILD definition and
source tarball.

When package resolution fails, the build now exits with clear feedback pointing
users to run setup-aur.sh to build missing dependencies like fws-dnd.
2026-07-07 21:39:29 +02:00
nocode bee59a2fb3 docs(changelog): update changelog with new features and fixes
Add entries for:
- Machine name selection at installation
- Interactive build script with versioning and naming
- systemd-timesyncd explicit activation
- Keyboard layout derivation from full locale
- DNS in build container configuration
2026-07-07 21:07:10 +02:00
nocode 00d34dfc49 merge(Multi-Desktop)!: Add Multi DE on the installer 2026-07-07 21:04:19 +02:00
nocode 53ceeabcfb Merge branch 'Main' into Multi-Desktop 2026-07-07 18:48:21 +00:00
49 changed files with 3123 additions and 93 deletions

No files matched your search

+1
View File
@@ -1,4 +1,5 @@
out/ out/
.freebuff
local-repo/ local-repo/
configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/ configs/baseline/airootfs/etc/systemd/system/multi-user.target.wants/
configs/releng/airootfs/etc/systemd/system/multi-user.target.wants/ configs/releng/airootfs/etc/systemd/system/multi-user.target.wants/
+59
View File
@@ -0,0 +1,59 @@
# AGENTS.md — Instructions pour les agents IA
> Fichier de référence pour les agents IA (Codebuff, Cursor, Claude Code, GitHub Copilot…) qui travaillent sur un dépôt de l'organisation **FWS**. Un agent doit lire ce fichier en premier : il contient les instructions à respecter. Le `README.md` présente l'organisation et le `CONTRIBUTING.md` détaille les conventions de collaboration.
## Contexte
- **FWS** est une organisation open source multi-projets : chaque projet choisit librement sa stack technique (sans restriction de langage).
- Projet principal : **FWS ISO** — une distribution Linux basée sur Arch Linux, pensée pour simplifier l'installation et l'usage au quotidien.
- Conventions détaillées : `CONTRIBUTING.md` (FR) / `CONTRIBUTING.en.md` (EN).
## Règles à respecter
### Commits
- Messages en **anglais**, format **Conventional Commits** : `<type>(<portée>): <description>`.
- Types autorisés : `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`.
- Titre court et impératif ; un corps n'est ajouté que pour expliquer le **pourquoi**, pas le comment.
### Nommage
- Branches : `type/description` (ex. `feat/login`, `fix/typo`).
- Fichiers : **kebab-case** (ex. `my-component.ts`).
- Identifiants (variables, fonctions, classes) : **anglais**.
### Code & commentaires
- Commentaires en **anglais**, style « pourquoi » : pas de commentaire si le code est explicite ; documenter le non-évident (choix d'implémentation, compromis, cas limites).
- Respecter la stack technique et les conventions existantes du dépôt avant d'ajouter de nouvelles dépendances.
### Fichiers sensibles (`.gitignore`)
- Ne **jamais** versionner : fichiers d'environnement (`.env*`), données d'assistants de développement (`.freebuff/`), artefacts compilés (`dist/`, `build/`, `target/`, `__pycache__/`…), dépendances (`node_modules/`), secrets.
- Un `.gitignore` doit exister à la racine de chaque dépôt.
### Tests
- Fichiers de test : `*.test.*` ; noms de tests `describe` / `it` en anglais.
- Vérifier que les tests (et le typecheck / lint quand ils existent) passent avant de considérer une tâche terminée.
### Issues & signalement de bugs
- Les bugs et demandes sont suivis via les **issues** et, lorsqu'il existe, le tableau Kanban du projet.
- Une pull request qui corrige un bug référence l'issue dans son titre ou sa description (`Fixes #123`).
- Ne pas fermer ni modifier une issue sans demande explicite de l'utilisateur.
### Commits demandés par l'utilisateur
- Lorsque l'utilisateur demande explicitement de créer un commit, l'IA doit le faire après avoir vérifié les changements et les contrôles disponibles, sans attendre une confirmation supplémentaire.
- Le titre et le corps du commit ne doivent jamais mentionner l'IA, l'assistant, Codebuff ou l'outil utilisé.
- Ne pas ajouter l'IA comme auteur ou co-auteur dans le message du commit.
## Bonnes pratiques pour un agent
- Lire `AGENTS.md`, le `README.md` et le `CONTRIBUTING.md` avant d'éditer du code.
- Les commits doivent être signés.
- Faire les changements les plus petits possibles qui répondent à la demande.
- Ne pas pousser, fusionner ni publier sans demande explicite de l'utilisateur.
- Suivre les cartes du tableau Kanban lorsqu'il existe pour organiser le travail.
- En cas de doute, demander plutôt que de deviner.
+65
View File
@@ -2,6 +2,60 @@
Changelog Changelog
######### #########
[Unreleased]
============
Changed
-------
- **WinBoat remplacé par PacManager** : `winboat-bin` (AUR) est retiré de l'image, de ``setup-aur.sh``
et de toute la documentation. Il est remplacé par **PacManager 1.6.2** (paquet maison
``fws-pacmanage``, Qt6, construit depuis la release amont) : gestionnaire de paquets graphique
(recherche, installation, suppression, mises à jour, nettoyage, historique, journal, plugins
Flatpak/AUR, CLI).
- **Installation de PacManager dans un répertoire dédié** ``/opt/fws-pacmanage`` (``bin/PacManager``,
``bin/version``, ``bin/plugins/``), avec lien ``/usr/bin/PacManager`` et entrée de bureau : c'est le
dossier que son **self-update** réécrit, ce qui rend les mises à jour automatiques possibles sans
jamais modifier ``/usr/bin`` ni la base pacman.
[0.7.0] - 2026-09-03
====================
Added
-----
- **Écran « Connexion Internet » demandé juste après la langue à l'installation** : l'UI réseau complexe
d'Anaconda (NetworkControlBox — onglets, options avancées, hostname) est remplacée par un sélecteur minimal
façon téléphone (spoke ``fws_network.py`` + ``fws_network.glade``) : liste « Réseaux détectés » (Ethernet + Wi-Fi
triés par puissance), clic sur un réseau Wi-Fi → champ mot de passe → « Se connecter » → « Connecté ✓ » ; les
Wi-Fi ouverts et l'Ethernet se connectent au clic. Le Wi-Fi choisi est gardé sur le système installé (profils
NetworkManager du live copiés vers la cible par le ``%post --nochroot``), et « Continuer » reste possible sans
réseau.
- **GRUB dual-boot / bare-metal fiabilisé** (fin des « le PC redémarre sur Windows », « menu GRUB vide » et des
réparations manuelles en TTY après install sur vrai matériel) :
- ``os-prober`` ACTIF sur le système installé (overlay ``/etc/default/grub`` : ``GRUB_DISABLE_OS_PROBER=false`` —
Arch le désactive par défaut, d'où les menus sans Windows) ;
- le ``%post`` du kickstart monte automatiquement une partition EFI (même l'ESP d'un autre OS, cas dual-boot
réel) avant ``grub-install`` UEFI ;
- ``fws-grub-finalize`` + ``fws-grub-finalize.service`` (activé par le ``%post``) : au 1er démarrage du système
installé — efivars accessible, tous les disques présents — GRUB est (ré)installé en ``--removable``
(``EFI/BOOT/BOOTX64.EFI`` : boote même si le firmware « oublie » l'entrée NVRAM), l'entrée NVRAM « FWS » est
créée/rafraîchie (efibootmgr) et le menu est régénéré avec détection de Windows (marqueur de succès : ne tourne
qu'une fois, jamais sur le live).
- **``setup-aur.sh`` auto-réparant** : un ``pacman -Syu`` échouant sur des fichiers orphelins (« exists in
filesystem ») est retenté avec ``--overwrite`` ; les ``pacman -U`` passent par un helper qui purge les fichiers
orphelins bloquants et réessaie (le WSL Arch avait été empoisonné par une transaction interrompue : ~7 300
fichiers orphelins/vides supprimés, tous les paquets réinstallés).
Fixed
-----
- Hostname : l'ancien champ de l'écran réseau d'Anaconda est retiré avec l'UI — le « Nom de machine » reste
réglable sur la page Utilisateur (préremplissage ``/tmp/fws-hostname``, plus jamais de hostname vide ni
« archiso »).
[0.6.0] - 2026-07-07 [0.6.0] - 2026-07-07
==================== ====================
@@ -22,6 +76,11 @@ Added
- **firewalld** activé par défaut sur le système installé. - **firewalld** activé par défaut sur le système installé.
- Bureaux Hyprland et i3 à parité visuelle (waybar/polybar, wofi/rofi, Catppuccin Mocha), thème SDDM « fws », - Bureaux Hyprland et i3 à parité visuelle (waybar/polybar, wofi/rofi, Catppuccin Mocha), thème SDDM « fws »,
bannière GDM. bannière GDM.
- **Choix du nom de machine à l'installation** : champ « Nom de machine » dans la page Utilisateur d'anaconda,
appliqué au système installé (``/etc/hostname``, repli ``fws``).
- **Script de build interactif** (``build-offi.sh``) : version (``major.minor.build``) et variante (``cli``, ``gnome``,
``kde``…) demandées sur l'hôte avant d'entrer dans le conteneur, ISO nommée
``fws-<version>-<variante>-<AAAA.MM.JJ>.iso``, logo FWS dans fastfetch.
Changed Changed
------- -------
@@ -31,6 +90,7 @@ Changed
Fedora/Arch sur le splash et le journal de récupération. Fedora/Arch sur le splash et le journal de récupération.
- Toutes les entrées de boot plafonnent les workers udev bloqués (``udev.event_timeout=45``) ; le menu BIOS démarre - Toutes les entrées de boot plafonnent les workers udev bloqués (``udev.event_timeout=45``) ; le menu BIOS démarre
explicitement l'entrée FWS (``DEFAULT fws``). explicitement l'entrée FWS (``DEFAULT fws``).
- ``systemd-timesyncd`` explicitement activé sur le système installé pour éviter la dérive d'horloge (TLS, pacman).
- Use xz compression for the baseline profile's bootstrap tarball so that it has more differences when compared to the - Use xz compression for the baseline profile's bootstrap tarball so that it has more differences when compared to the
releng profile. releng profile.
- Match network interfaces by their type, instead of name, in systemd-networkd configuration. - Match network interfaces by their type, instead of name, in systemd-networkd configuration.
@@ -48,6 +108,11 @@ Fixed
le cap udev et les entrées de boot FWS d'ISO précédentes). le cap udev et les entrées de boot FWS d'ISO précédentes).
- DNS du système installé (NetworkManager + systemd-resolved), hook ``lvm2`` dans l'initramfs, GRUB de secours - DNS du système installé (NetworkManager + systemd-resolved), hook ``lvm2`` dans l'initramfs, GRUB de secours
``--removable`` en UEFI. ``--removable`` en UEFI.
- Disposition clavier dérivée de la locale complète et non de la seule langue : ``fr_CH`` donne désormais ``ch(fr)``
au lieu de ``fr``, appliqué à la console (``vconsole.conf``) et à X11 (via langtable) ; anaconda écrivait par
ailleurs un ``/etc/hostname`` vide sur le système installé.
- DNS dans le conteneur de build : ``podman run --network=host`` pour passer par la pile réseau de l'hôte
(corrige les timeouts avec firewalld/NAT).
- Use ``systemd-run`` to invoke ``curl`` with a transient service that depends on ``network-online.target`` since no - Use ``systemd-run`` to invoke ``curl`` with a transient service that depends on ``network-online.target`` since no
services are currently pulling in ``network_online.target``. services are currently pulling in ``network_online.target``.
+1 -1
View File
@@ -88,7 +88,7 @@ projet (« inbound = outbound », `GPL-3.0-or-later`), avec attestation d'origin
- [x] Branding Red Hat/Fedora retiré de l'UI Anaconda : nom de produit **FWS** - [x] Branding Red Hat/Fedora retiré de l'UI Anaconda : nom de produit **FWS**
via les variables `ANACONDA_PRODUCTNAME`/`ANACONDA_PRODUCTVERSION` via les variables `ANACONDA_PRODUCTNAME`/`ANACONDA_PRODUCTVERSION`
(exportées par le `.xinitrc` du live, lues depuis l'os-release FWS — (exportées par le `.xinitrc` du live, lues depuis l'os-release FWS —
l'en-tête affiche « FWS 0.6 INSTALLATION ») ; visuel **Arch** du menu de l'en-tête affiche « FWS 0.7 INSTALLATION ») ; visuel **Arch** du menu de
boot BIOS remplacé par un splash FWS ; le caractère « version modifiée boot BIOS remplacé par un splash FWS ; le caractère « version modifiée
d'Anaconda » reste documenté ici et dans TRADEMARKS.md d'Anaconda » reste documenté ici et dans TRADEMARKS.md
- [ ] Décision tranchée sur `python-iso639` (AGPL-3.0-only) : garder ou remplacer - [ ] Décision tranchée sur `python-iso639` (AGPL-3.0-only) : garder ou remplacer
+10 -3
View File
@@ -38,8 +38,6 @@ Composants sous MIT
----------------------------------------------------------------------- -----------------------------------------------------------------------
python-xkbregistry — Copyright (C) Stephen Early python-xkbregistry — Copyright (C) Stephen Early
https://github.com/sde1000/python-xkbregistry https://github.com/sde1000/python-xkbregistry
WinBoat (winboat-bin) — Copyright (C) WinBoat authors (TibixDev)
https://www.winboat.app
langtable (python-langtable, partie MIT) — Copyright (C) Mike FABIAN langtable (python-langtable, partie MIT) — Copyright (C) Mike FABIAN
https://github.com/mike-fabian/langtable https://github.com/mike-fabian/langtable
@@ -50,9 +48,18 @@ xmlrpc-c (libxmlrpc) — Copyright (C) les auteurs de xmlrpc-c
Licence permissive de type BSD (« custom ») — voir le source amont Licence permissive de type BSD (« custom ») — voir le source amont
https://xmlrpc-c.sourceforge.net/ https://xmlrpc-c.sourceforge.net/
-----------------------------------------------------------------------
Composants FWS (première partie — pas un logiciel tiers)
-----------------------------------------------------------------------
PacManager (fws-pacmanage) — Copyright (C) FWS, tous droits réservés.
Distribué avec FWS sous la licence propriétaire « source disponible » du
projet (voir pkgbuilds/fws-pacmanage, archive V1.6.2 du dépôt amont) :
usage personnel autorisé, redistribution par des tiers interdite.
https://gitea.nocode-var.tech/FWS/FWS-PacManage
----------------------------------------------------------------------- -----------------------------------------------------------------------
Marques Marques
----------------------------------------------------------------------- -----------------------------------------------------------------------
Arch Linux, Red Hat, Fedora, Anaconda, Windows, Microsoft, GNOME, KDE, Arch Linux, Red Hat, Fedora, Anaconda, Windows, Microsoft, GNOME, KDE,
Plasma, Xfce, Hyprland, GTK, Linux et WinBoat sont des marques de leurs Plasma, Xfce, Hyprland, GTK et Linux sont des marques de leurs
détenteurs respectifs. FWS n'est affilié à aucun d'eux. Voir TRADEMARKS.md. détenteurs respectifs. FWS n'est affilié à aucun d'eux. Voir TRADEMARKS.md.
+31 -11
View File
@@ -1,15 +1,15 @@
# FWS # FWS
**FWS** est une distribution Linux live/installable basée sur **Arch Linux**, pensée pour **remplacer Windows** : bureau prêt à l'emploi, jeux (Steam/Proton-GE), réalité virtuelle (SteamVR), compatibilité applicative (winboat/Wine) et outillage de maintenance intégré. L'installateur graphique est **Anaconda** (celui de Fedora/RHEL), **porté sur Arch** : payload LiveOS (copie du live sur le disque), spokes FWS (choix du bureau, récapitulatif avant installation), finalisation pacman/GRUB/mkinitcpio en `%post`. **FWS** est une distribution Linux live/installable basée sur **Arch Linux**, pensée pour **remplacer Windows** : bureau prêt à l'emploi, jeux (Steam/Proton-GE), réalité virtuelle (SteamVR), compatibilité applicative (Wine), gestionnaire de paquets graphique (PacManager) et outillage de maintenance intégré. L'installateur graphique est **Anaconda** (celui de Fedora/RHEL), **porté sur Arch** : payload LiveOS (copie du live sur le disque), spokes FWS (choix du bureau, récapitulatif avant installation), finalisation pacman/GRUB/mkinitcpio en `%post`.
Le projet est conçu pour être **construit depuis Windows via WSL** (les scripts détectent Git Bash et basculent automatiquement dans WSL), mais fonctionne aussi directement depuis une **Arch Linux native** ou depuis **toute distribution non-Arch (Fedora, Ubuntu…) via une bascule automatique dans un conteneur Arch podman**. Le projet est conçu pour être **construit depuis Windows via WSL** (les scripts détectent Git Bash et basculent automatiquement dans WSL), mais fonctionne aussi directement depuis une **Arch Linux native** ou depuis **toute distribution non-Arch (Fedora, Ubuntu…) via une bascule automatique dans un conteneur Arch podman**. Sur Windows **sans distro WSL Arch** mais avec **Docker Desktop**, les scripts basculent automatiquement dans un conteneur archlinux (équivalent Windows du repli podman).
--- ---
## Aperçu ## Aperçu
- **Base** : Arch Linux (rolling release) - **Base** : Arch Linux (rolling release)
- **Installateur** : **Anaconda 45 porté sur Arch** — payload LiveOS (installe FWS, pas Fedora), page « Récapitulatif avant installation » avec bouton Précédent, choix du bureau intégré, **brandé FWS** (en-tête « FWS 0.6 INSTALLATION », via les variables `ANACONDA_PRODUCT*` exportées par le `.xinitrc`) - **Installateur** : **Anaconda 45 porté sur Arch** — payload LiveOS (installe FWS, pas Fedora), **écran Réseau demandé juste après la langue** (sélecteur simple façon téléphone : liste des Wi-Fi + Ethernet, clic sur un réseau → mot de passe → « Connecté ✓ » ; le Wi-Fi choisi est gardé sur le système installé), page « Récapitulatif avant installation » avec bouton Précédent, choix du bureau intégré, **brandé FWS** (en-tête « FWS 0.7 INSTALLATION », via les variables `ANACONDA_PRODUCT*` exportées par le `.xinitrc`)
- **Affichage live** : Xorg + Openbox + splash de préparation qui montre l'activité réelle d'anaconda (dernier log actif + chrono ; si rien ne bouge avant l'apparition de l'installateur, il le dit puis affiche un diagnostic complet — le watchdog se désarme dès que la GUI est à l'écran) - **Affichage live** : Xorg + Openbox + splash de préparation qui montre l'activité réelle d'anaconda (dernier log actif + chrono ; si rien ne bouge avant l'apparition de l'installateur, il le dit puis affiche un diagnostic complet — le watchdog se désarme dès que la GUI est à l'écran)
- **Mémoire** : **4 Go recommandés** pour installer (2 Go minimum — swap **zram** intégré au live ET au système installé ; sous 2 Go le live avertit, à 1 Go sans zram l'installateur graphique gèle) - **Mémoire** : **4 Go recommandés** pour installer (2 Go minimum — swap **zram** intégré au live ET au système installé ; sous 2 Go le live avertit, à 1 Go sans zram l'installateur graphique gèle)
- **Bureaux installables** : GNOME, KDE Plasma, XFCE, **Hyprland** (Wayland — non compatible VR), **i3** (X11 — compatible VR/SteamVR), ou ligne de commande seule - **Bureaux installables** : GNOME, KDE Plasma, XFCE, **Hyprland** (Wayland — non compatible VR), **i3** (X11 — compatible VR/SteamVR), ou ligne de commande seule
@@ -24,12 +24,14 @@ Le projet est conçu pour être **construit depuis Windows via WSL** (les script
### À l'installation ### À l'installation
- **Choix du bureau** dans Anaconda, avec compatibilité VR affichée (i3 = SteamVR ✔ ; Hyprland = ✘) - **Choix du bureau** dans Anaconda, avec compatibilité VR affichée (i3 = SteamVR ✔ ; Hyprland = ✘)
- **Page récapitulative** avant toute écriture disque : config choisie (langue, clavier, fuseau, comptes, partitionnement, bureau, nom de machine) + matériel détecté (GPU, disques, virtualisation, réseau) - **Page récapitulative** avant toute écriture disque : config choisie (langue, clavier, fuseau, comptes, partitionnement, bureau, nom de machine) + matériel détecté (GPU, disques, virtualisation, réseau)
- **Automatique en fin d'install** : drivers GPU (NVIDIA/AMD/Intel), outils invité VM (VMware/VirtualBox/QEMU/Hyper-V), PipeWire + pavucontrol, Bluetooth (BlueZ + blueman), luminosité (brightnessctl), **pare-feu firewalld activé**, Steam + Wine + Monado + MangoHud + gamemode, clavier/locale, hostname, sudo pour l'utilisateur créé, branding FWS - **Automatique en fin d'install** : drivers GPU (NVIDIA/AMD/Intel) + **Vulkan** (loader, `vulkaninfo`, ICD de chaque GPU détecté — portables hybrides compris — et ICD 32 bits pour Steam/Proton), outils invité VM (VMware/VirtualBox/QEMU/Hyper-V), PipeWire + pavucontrol, Bluetooth (BlueZ + blueman), luminosité (brightnessctl), **police emoji par défaut** (Noto Color Emoji + règle fontconfig `etc/fonts/conf.d/99-fws-emoji.conf` : « emoji » résolu, emoji en dernier recours des polices génériques, bitmap autorisé), **pare-feu firewalld activé**, Steam + Wine + Monado + MangoHud + gamemode, clavier/locale, hostname, sudo pour l'utilisateur créé, branding FWS
- **Bureau lancé au démarrage** : le display manager du bureau choisi (SDDM/GDM) est activé et `graphical.target` est la cible par défaut. Si l'installation des paquets du bureau échoue pendant le `%post` (réseau/miroirs), le système installé se **répare tout seul au premier démarrage** (`fws-desktop-finalize.service` → `fws-desktop-retry --auto`) : le bureau est installé puis l'écran de connexion apparaît, sans intervention
### Sur le système installé (outillage `fws-*`) ### Sur le système installé (outillage `fws-*`)
| Commande | Rôle | Accès | | Commande | Rôle | Accès |
|---|---|---| |---|---|---|
| `fws-hello` | Bienvenue au 1er démarrage (mise à jour, codecs, Proton-GE, VR, raccourcis) | auto au 1er login | | `fws-hello` | Bienvenue au 1er démarrage (mise à jour, codecs, Proton-GE, VR, raccourcis) | auto au 1er login |
| `fws-wallpaper` | Fond d'écran FWS au **premier démarrage** — image embarquée dans l'ISO (aucun téléchargement) ; le choix fait ensuite par l'utilisateur n'est jamais écrasé (`--force` pour le reposer) | auto au 1er login, `fws-wallpaper --force` |
| `fws-update` | Mise à jour complète (pacman + cache + orphelins + flatpak) | bouton 󰚰 de la barre | | `fws-update` | Mise à jour complète (pacman + cache + orphelins + flatpak) | bouton 󰚰 de la barre |
| `fws-keys` | Panneau des **raccourcis clavier réels** (lit la config Hyprland/i3) | `Super+K`, bouton ⌨ | | `fws-keys` | Panneau des **raccourcis clavier réels** (lit la config Hyprland/i3) | `Super+K`, bouton ⌨ |
| `fws-powermenu` | Verrouiller / déconnexion / suspendre / redémarrer / éteindre | `Super+X`, bouton 󰐥 | | `fws-powermenu` | Verrouiller / déconnexion / suspendre / redémarrer / éteindre | `Super+X`, bouton 󰐥 |
@@ -37,6 +39,19 @@ Le projet est conçu pour être **construit depuis Windows via WSL** (les script
| `fws-vr-setup` | Drivers/runtimes VR (Vive/Index → SteamVR natif ; Quest → ALVR ; Monado) | `Super+Shift+V` (i3), menu | | `fws-vr-setup` | Drivers/runtimes VR (Vive/Index → SteamVR natif ; Quest → ALVR ; Monado) | `Super+Shift+V` (i3), menu |
| `fws-proton-ge` | Installe/actualise Proton-GE pour Steam (vérif sha512) | fws-hello, terminal | | `fws-proton-ge` | Installe/actualise Proton-GE pour Steam (vérif sha512) | fws-hello, terminal |
| `fws-recovery` | **Application GTK de réparation** : GRUB, initramfs, pacman, terminal chroot (moteur bash + repli console) | menu « Récupération FWS » de l'OS installé, entrée GRUB « Réparer FWS », entrée de boot du live | | `fws-recovery` | **Application GTK de réparation** : GRUB, initramfs, pacman, terminal chroot (moteur bash + repli console) | menu « Récupération FWS » de l'OS installé, entrée GRUB « Réparer FWS », entrée de boot du live |
| `fws-desktop-retry` *(généré à l'install)* | (Ré)installe le bureau choisi et active le display manager — appelé automatiquement par `fws-desktop-finalize.service` au 1er démarrage si l'install du bureau a échoué ; `--auto` bascule sur l'écran de connexion sans reboot | auto au 1er boot si échec, sinon `sudo fws-desktop-retry` |
### Gestionnaire de paquets : PacManager
**PacManager** (paquet `fws-pacmanage`, interface Qt6 sur pacman) remplace la gestion en lignes de commande :
recherche, installation, suppression, mises à jour, nettoyage (orphelins, paquets hérités, cache), historique,
journal, plugins (Flatpak et AUR fournis) et une CLI (`pacmanager search vlc`).
Il est installé **dans son propre répertoire `/opt/fws-pacmanage`** (`bin/PacManager`, `bin/version`,
`bin/plugins/`), lancé par le lien `/usr/bin/PacManager` et le menu d'applications. Ce répertoire dédié est ce
qui rend ses **mises à jour automatiques** possibles : au démarrage (puis une fois par jour) l'application
interroge ses releases et réécrit **son propre binaire**, sans jamais toucher à `/usr/bin` — donc sans
fragiliser la base pacman. Le remplacement du binaire demande le mot de passe admin (sudo) ; la *vérification*
des mises à jour, elle, se fait sans mot de passe et notifie quand une version est disponible.
### Hyprland & i3 : parité visuelle ### Hyprland & i3 : parité visuelle
Même identité Catppuccin Mocha (nuances de bleu) sur les deux : barre flottante arrondie (**waybar** / **polybar**) avec date+heure, indicateur de mises à jour, volume/réseau/CPU/RAM/luminosité/Bluetooth cliquables ; menus assortis (**wofi** / **rofi**) ; mêmes raccourcis (déclarés avec descriptions → `Super+K`) ; **Dolphin** en gestionnaire de fichiers ; thème **SDDM « fws »** maison (pur QtQuick, accent adapté au bureau ; GNOME garde GDM avec bannière FWS). Même identité Catppuccin Mocha (nuances de bleu) sur les deux : barre flottante arrondie (**waybar** / **polybar**) avec date+heure, indicateur de mises à jour, volume/réseau/CPU/RAM/luminosité/Bluetooth cliquables ; menus assortis (**wofi** / **rofi**) ; mêmes raccourcis (déclarés avec descriptions → `Super+K`) ; **Dolphin** en gestionnaire de fichiers ; thème **SDDM « fws »** maison (pur QtQuick, accent adapté au bureau ; GNOME garde GDM avec bannière FWS).
@@ -172,8 +187,8 @@ Détails utiles :
Depuis **Git Bash sur Windows** (à la racine du repo) : Depuis **Git Bash sur Windows** (à la racine du repo) :
```bash ```bash
# Étape 1 : compilation des paquets AUR (winboat) + PKGBUILD locaux # Étape 1 : compilation des paquets AUR + PKGBUILD locaux
# (anaconda porté sur Arch + ses dépendances python) # (PacManager, anaconda porté sur Arch + ses dépendances python)
# → crée local-repo/ avec les .pkg.tar.zst # → crée local-repo/ avec les .pkg.tar.zst
./setup-aur.sh ./setup-aur.sh
@@ -196,7 +211,7 @@ L'ISO finale est générée dans `./out/FWS-YYYY.MM.DD-x86_64.iso`.
4. **`pacman -Syu`** complet (obligatoire — sinon `makepkg` plante sur les "conflicting files" lors des splits de paquets type `gcc-libs`). 4. **`pacman -Syu`** complet (obligatoire — sinon `makepkg` plante sur les "conflicting files" lors des splits de paquets type `gcc-libs`).
5. **Install des outils de build** : `base-devel git`. 5. **Install des outils de build** : `base-devel git`.
6. **Création d'un utilisateur `fwsbuild`** non-root avec `sudo` NOPASSWD (makepkg refuse de tourner en root). 6. **Création d'un utilisateur `fwsbuild`** non-root avec `sudo` NOPASSWD (makepkg refuse de tourner en root).
7. **Clone + build AUR** : `winboat-bin` via `makepkg -s --noconfirm`, plus les PKGBUILD locaux de `pkgbuilds/` (anaconda, anaconda-widgets, pykickstart, blivet, python-meh patché…). Le build est **incrémental** : un paquet déjà présent dans `local-repo/` à la bonne version est sauté. 7. **Clone + build AUR** : les paquets de `AUR_PACKAGES` via `makepkg -s --noconfirm`, plus les PKGBUILD locaux de `pkgbuilds/` (fws-pacmanage → PacManager 1.6.2, anaconda, anaconda-widgets, pykickstart, blivet, python-meh patché…). Le build est **incrémental** : un paquet déjà présent dans `local-repo/` à la bonne version est sauté.
8. **Création du repo local** : `repo-add local-repo/fws-local.db.tar.gz`. 8. **Création du repo local** : `repo-add local-repo/fws-local.db.tar.gz`.
9. **Cleanup** : suppression de l'utilisateur `fwsbuild`. 9. **Cleanup** : suppression de l'utilisateur `fwsbuild`.
@@ -233,7 +248,7 @@ L'ISO finale est générée dans `./out/FWS-YYYY.MM.DD-x86_64.iso`.
| Chemin | Rôle | | Chemin | Rôle |
|---|---| |---|---|
| `setup-aur.sh` | Build des paquets AUR (winboat) + PKGBUILD locaux, crée `local-repo/` | | `setup-aur.sh` | Build des paquets AUR + PKGBUILD locaux (fws-pacmanage, Anaconda…), crée `local-repo/` |
| `build.sh` | Build de l'ISO via `mkarchiso` | | `build.sh` | Build de l'ISO via `mkarchiso` |
| `configs/releng/` | Profil principal (base ArchISO releng) | | `configs/releng/` | Profil principal (base ArchISO releng) |
| `configs/baseline/` | Overlay FWS (surcharge le profil releng) — **prioritaire** sur releng | | `configs/baseline/` | Overlay FWS (surcharge le profil releng) — **prioritaire** sur releng |
@@ -250,7 +265,7 @@ L'ISO finale est générée dans `./out/FWS-YYYY.MM.DD-x86_64.iso`.
2. `systemd` → autologin root sur `tty1` 2. `systemd` → autologin root sur `tty1`
3. `.zprofile` → mode recovery si demandé, sinon `startx` 3. `.zprofile` → mode recovery si demandé, sinon `startx`
4. `.xinitrc` → Openbox + **garde-fou RAM** (avertissement sous 2 Go) + **splash « Préparation de l'installateur »** (label alimenté en direct par les logs anaconda ; à 4 min sans activité → diagnostic auto `/tmp/fws-stall.txt` ; le tout se désarme dès que la GUI d'anaconda apparaît), bind mount `/run/rootfsbase` (source du payload LiveOS), patch du hub Anaconda, **exports `ANACONDA_PRODUCT*`** (branding FWS), puis `dbus-run-session liveinst` 4. `.xinitrc` → Openbox + **garde-fou RAM** (avertissement sous 2 Go) + **splash « Préparation de l'installateur »** (label alimenté en direct par les logs anaconda ; à 4 min sans activité → diagnostic auto `/tmp/fws-stall.txt` ; le tout se désarme dès que la GUI d'anaconda apparaît), bind mount `/run/rootfsbase` (source du payload LiveOS), patch du hub Anaconda, **exports `ANACONDA_PRODUCT*`** (branding FWS), puis `dbus-run-session liveinst`
5. **Anaconda** : accueil → hub (langue, clavier, disque, utilisateur, **bureau FWS**) → « Commencer l'installation » → **page Récapitulatif** (bouton Précédent / Lancer l'installation) → installation → écran de réussite → extinction 5. **Anaconda** : accueil (langue) → **écran Connexion Internet** (liste des réseaux : Wi-Fi + Ethernet ; clic sur un Wi-Fi → mot de passe → « Connecté ✓ » — le Wi-Fi choisi est gardé sur le système installé) → hub (clavier, disque, utilisateur, **bureau FWS**) → « Commencer l'installation » → **page Récapitulatif** (bouton Précédent / Lancer l'installation) → installation → écran de réussite → extinction
6. En cas d'échec : écran de debug avec tous les logs (liveinst, %post chrooté, anaconda) 6. En cas d'échec : écran de debug avec tous les logs (liveinst, %post chrooté, anaconda)
--- ---
@@ -261,9 +276,14 @@ L'ISO finale est générée dans `./out/FWS-YYYY.MM.DD-x86_64.iso`.
- **Paquets baseline** : `configs/baseline/packages.x86_64` - **Paquets baseline** : `configs/baseline/packages.x86_64`
- **Overlay rootfs** : `configs/releng/airootfs/` ou `configs/baseline/airootfs/` - **Overlay rootfs** : `configs/releng/airootfs/` ou `configs/baseline/airootfs/`
- **Kickstart de l'installateur** : `configs/releng/airootfs/usr/share/anaconda/interactive-defaults.ks` (payload LiveOS via `--liveinst` + tout le `%post` : bureaux, drivers, pare-feu, branding) - **Kickstart de l'installateur** : `configs/releng/airootfs/usr/share/anaconda/interactive-defaults.ks` (payload LiveOS via `--liveinst` + tout le `%post` : bureaux, drivers, pare-feu, branding)
- **Spokes Anaconda FWS** : `configs/baseline/airootfs/usr/lib/python3.14/site-packages/pyanaconda/ui/gui/spokes/` (`fws_desktop.py`, `fws_recap.py`) + glades dans `usr/share/anaconda/ui/spokes/` - **Spokes Anaconda FWS** : `configs/baseline/airootfs/usr/lib/python3.14/site-packages/pyanaconda/ui/gui/spokes/` (`fws_desktop.py`, `fws_recap.py`, `fws_network.py` — écran « Connexion Internet » post-langue : sélecteur minimal Wi-Fi/Ethernet (plus l'UI complexe d'anaconda) + mot de passe, persistance du Wi-Fi via `%post --nochroot` ; glades dans `usr/share/anaconda/ui/spokes/` (`fws_network.glade`))
- **Configs bureaux & thèmes** : `configs/releng/airootfs/usr/local/share/fws/` (hyprland, i3, waybar, polybar, wofi, rofi, picom) et `usr/share/sddm/themes/fws/` - **Configs bureaux & thèmes** : `configs/releng/airootfs/usr/local/share/fws/` (hyprland, i3, waybar, polybar, wofi, rofi, picom) et `usr/share/sddm/themes/fws/`
- **Fond d'écran par défaut** : `configs/releng/airootfs/usr/local/share/fws/wallpaper.png` (PNG 2560×1440, **embarqué dans l'ISO** — rien à télécharger au premier boot) appliqué par `usr/local/bin/fws-wallpaper` : autostart XDG (`etc/xdg/autostart/`) pour KDE/GNOME/XFCE, `swaybg` pour Hyprland et `feh` pour i3 (paquets ajoutés au `%post`)
- **Police emoji par défaut** : `configs/releng/airootfs/etc/fonts/conf.d/99-fws-emoji.conf` (Noto Color Emoji, paquet `noto-fonts-emoji` : présent sur le live, ajouté à la transaction du bureau par le `%post` et à la base de `fws-setup-hardware`) — famille `emoji` résolue, emoji en dernier recours des familles génériques, `embeddedbitmap` forcé pour que les emoji bitmap ne soient jamais désactivés ; piles de polices des bureaux (waybar, wofi, polybar) complétées
- **Écran de progression de l'installation** : plus de « Running post-installation scripts » figé — `fws-install-step` (`usr/local/bin/`, appelée par les `%post` du kickstart) publie « pourcentage | ce qui est en cours » dans `/var/log/fws-install-progress`, et les overlays `pyanaconda/modules/runtime/scripts/runtime.py` + `pyanaconda/modules/boss/installation.py` (livrés dans `configs/baseline/airootfs/usr/local/share/fws/anaconda-overlay/` puis copiés par `root/customize_airootfs.sh` **après** le pacstrap — mkarchiso copie l'airootfs avant les paquets, un écrasement direct ferait échouer pacman) transforment ça en « Script 2/3 · Installation du bureau (pacman) — 62 % » avec une barre qui avance par paliers de 5 % (titre de chaque script déclaré par sa ligne `# FWS-TITLE:`)
- **fastfetch : logo FWS partout** : `configs/releng/airootfs/etc/fastfetch/config.jsonc` (config **système** lue par fastfetch quand le compte n'a pas la sienne : logo `usr/local/share/fws/logo.txt` + couleurs FWS, et la liste `modules` reprend la structure par défaut de fastfetch — sans elle, un fichier de config supprime TOUTES les infos et on n'a que le logo ; `OS:` lit `/etc/os-release`, donc « FWS Linux » et non « Arch Linux »). `etc/profile.d/fastfetch.sh` se contente d'appeler `fastfetch` en shell de login : le rendu est donc le même au login, dans un terminal de bureau, en TTY, pour root comme pour un utilisateur, sur le live comme sur le système installé (une config perso `~/.config/fastfetch/` reste prioritaire)
- **Outils fws-\*** : `configs/releng/airootfs/usr/local/bin/` - **Outils fws-\*** : `configs/releng/airootfs/usr/local/bin/`
- **GRUB du système installé (dualboot / bare-metal)** : `configs/releng/airootfs/etc/default/grub` (overlay : `GRUB_DISABLE_OS_PROBER=false` — sur Arch c'est `true` par défaut, d'où les « menus GRUB vides » sans Windows) ; `usr/local/bin/fws-grub-finalize` + `etc/systemd/system/fws-grub-finalize.service` (activé par le %post) : au 1er démarrage du système installé, réinstalle GRUB en `--removable` (chemin `EFI/BOOT/BOOTX64.EFI`, boote même si le firmware ASUS… oublie l'entrée NVRAM), crée/rafraîchit l'entrée NVRAM « FWS » (efibootmgr) et régénère le menu avec os-prober (Windows détecté)
- **Récupération sur l'OS installé** : entrée GRUB générée par `configs/releng/airootfs/etc/grub.d/42_fws-recovery` → `fws-recovery.target` + `fws-recovery-boot.service` (`etc/systemd/system/`) ; lanceur `usr/local/share/applications/fws-recovery.desktop` + politique polkit `usr/share/polkit-1/actions/org.fws.recovery.policy` - **Récupération sur l'OS installé** : entrée GRUB générée par `configs/releng/airootfs/etc/grub.d/42_fws-recovery` → `fws-recovery.target` + `fws-recovery-boot.service` (`etc/systemd/system/`) ; lanceur `usr/local/share/applications/fws-recovery.desktop` + politique polkit `usr/share/polkit-1/actions/org.fws.recovery.policy`
- **Swap zram** (live + installé) : `configs/releng/airootfs/etc/systemd/zram-generator.conf` (paquet `zram-generator`) - **Swap zram** (live + installé) : `configs/releng/airootfs/etc/systemd/zram-generator.conf` (paquet `zram-generator`)
- **Branding ISO** : `configs/releng/profiledef.sh` (`iso_name`, `iso_label`, `iso_publisher`) ; **visuel du menu BIOS** : `configs/releng/syslinux/splash.png` (PNG 8-bit) ; **nom/version affichés par l'installateur** : exports `ANACONDA_PRODUCTNAME`/`ANACONDA_PRODUCTVERSION` dans le `.xinitrc` (lus depuis l'os-release du live) - **Branding ISO** : `configs/releng/profiledef.sh` (`iso_name`, `iso_label`, `iso_publisher`) ; **visuel du menu BIOS** : `configs/releng/syslinux/splash.png` (PNG 8-bit) ; **nom/version affichés par l'installateur** : exports `ANACONDA_PRODUCTNAME`/`ANACONDA_PRODUCTVERSION` dans le `.xinitrc` (lus depuis l'os-release du live)
@@ -279,7 +299,7 @@ L'ISO finale est générée dans `./out/FWS-YYYY.MM.DD-x86_64.iso`.
| Symptôme | Cause / fix | | Symptôme | Cause / fix |
|---|---| |---|---|
| `Aucune distribution WSL Arch joignable` | Aucune distro Arch n'est installée/joignable. Les scripts auto-détectent désormais toute distro dont le nom contient « arch » (via `wsl -l -q`) ; installe ArchWSL (nom `Arch`) ou `wsl --install -d archlinux`, ou force `ARCH_WSL_DISTRO=NomDeMaDistro`. | | `Aucune distribution WSL Arch joignable` | Aucune distro Arch n'est installée/joignable. Les scripts auto-détectent désormais toute distro dont le nom contient « arch » (via `wsl -l -q`) ; **si Docker Desktop tourne, ils basculent seuls dans un conteneur archlinux** (volume de cache partagé `fws-pacman-cache`, dépôt monté sur `/fws`) ; sinon installe ArchWSL (nom `Arch`) ou `wsl --install -d archlinux`, ou force `ARCH_WSL_DISTRO=NomDeMaDistro`. |
| `WSL introuvable` | WSL n'est pas installé. PowerShell admin : `wsl --install`, puis installe une distro Arch. | | `WSL introuvable` | WSL n'est pas installé. PowerShell admin : `wsl --install`, puis installe une distro Arch. |
| `pacman: signature unknown trust` | Keyring périmé → `pacman -Sy --noconfirm archlinux-keyring` puis relancer. | | `pacman: signature unknown trust` | Keyring périmé → `pacman -Sy --noconfirm archlinux-keyring` puis relancer. |
| `makepkg: conflicting files` | `pacman -Syu` incomplet avant le build. Relancer `setup-aur.sh`. | | `makepkg: conflicting files` | `pacman -Syu` incomplet avant le build. Relancer `setup-aur.sh`. |
+20 -2
View File
@@ -50,7 +50,6 @@ référencé par `source=()` dans le PKGBUILD, plus le PKGBUILD lui-même.
| libreport | 2.17.15 | **`GPL-2.0-only`** ⚠ | Red Hat, Inc. (projet ABRT) | https://github.com/abrt/libreport | | libreport | 2.17.15 | **`GPL-2.0-only`** ⚠ | Red Hat, Inc. (projet ABRT) | https://github.com/abrt/libreport |
| satyr | 0.43 | `GPL-2.0-or-later` | Red Hat, Inc. (projet ABRT) | https://github.com/abrt/satyr | | satyr | 0.43 | `GPL-2.0-or-later` | Red Hat, Inc. (projet ABRT) | https://github.com/abrt/satyr |
| libxmlrpc (xmlrpc-c) | 1.64.03 | `custom` (BSD-style permissive) | Auteurs xmlrpc-c | https://xmlrpc-c.sourceforge.net/ | | libxmlrpc (xmlrpc-c) | 1.64.03 | `custom` (BSD-style permissive) | Auteurs xmlrpc-c | https://xmlrpc-c.sourceforge.net/ |
| winboat-bin | 0.9.0 | `MIT` | Auteurs WinBoat (TibixDev) | https://www.winboat.app |
> Les versions et identifiants SPDX ci-dessus proviennent des champs `license=` > Les versions et identifiants SPDX ci-dessus proviennent des champs `license=`
> des PKGBUILD et des `.PKGINFO` des paquets de `local-repo/`. Quand le `.PKGINFO` > des PKGBUILD et des `.PKGINFO` des paquets de `local-repo/`. Quand le `.PKGINFO`
@@ -58,6 +57,25 @@ référencé par `source=()` dans le PKGBUILD, plus le PKGBUILD lui-même.
> SPDX retenu est celui du dépôt amont (p. ex. `satyr` → `GPL-2.0-or-later`). > SPDX retenu est celui du dépôt amont (p. ex. `satyr` → `GPL-2.0-or-later`).
> **À corriger dans les PKGBUILD** pour des étiquettes SPDX exactes. > **À corriger dans les PKGBUILD** pour des étiquettes SPDX exactes.
### 2.1 Composant FWS propriétaire (pas un tiers)
**PacManager** (`fws-pacmanage`, recette `pkgbuilds/fws-pacmanage`, installé dans
`/opt/fws-pacmanage`) n'est **pas** un logiciel tiers : il est développé et
détenu par **FWS**. Sa licence amont (archive `V1.6.0` du dépôt, fichier
`LICENSE`) est **propriétaire « source disponible »**, tous droits réservés :
consultation, modification et compilation pour un **usage personnel** autorisées ;
**distribution, revente et réutilisation par des tiers interdites** sans accord
écrit de FWS. FWS redistribue donc son propre logiciel dans sa propre
distribution.
Conséquences :
- sa licence **n'est pas** compatible avec la `GPL-3.0-or-later` du dépôt au sens
d'une œuvre combinée — elle ne l'a pas à être, FWS en est l'ayant droit ;
- un tiers ne peut pas extraire `fws-pacmanage` de l'ISO pour le redistribuer ;
- le texte de licence est conservé dans `/usr/share/licenses/fws-pacmanage/` sur
le système installé (voir [NOTICE](NOTICE)).
--- ---
## 3. Paquets Arch Linux de l'ISO ## 3. Paquets Arch Linux de l'ISO
@@ -99,7 +117,7 @@ l'exécution. Les licences en présence et leur compatibilité montante vers GPL
| `LGPL-2.1-or-later` (productmd) | ✅ | montée vers (L)GPLv3 | | `LGPL-2.1-or-later` (productmd) | ✅ | montée vers (L)GPLv3 |
| `LGPL-3.0-or-later` (simpleline) | ✅ | sous-ensemble de GPLv3 | | `LGPL-3.0-or-later` (simpleline) | ✅ | sous-ensemble de GPLv3 |
| `Apache-2.0` (requests-file, requests-ftp, pid) | ✅ | compatible GPLv3 (sens unique) ; voir [NOTICE](NOTICE) | | `Apache-2.0` (requests-file, requests-ftp, pid) | ✅ | compatible GPLv3 (sens unique) ; voir [NOTICE](NOTICE) |
| `MIT` (xkbregistry, winboat) | ✅ | permissive | | `MIT` (xkbregistry) | ✅ | permissive |
| `MIT`/`BSD-style` (langtable, libxmlrpc) | ✅ | permissive | | `MIT`/`BSD-style` (langtable, libxmlrpc) | ✅ | permissive |
### 4.3 ⚠ Deux points à surveiller (signalés en bonne foi) ### 4.3 ⚠ Deux points à surveiller (signalés en bonne foi)
+6 -6
View File
@@ -94,7 +94,7 @@ Sans `/.buildstamp`, Anaconda s'annonçait « ANACONDA BLUESKY INSTALLATION » e
ses logs parlent de Fedora. `pyanaconda/core/product.py` donne priorité aux ses logs parlent de Fedora. `pyanaconda/core/product.py` donne priorité aux
variables d'environnement : le `.xinitrc` du live exporte variables d'environnement : le `.xinitrc` du live exporte
`ANACONDA_PRODUCTNAME`/`ANACONDA_PRODUCTVERSION` (depuis l'os-release FWS) et `ANACONDA_PRODUCTNAME`/`ANACONDA_PRODUCTVERSION` (depuis l'os-release FWS) et
`ANACONDA_ISFINAL=true` → l'en-tête et l'accueil affichent **« FWS 0.6 »**. Le `ANACONDA_ISFINAL=true` → l'en-tête et l'accueil affichent **« FWS 0.7 »**. Le
splash de préparation filtre en outre les mentions Fedora des lignes de log splash de préparation filtre en outre les mentions Fedora des lignes de log
affichées. Les mentions profondes dans les **logs techniques** (fichiers affichées. Les mentions profondes dans les **logs techniques** (fichiers
`/tmp/*.log`, écrans de debug) sont conservées volontairement : identification `/tmp/*.log`, écrans de debug) sont conservées volontairement : identification
@@ -116,10 +116,11 @@ loyale du composant amont (version modifiée d'Anaconda), utile au diagnostic.
## Windows & Microsoft ## Windows & Microsoft
> **Windows®** et **Microsoft®** sont des marques de **Microsoft Corporation**. > **Windows®** et **Microsoft®** sont des marques de **Microsoft Corporation**.
> FWS embarque **WinBoat** (MIT), qui permet d'exécuter des applications Windows > FWS embarque **Wine** et **Steam/Proton**, qui permettent d'exécuter des
> sous Linux. FWS et WinBoat **ne sont ni affiliés, ni approuvés** par Microsoft. > applications Windows sous Linux. FWS, Wine et Valve **ne sont ni affiliés, ni
> Exécuter des applications Windows requiert vos **propres licences Windows > approuvés** par Microsoft. Exécuter des applications Windows requiert vos
> valides** ; FWS ne fournit aucun logiciel ni licence Microsoft. > **propres licences Windows valides** ; FWS ne fournit aucun logiciel ni licence
> Microsoft.
Le nom du projet et son slogan font un usage **parodique / nominatif** du terme Le nom du projet et son slogan font un usage **parodique / nominatif** du terme
« Windows » et n'impliquent aucun lien avec Microsoft. « Windows » et n'impliquent aucun lien avec Microsoft.
@@ -138,7 +139,6 @@ de façon **purement descriptive** :
- **Hyprland** — projet Hyprland - **Hyprland** — projet Hyprland
- **GTK** — The GNOME Foundation - **GTK** — The GNOME Foundation
- **Linux®** — marque déposée de Linus Torvalds - **Linux®** — marque déposée de Linus Torvalds
- **WinBoat** — projet WinBoat
--- ---
+1 -1
View File
@@ -1 +1 @@
0.6.0 0.7.0
+38 -1
View File
@@ -32,6 +32,10 @@ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || -n "$WINDIR" ]]; then
export MSYS_NO_PATHCONV=1 export MSYS_NO_PATHCONV=1
export MSYS2_ARG_CONV_EXCL="*" export MSYS2_ARG_CONV_EXCL="*"
# Repli Docker Desktop si aucune distro WSL Arch n'est joignable
# (définit fws_docker_repl, cf. scripts/fws-docker-repl.sh).
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/fws-docker-repl.sh"
# WSL doit être présent (sinon message clair plutôt que command not found). # WSL doit être présent (sinon message clair plutôt que command not found).
command -v wsl.exe >/dev/null 2>&1 || { command -v wsl.exe >/dev/null 2>&1 || {
echo -e "\e[31mWSL introuvable. Installe WSL2 puis une distro Arch :\e[0m" >&2 echo -e "\e[31mWSL introuvable. Installe WSL2 puis une distro Arch :\e[0m" >&2
@@ -63,6 +67,14 @@ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || -n "$WINDIR" ]]; then
echo -e "\e[31mAucune distribution WSL Arch joignable.\e[0m" >&2 echo -e "\e[31mAucune distribution WSL Arch joignable.\e[0m" >&2
echo "Distros WSL installées :" >&2 echo "Distros WSL installées :" >&2
wsl.exe -l -v 2>/dev/null | tr -d '\0' >&2 || true wsl.exe -l -v 2>/dev/null | tr -d '\0' >&2 || true
# Aucune distro WSL Arch ? Si Docker Desktop tourne, on relance ce
# script dans un conteneur archlinux (même principe que le repli
# podman des hôtes Linux non-Arch). fws_docker_repl sort le script
# lui-même en cas de succès ; sinon on garde le message d'erreur.
SCRIPT_DIR_WIN="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -W)"
if fws_docker_repl "build-offi.sh" "$SCRIPT_DIR_WIN"; then
exit 0
fi
echo "" >&2 echo "" >&2
echo "Installe Arch dans WSL puis relance :" >&2 echo "Installe Arch dans WSL puis relance :" >&2
echo " - ArchWSL (yuk7) — s'enregistre sous 'Arch' : https://github.com/yuk7/ArchWSL/releases/latest" >&2 echo " - ArchWSL (yuk7) — s'enregistre sous 'Arch' : https://github.com/yuk7/ArchWSL/releases/latest" >&2
@@ -329,7 +341,7 @@ echo "==> Vérification des services systemd..."
ls /tmp/fws-build/releng/airootfs/etc/systemd/system/ 2>/dev/null || echo " (aucun service)" ls /tmp/fws-build/releng/airootfs/etc/systemd/system/ 2>/dev/null || echo " (aucun service)"
ls /tmp/fws-build/releng/airootfs/etc/systemd/system/multi-user.target.wants/ 2>/dev/null || echo " (aucun symlink)" ls /tmp/fws-build/releng/airootfs/etc/systemd/system/multi-user.target.wants/ 2>/dev/null || echo " (aucun symlink)"
# Copie le repo local (winboat-bin + deps Anaconda packagées) # Copie le repo local (fws-pacmanage + fws-dnd + deps Anaconda packagées)
if ls "$WORK_DIR/local-repo/"*.pkg.tar.zst &>/dev/null 2>&1; then if ls "$WORK_DIR/local-repo/"*.pkg.tar.zst &>/dev/null 2>&1; then
echo "==> Copie du repo local fws-local..." echo "==> Copie du repo local fws-local..."
mkdir -p /tmp/fws-build/local-repo mkdir -p /tmp/fws-build/local-repo
@@ -353,6 +365,31 @@ echo "==> Correction des retours à la ligne Windows (dos2unix)..."
pacman -S --needed --noconfirm dos2unix pacman -S --needed --noconfirm dos2unix
find /tmp/fws-build/releng -type f -exec dos2unix {} + 2>/dev/null find /tmp/fws-build/releng -type f -exec dos2unix {} + 2>/dev/null
# ── Pré-vol : résolution de TOUS les paquets du profil ──
# « error: target not found » ne doit plus surgir en plein mkarchiso : on
# résout la liste complète (packages.x86_64 fusionné) contre le pacman.conf
# du profil (fws-local injecté inclus) dans une base temporaire. S'il manque
# un paquet, on échoue ICI avec la liste + le geste correctif.
echo "==> Pré-vol : résolution des paquets du profil..."
PREFLIGHT_DB="$(mktemp -d)"
pacman -Sy --config /tmp/fws-build/releng/pacman.conf --dbpath "$PREFLIGHT_DB" >/dev/null
mapfile -t PROFILE_PKGS < <(sed -e 's/#.*//' -e 's/[[:space:]]//g' -e '/^$/d' \
/tmp/fws-build/releng/packages.x86_64)
# -Sp n'installe rien (affiche les URLs) ; LC_ALL=C fige le motif d'erreur.
# stderr → capture, stdout → poubelle ; le pipeline sed sort toujours 0.
MISSING="$(LC_ALL=C pacman -Sp --config /tmp/fws-build/releng/pacman.conf \
--dbpath "$PREFLIGHT_DB" "${PROFILE_PKGS[@]}" 2>&1 >/dev/null \
| sed -n 's/^error: target not found:[[:space:]]*//p')"
rm -rf "$PREFLIGHT_DB"
if [ -n "$MISSING" ]; then
echo -e "\e[31mPaquets introuvables dans les dépôts du profil :\e[0m" >&2
printf ' \e[31m%s\e[0m\n' $MISSING >&2
echo -e "\e[33mDépôt fws-local absent/incomplet ? Lance ./setup-aur.sh (construit" >&2
echo -e "anaconda, fws-pacmanage, fws-dnd, …) puis relance ce script.\e[0m" >&2
exit 1
fi
echo "==> Pré-vol OK : ${#PROFILE_PKGS[@]} paquets résolus."
echo "==> Lancement de mkarchiso..." echo "==> Lancement de mkarchiso..."
mkdir -p "$OUT_DIR" mkdir -p "$OUT_DIR"
# mkarchiso fait un « rm » interne de l'ISO cible avant de la (ré)écrire ; si # mkarchiso fait un « rm » interne de l'ISO cible avant de la (ré)écrire ; si
+13 -1
View File
@@ -24,6 +24,10 @@ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || -n "$WINDIR" ]]; then
export MSYS_NO_PATHCONV=1 export MSYS_NO_PATHCONV=1
export MSYS2_ARG_CONV_EXCL="*" export MSYS2_ARG_CONV_EXCL="*"
# Repli Docker Desktop si aucune distro WSL Arch n'est joignable
# (définit fws_docker_repl, cf. scripts/fws-docker-repl.sh).
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/fws-docker-repl.sh"
# WSL doit être présent (sinon message clair plutôt que command not found). # WSL doit être présent (sinon message clair plutôt que command not found).
command -v wsl.exe >/dev/null 2>&1 || { command -v wsl.exe >/dev/null 2>&1 || {
echo -e "\e[31mWSL introuvable. Installe WSL2 puis une distro Arch :\e[0m" >&2 echo -e "\e[31mWSL introuvable. Installe WSL2 puis une distro Arch :\e[0m" >&2
@@ -55,6 +59,14 @@ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || -n "$WINDIR" ]]; then
echo -e "\e[31mAucune distribution WSL Arch joignable.\e[0m" >&2 echo -e "\e[31mAucune distribution WSL Arch joignable.\e[0m" >&2
echo "Distros WSL installées :" >&2 echo "Distros WSL installées :" >&2
wsl.exe -l -v 2>/dev/null | tr -d '\0' >&2 || true wsl.exe -l -v 2>/dev/null | tr -d '\0' >&2 || true
# Aucune distro WSL Arch ? Si Docker Desktop tourne, on relance ce
# script dans un conteneur archlinux (même principe que le repli
# podman des hôtes Linux non-Arch). fws_docker_repl sort le script
# lui-même en cas de succès ; sinon on garde le message d'erreur.
SCRIPT_DIR_WIN="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -W)"
if fws_docker_repl "build.sh" "$SCRIPT_DIR_WIN"; then
exit 0
fi
echo "" >&2 echo "" >&2
echo "Installe Arch dans WSL puis relance :" >&2 echo "Installe Arch dans WSL puis relance :" >&2
echo " - ArchWSL (yuk7) — s'enregistre sous 'Arch' : https://github.com/yuk7/ArchWSL/releases/latest" >&2 echo " - ArchWSL (yuk7) — s'enregistre sous 'Arch' : https://github.com/yuk7/ArchWSL/releases/latest" >&2
@@ -232,7 +244,7 @@ echo "==> Vérification des services systemd..."
ls /tmp/fws-build/releng/airootfs/etc/systemd/system/ 2>/dev/null || echo " (aucun service)" ls /tmp/fws-build/releng/airootfs/etc/systemd/system/ 2>/dev/null || echo " (aucun service)"
ls /tmp/fws-build/releng/airootfs/etc/systemd/system/multi-user.target.wants/ 2>/dev/null || echo " (aucun symlink)" ls /tmp/fws-build/releng/airootfs/etc/systemd/system/multi-user.target.wants/ 2>/dev/null || echo " (aucun symlink)"
# Copie le repo local (winboat-bin + deps Anaconda packagées) # Copie le repo local (fws-pacmanage + fws-dnd + deps Anaconda packagées)
if ls "$WORK_DIR/local-repo/"*.pkg.tar.zst &>/dev/null 2>&1; then if ls "$WORK_DIR/local-repo/"*.pkg.tar.zst &>/dev/null 2>&1; then
echo "==> Copie du repo local fws-local..." echo "==> Copie du repo local fws-local..."
mkdir -p /tmp/fws-build/local-repo mkdir -p /tmp/fws-build/local-repo
+1 -1
View File
@@ -133,7 +133,7 @@ if command -v liveinst >/dev/null 2>&1; then
# (Les mentions Fedora PROFONDES dans les logs — GeoIP, profils — restent : # (Les mentions Fedora PROFONDES dans les logs — GeoIP, profils — restent :
# ce sont des chaînes internes de l'installateur, sans effet sur l'install.) # ce sont des chaînes internes de l'installateur, sans effet sur l'install.)
export ANACONDA_PRODUCTNAME="$(. /etc/os-release 2>/dev/null; echo "${NAME:-FWS}")" export ANACONDA_PRODUCTNAME="$(. /etc/os-release 2>/dev/null; echo "${NAME:-FWS}")"
export ANACONDA_PRODUCTVERSION="$(. /etc/os-release 2>/dev/null; echo "${VERSION_ID:-0.6}")" export ANACONDA_PRODUCTVERSION="$(. /etc/os-release 2>/dev/null; echo "${VERSION_ID:-0.7}")"
export ANACONDA_ISFINAL=true export ANACONDA_ISFINAL=true
LIVEINST_LOG=/tmp/fws-liveinst.log LIVEINST_LOG=/tmp/fws-liveinst.log
@@ -13,3 +13,25 @@ set -euo pipefail
# sinon « locale.Error: unsupported locale setting » → le module Boss plante). # sinon « locale.Error: unsupported locale setting » → le module Boss plante).
# ~3 Mo générés, vs 222 Mo pour le paquet glibc-locales complet. # ~3 Mo générés, vs 222 Mo pour le paquet glibc-locales complet.
locale-gen locale-gen
# --- Overlays pyanaconda (écran de progression FWS) ---------------------------
# mkarchiso copie l'airootfs AVANT le pacstrap (cf. fws/mkarchiso :
# _make_custom_airootfs puis _make_packages) : un fichier de l'airootfs qui
# remplace un fichier du paquet « anaconda » fait échouer pacman (« exists in
# filesystem ») et donc tout le build. Ces deux fichiers vivent donc hors des
# chemins du paquet, et on les pose ICI, après l'installation : c'est le seul
# moment où écraser un fichier de paquet est légitime (et le script est
# supprimé après exécution, il ne part pas dans l'ISO).
if [ -d /usr/local/share/fws/anaconda-overlay/pyanaconda ]; then
cp -a /usr/local/share/fws/anaconda-overlay/. /usr/lib/python3.14/site-packages/
rm -rf /usr/local/share/fws/anaconda-overlay
# Le build doit s'arrêter net si l'overlay n'a pas atterri : sans lui, plus
# d'écran de progression détaillé (mais l'installateur fonctionne quand même).
for _f in modules/runtime/scripts/runtime.py modules/boss/installation.py; do
if [ ! -f "/usr/lib/python3.14/site-packages/pyanaconda/${_f}" ]; then
echo "[FWS] overlay pyanaconda manquant : ${_f}" >&2
exit 1
fi
done
fi
@@ -0,0 +1,452 @@
# FWS — Écran « Connexion Internet » juste après le choix de la langue.
#
# POURQUOI ICI (airootfs, pas dans le paquet anaconda) : même mécanisme que
# fws_desktop.py / fws_recap.py — Anaconda découvre les spokes au RUNTIME dans
# ce dossier → l'overlay airootfs suffit, AUCUN rebuild du paquet anaconda.
# Le glade associé est dans /usr/share/anaconda/ui/spokes/fws_network.glade.
#
# SIMPLICITÉ (demande utilisateur) : l'écran réseau complet d'Anaconda
# (NetworkControlBox — onglets, options avancées, champ hostname…) a été jugé
# illisible. On le remplace par un sélecteur minimal, façon téléphone :
# 1. une liste « Réseaux détectés » (Ethernet branché + Wi-Fi triés par
# puissance),
# 2. on clique sur un réseau Wi-Fi,
# 3. si le Wi-Fi est sécurisé : on tape le mot de passe, « Se connecter »,
# 4. « Connecté ✓ » → « Continuer ».
# Les réseaux Wi-Fi ouverts se connectent au clic ; le câble Ethernet aussi.
# Le bouton « Continuer » reste toujours disponible (pas de réseau = on peut
# passer outre, le récap + le rattrapage fws-desktop-finalize gèrent le hors
# ligne).
#
# PLACEMENT DANS LE FLUX (inchangé) : standalone spoke « preForHub » —
# WelcomeLanguageSpoke (preForHub=SummaryHub, priority=0)
# → CE spoke (preForHub=SummaryHub, priority=10)
# → SummaryHub → fws_recap (postForHub, -10) → installation
# « completed » reste False : _instantiateAction SAUTE tout standalone
# « completed » (prévu pour les installs kickstart) — il doit s'afficher.
#
# PERSISTANCE DU Wi-Fi CHOISI : la connexion est faite par NetworkManager sur
# le LIVE → son profil est écrit dans /etc/NetworkManager/system-connections/
# du live (overlay temporaire — PAS recopié par le payload LiveOS, qui copie
# le squashfs). apply() pose donc /tmp/fws-keep-wifi ; le %post --nochroot du
# kickstart copie alors les profils live vers la CIBLE → au 1er démarrage du
# système installé (et pendant le %post chrooté, qui tourne sur la pile réseau
# du live), le Wi-Fi fonctionne sans ressaisie.
#
# ⚠ Chemin couplé à la version de Python d'Arch (3.14), comme fws_desktop.py.
# ⚠ importlib inutile ici : plus de sous-classe du spoke réseau d'anaconda, on
# hérite directement de StandaloneSpoke (aucune classe parente dans le
# namespace → collect() ne découvre que la nôtre).
import subprocess
import threading
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import GLib, Gtk
from pyanaconda.anaconda_loggers import get_module_logger
from pyanaconda.ui.gui.hubs.summary import SummaryHub
from pyanaconda.ui.gui.spokes import StandaloneSpoke
log = get_module_logger(__name__)
__all__ = ["FWSNetworkStandaloneSpoke"]
_NMCLI = "/usr/bin/nmcli"
_KEEP_WIFI = "/tmp/fws-keep-wifi"
# Couleurs des messages de retour (markup Pango).
_GREEN = "#1e7145"
_RED = "#b3261e"
_GREY = "#555555"
def _nm(args, timeout=30):
"""`nmcli` → (code retour, stdout). Jamais d'exception vers l'UI."""
try:
proc = subprocess.run(
[_NMCLI] + args, capture_output=True, text=True, timeout=timeout)
return proc.returncode, proc.stdout or ""
except Exception: # pylint: disable=broad-except
return -1, ""
def _split_escaped(line):
"""Découpe une ligne `nmcli -t` (séparateur ':', '\\:' et '\\\\' échappés)."""
fields, cur, i = [], "", 0
while i < len(line):
c = line[i]
if c == "\\" and i + 1 < len(line) and line[i + 1] in (":", "\\"):
cur += line[i + 1]
i += 2
elif c == ":":
fields.append(cur)
cur = ""
i += 1
else:
cur += c
i += 1
fields.append(cur)
return fields
class FWSNetworkStandaloneSpoke(StandaloneSpoke):
"""Choix simple du réseau (Ethernet / Wi-Fi + mot de passe) avant le hub."""
builderObjects = ["fwsNetworkWindow", "netTitle", "netList", "netFeedback",
"pwPanel", "pwTitle", "pwEntry", "pwShow", "pwConnect",
"refreshButton"]
mainWidgetName = "fwsNetworkWindow"
uiFile = "spokes/fws_network.glade"
preForHub = SummaryHub
priority = 10
@staticmethod
def get_screen_id():
"""Identifiant unique de cet écran."""
return "fws-network-pre-configuration"
def __init__(self, *args):
StandaloneSpoke.__init__(self, *args)
self._wifi_connected = False # un Wi-Fi a été connecté ici
self._busy = False
self._current_ssid = None
self._networks = [] # refs des rangées pour re-sélection
# ------------------------------------------------------------------ UI --
@property
def completed(self):
# Toujours demander (jamais auto-sauté) ; continuer reste possible
# sans réseau.
return False
def initialize(self):
StandaloneSpoke.initialize(self)
self._title = self.builder.get_object("netTitle")
self._title.set_markup(
'<span size="x-large"><b>Connexion à Internet</b></span>')
self._list = self.builder.get_object("netList")
self._list.connect("row-selected", self._on_row_selected)
self._feedback = self.builder.get_object("netFeedback")
self._panel = self.builder.get_object("pwPanel")
self._pw_title = self.builder.get_object("pwTitle")
self._entry = self.builder.get_object("pwEntry")
self._entry.connect("activate", lambda _w: self._connect_selected())
self.builder.get_object("pwShow").connect(
"toggled", self._on_show_toggled)
self.builder.get_object("pwConnect").connect(
"clicked", lambda _b: self._connect_selected())
self.builder.get_object("refreshButton").connect(
"clicked", lambda _b: self._refresh_clicked())
self._panel.hide()
self._show_feedback("", _GREY)
# L'UI écoute « continue-clicked » en connect_after : on pose notre
# apply() AVANT la transition (marqueur Wi-Fi vers la cible).
self.window.connect("continue-clicked", self._on_continue_clicked)
def _on_continue_clicked(self, *_args):
self.apply()
def refresh(self):
# À chaque entrée sur l'écran : liste à jour + état courant.
self._build_list(rescan=False)
# Cache Wi-Fi souvent vide au tout premier affichage (NM n'a pas
# encore scanné) → un rescan automatique si rien n'est listé.
if not self._networks and not getattr(self, "_rescanning", False):
self._rescanning = True
threading.Thread(target=self._refresh_worker, daemon=True).start()
def apply(self):
# Persistance du Wi-Fi vers le système installé (cf. en-tête).
if self._wifi_connected or self._active_wifi_ssid():
try:
with open(_KEEP_WIFI, "w") as fh:
fh.write("1")
except OSError:
pass
# ------------------------------------------------------------ données --
def _scan(self, rescan):
"""(wifi, ethernet) : wifi = liste de dicts, ethernet = liste de
(interface, état). Sans jamais bloquer l'UI plus d'un instant."""
wifi = []
if rescan:
_nm(["-w", "12", "dev", "wifi", "rescan"])
rc, out = _nm(["-t", "-f", "IN-USE,SSID,SIGNAL,SECURITY",
"dev", "wifi", "list"])
if rc == 0:
for line in out.splitlines():
f = _split_escaped(line)
if len(f) < 4:
continue
ssid = f[1].strip()
if not ssid:
continue
try:
signal = int(f[2] or 0)
except ValueError:
signal = 0
wifi.append({
"inuse": f[0].strip() == "*",
"ssid": ssid,
"signal": signal,
"secured": bool(f[3].strip()),
})
# Tri : connecté d'abord, puis puissance décroissante.
wifi.sort(key=lambda n: (not n["inuse"], -n["signal"]))
eth = []
rc, out = _nm(["-t", "-f", "DEVICE,TYPE,STATE", "device", "status"])
if rc == 0:
for line in out.splitlines():
f = _split_escaped(line)
if len(f) >= 3 and f[1] == "ethernet":
eth.append((f[0], f[2].strip()))
return wifi, eth
def _active_wifi_ssid(self):
rc, out = _nm(["-t", "-f", "NAME,TYPE", "connection", "show",
"--active"])
if rc == 0:
for line in out.splitlines():
f = _split_escaped(line)
if len(f) >= 2 and f[1] == "wifi":
return f[0]
return ""
def _build_list(self, rescan):
wifi, eth = self._scan(rescan)
for row in self._list.get_children():
self._list.remove(row)
self._networks = []
had_conn = False
def add_row(kind, main, detail, meta, inuse=False):
row = Gtk.ListBoxRow()
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=12)
hbox.set_margin_start(10)
hbox.set_margin_end(10)
hbox.set_margin_top(8)
hbox.set_margin_bottom(8)
name = Gtk.Label(label=main, xalign=0.0, hexpand=True,
wrap=True)
name.set_markup(f"<b>{GLib.markup_escape_text(main)}</b>")
hbox.pack_start(name, True, True, 0)
right = Gtk.Label(label=detail, xalign=1.0)
right.set_markup(
f'<span color="{_GREY}">{GLib.markup_escape_text(detail)}</span>')
hbox.pack_start(right, False, False, 0)
row.add(hbox)
row._meta = dict(meta)
row._meta["inuse"] = inuse
row.show_all()
self._list.add(row)
self._networks.append(row)
for iface, state in eth:
if state == "connected":
had_conn = True
add_row("eth", "Ethernet (câble)", "Connecté ✓",
{"kind": "eth", "iface": iface, "state": state},
inuse=True)
elif state == "disconnected":
add_row("eth", "Ethernet (câble)", "Cliquer pour se connecter",
{"kind": "eth", "iface": iface, "state": state})
# "unavailable" = pas de câble : inutile de l'afficher.
for n in wifi:
if n["inuse"]:
had_conn = True
detail = "Connecté ✓"
elif n["secured"]:
detail = f"{n['signal']} % · sécurisé"
else:
detail = f"{n['signal']} % · ouvert"
add_row("wifi", n["ssid"], detail,
{"kind": "wifi", "ssid": n["ssid"],
"secured": n["secured"]}, inuse=n["inuse"])
# Message d'état global.
active_wifi = self._active_wifi_ssid()
if active_wifi:
self._show_feedback(f"Connecté au Wi-Fi « {active_wifi} » ✓ — "
"vous pouvez continuer.", _GREEN)
elif had_conn:
self._show_feedback("Connecté à Internet (Ethernet) ✓ — "
"vous pouvez continuer.", _GREEN)
elif not self._networks:
self._show_feedback(
"Aucun réseau détecté. Vérifiez que le Wi-Fi est activé, "
"branchez un câble Ethernet, ou cliquez « Rafraîchir ».", _RED)
else:
self._show_feedback(
"Cliquez sur un réseau Wi-Fi pour vous connecter "
"(ou branchez un câble Ethernet).", _GREY)
self._hide_password_panel()
def _show_feedback(self, text, color=_GREY):
if text:
self._feedback.set_markup(
f'<span color="{color}">{GLib.markup_escape_text(text)}</span>')
else:
self._feedback.set_text("")
# ------------------------------------------------------------ actions --
def _on_row_selected(self, _listbox, row):
if row is None or self._busy:
return
meta = row._meta
self._hide_password_panel()
if meta["kind"] == "eth":
if meta["state"] == "connected":
self._show_feedback(
"Ethernet déjà connecté — vous pouvez continuer.", _GREEN)
else:
self._connect_eth(meta["iface"])
return
# Wi-Fi
if meta["inuse"]:
self._show_feedback(
f"Vous êtes déjà connecté au Wi-Fi « {meta['ssid']} ».",
_GREEN)
return
self._current_ssid = meta["ssid"]
if meta["secured"]:
self._pw_title.set_markup(
f'Mot de passe du réseau Wi-Fi « '
f'<b>{GLib.markup_escape_text(meta["ssid"])}</b> » :')
self._entry.set_text("")
self._entry.set_editable(True)
self._entry.set_visibility(
self.builder.get_object("pwShow").get_active())
self._panel.show()
self._entry.grab_focus()
self._show_feedback(
f"Tapez le mot de passe de « {meta['ssid']} » puis cliquez "
"« Se connecter ».", _GREY)
else:
self._connect_wifi(meta["ssid"], None)
def _refresh_clicked(self):
if self._busy:
return
self._show_feedback("Recherche des réseaux…", _GREY)
self._set_busy(True, list_only=True)
threading.Thread(target=self._refresh_worker, daemon=True).start()
def _refresh_worker(self):
# Le rescan prend quelques secondes : on le fait hors UI.
_nm(["-w", "15", "dev", "wifi", "rescan"])
GLib.idle_add(self._refresh_done)
def _refresh_done(self):
self._rescanning = False
self._set_busy(False)
self._build_list(rescan=False)
return False
def _connect_selected(self):
if self._busy or not self._current_ssid:
return
password = self._entry.get_text()
if not password:
self._show_feedback("Tapez d'abord le mot de passe.", _RED)
return
self._connect_wifi(self._current_ssid, password)
def _connect_eth(self, iface):
self._show_feedback(f"Connexion Ethernet ({iface})…", _GREY)
self._set_busy(True)
threading.Thread(target=self._eth_worker, args=(iface,),
daemon=True).start()
def _connect_wifi(self, ssid, password):
self._show_feedback(f"Connexion au Wi-Fi « {ssid} »…", _GREY)
self._set_busy(True)
threading.Thread(target=self._wifi_worker, args=(ssid, password),
daemon=True).start()
def _eth_worker(self, iface):
rc, _out = _nm(["-w", "25", "device", "connect", iface])
GLib.idle_add(self._connect_done,
rc == 0, "Ethernet", iface, None)
def _wifi_worker(self, ssid, password):
args = ["-w", "25", "dev", "wifi", "connect", ssid]
if password:
args += ["password", password]
rc, _out = _nm(args)
ok = rc == 0
if not ok:
# Profil déjà actif (déjà connecté) → nmcli renvoie une erreur
# alors que le réseau est bien là.
ok = self._active_wifi_ssid() == ssid
GLib.idle_add(self._connect_done, ok, "wifi", ssid, password)
def _connect_done(self, ok, kind, name, password):
self._set_busy(False)
if ok:
if kind == "wifi":
self._wifi_connected = True
self._current_ssid = None
self._hide_password_panel()
self._show_feedback(
f"Connecté au Wi-Fi « {name} » ✓ — vous pouvez "
"continuer.", _GREEN)
# Marqueur pour le %post (profils NM vers la cible).
try:
with open(_KEEP_WIFI, "w") as fh:
fh.write("1")
except OSError:
pass
else:
self._show_feedback(
"Ethernet connecté ✓ — vous pouvez continuer.", _GREEN)
self._build_list(rescan=False) # marque « Connecté ✓ » + état
else:
if kind == "wifi":
self._show_feedback(
f"Connexion à « {name} » impossible : mot de passe "
"incorrect, ou réseau hors de portée. Réessayez.", _RED)
if password is not None:
# On garde la main sur le champ pour corriger.
self._current_ssid = name
self._entry.set_text("")
self._entry.set_editable(True)
self._entry.set_visibility(
self.builder.get_object("pwShow").get_active())
self._panel.show()
self._entry.grab_focus()
else:
self._show_feedback(
"Connexion Ethernet impossible (câble débranché ?).",
_RED)
return False
# ------------------------------------------------------------ helpers --
def _set_busy(self, busy, list_only=False):
self._busy = busy
self._list.set_sensitive(not busy)
if not list_only:
self.builder.get_object("pwConnect").set_sensitive(not busy)
# curseur « occupé » léger
window = self.window
if window and hasattr(window, "set_busy_cursor"):
try:
if busy:
window.set_busy_cursor()
else:
window.unset_busy_cursor()
except Exception: # pylint: disable=broad-except
pass
def _hide_password_panel(self):
self._panel.hide()
self._current_ssid = None
self._entry.set_text("")
def _on_show_toggled(self, check):
self._entry.set_visibility(check.get_active())
if check.get_active():
self._entry.grab_focus()
@@ -211,7 +211,7 @@ def _build_summary():
net = ("INDISPONIBLE ✖ — bureau, drivers et stack FWS ne\n" net = ("INDISPONIBLE ✖ — bureau, drivers et stack FWS ne\n"
" s'installeront PAS (rattrapable au 1er boot)") " s'installeront PAS (rattrapable au 1er boot)")
extras = ("Steam, Wine, VR (Monado/OpenXR), winboat-bin" extras = ("Steam, Wine, VR (Monado/OpenXR), PacManager"
if desk != "cli" else "rien de plus (choix CLI)") if desk != "cli" else "rien de plus (choix CLI)")
return f"""\ return f"""\
@@ -0,0 +1,906 @@
#
# Copyright (C) 2021 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY expressed or implied, including the implied warranties of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details. You should have received a copy of the
# GNU General Public License along with this program; if not, write to the
# Free Software Foundation, Inc., 31 Milk Street #960789 Boston, MA
# 02196 USA. Any Red Hat trademarks that are incorporated in the
# source code or documentation are not subject to the GNU General Public
# License and may only be used or replicated with the express permission of
# Red Hat, Inc.
import glob
import os.path
import shutil
from dasbus.error import DBusError
from threading import Event
from pykickstart.constants import (
KS_SCRIPT_POST,
KS_SCRIPT_PREINSTALL,
SNAPSHOT_WHEN_POST_INSTALL,
)
from pyanaconda import flags, network
from pyanaconda.anaconda_loggers import get_module_logger
from pyanaconda.core import util
from pyanaconda.core.configuration.anaconda import conf
from pyanaconda.core.constants import (
CATEGORY_BOOTLOADER,
CATEGORY_ENVIRONMENT,
CATEGORY_SOFTWARE,
CATEGORY_STORAGE,
CATEGORY_SYSTEM,
PAYLOAD_LIVE_TYPES,
PAYLOAD_TYPE_DNF,
)
from pyanaconda.core.i18n import _
from pyanaconda.core.path import (
join_paths,
make_directories,
open_with_perm,
)
from pyanaconda.core.service import is_service_installed
from pyanaconda.core.signal import Signal
from pyanaconda.core.util import execWithRedirect, restorecon
from pyanaconda.installation_tasks import DBusTask, Task, TaskQueue
from pyanaconda.kexec import setup_kexec
from pyanaconda.modules.boss.install_manager.installation_category_interface import (
CategoryReportTaskInterface,
)
from pyanaconda.modules.common.constants.installation import InstallationErrorDialogType
from pyanaconda.modules.common.constants.objects import (
BOOTLOADER,
CERTIFICATES,
FIREWALL,
SCRIPTS,
SNAPSHOT,
)
from pyanaconda.modules.common.constants.services import (
BOSS,
LOCALIZATION,
NETWORK,
PAYLOADS,
RUNTIME,
SECURITY,
SERVICES,
STORAGE,
SUBSCRIPTION,
TIMEZONE,
USERS,
)
from pyanaconda.modules.common.task import Task as InstallationTask
from pyanaconda.modules.common.task import sync_run_task
from pyanaconda.modules.common.util import is_module_available
log = get_module_logger(__name__)
TARGET_LOG_DIR = "/var/log/anaconda/"
def _writeKS_via_boss():
boss_proxy = BOSS.get_proxy()
ks_string = boss_proxy.GenerateKickstart()
path = conf.target.system_root + "/root/anaconda-ks.cfg"
with open_with_perm(path, "w", 0o600) as f:
f.write("# Generated by Anaconda {}\n".format(util.get_anaconda_version_string()))
f.write(ks_string)
class CopyLogsTask(InstallationTask):
"""Task to copy logs to target system."""
def __init__(self, sysroot):
"""Create a new task.
:param sysroot: a path to the root of installed system
:type sysroot: str
"""
super().__init__()
self._sysroot = sysroot
@property
def name(self):
return "Copy installation logs"
def run(self):
"""Copy installation logs and other related files, and do necessary operations on them.
- Copy logs of all kinds, incl. ks scripts, journal dump, and lorax pkg list
- Copy input kickstart file
- SELinux contexts are left as is (fixed by SetContextsTask)
"""
self._copy_kickstart()
self._copy_logs()
def _copy_logs(self):
"""Copy installation logs to the target system"""
if not conf.target.can_save_installation_logs:
log.warning("Installation logs will not be saved to the installed system due to the "
"nosave option.")
return
log.info("Copying logs from the installation environment.")
self._create_logs_directory()
self._copy_tmp_logs()
self._copy_lorax_packages()
self._copy_pre_script_logs()
self._copy_dnf_debugdata()
self._copy_post_script_logs()
self._dump_journal()
def _create_logs_directory(self):
"""Create directory for Anaconda logs on the install target"""
make_directories(join_paths(self._sysroot, TARGET_LOG_DIR))
def _copy_tmp_logs(self):
"""Copy a number of log files from /tmp"""
log_files_to_copy = [
"anaconda.log",
"syslog",
"X.log",
"program.log",
"packaging.log",
"storage.log",
"ifcfg.log",
"lvm.log",
"dnf.librepo.log",
"hawkey.log",
"dbus.log",
]
for logfile in log_files_to_copy:
self._copy_file_to_sysroot(
join_paths("/tmp/", logfile),
join_paths(TARGET_LOG_DIR, logfile)
)
def _copy_lorax_packages(self):
"""Copy list of packages used for creating the installation media"""
self._copy_file_to_sysroot(
"/root/lorax-packages.log",
join_paths(TARGET_LOG_DIR, "lorax-packages.log")
)
def _copy_pre_script_logs(self):
"""Copy logs from %pre scripts"""
self._copy_tree_to_sysroot(
"/tmp/pre-anaconda-logs",
TARGET_LOG_DIR
)
def _copy_dnf_debugdata(self):
"""Copy DNF debug data"""
self._copy_tree_to_sysroot(
"/root/debugdata",
join_paths(TARGET_LOG_DIR, "dnf_debugdata/")
)
def _copy_post_script_logs(self):
"""Copy logs from %post scripts"""
for logfile in glob.glob("/tmp/ks-script*.log"):
self._copy_file_to_sysroot(
logfile,
join_paths(TARGET_LOG_DIR, os.path.basename(logfile))
)
def _dump_journal(self):
"""Dump journal from the installation environment"""
tempfile = "/tmp/journal.log"
with open_with_perm(tempfile, "w", perm=0o600) as logfile:
execWithRedirect("journalctl", ["-b"], stdout=logfile, log_output=False)
self._copy_file_to_sysroot(tempfile, join_paths(TARGET_LOG_DIR, "journal.log"))
def _copy_kickstart(self):
"""Copy input kickstart file"""
if conf.target.can_copy_input_kickstart:
log.info("Copying input kickstart file.")
self._copy_file_to_sysroot(
"/run/install/ks.cfg",
"/root/original-ks.cfg"
)
else:
log.warning("Input kickstart will not be saved to the installed system due to the "
"nosave option.")
def _copy_file_to_sysroot(self, src, dest):
"""Copy a file, if it exists, and set its access bits.
:param str src: path to source file
:param str dest: path to destination file within sysroot
"""
if os.path.exists(src):
log.info("Copying file: %s -> %s", src, dest)
full_dest_path = join_paths(self._sysroot, dest)
shutil.copyfile(
src,
full_dest_path
)
os.chmod(full_dest_path, 0o0600)
def _copy_tree_to_sysroot(self, src, dest):
"""Copy a directory tree, if it exists, and set its access bits.
:param str src: path to source directory
:param str dest: path to destination directory within sysroot
"""
if os.path.exists(src):
log.info("Copying directory tree: %s -> %s", src, dest)
full_dest_path = join_paths(self._sysroot, dest)
shutil.copytree(
src,
full_dest_path,
dirs_exist_ok=True
)
os.chmod(full_dest_path, 0o0600)
class SetContextsTask(InstallationTask):
"""Task to set file contexts on target system.
We need to handle SELinux relabeling for a few reasons:
- %post scripts that write files into places in /etc, but don't do labeling correctly
- Anaconda code that does the same (e.g. moving our log files into /var/log/anaconda)
- ostree payloads, where all of the labeling of /var is the installer's responsibility
(see https://github.com/ostreedev/ostree/pull/872 )
- OSTree variants of the traditional mounts if present
"""
def __init__(self, sysroot):
"""Create a new task.
:param sysroot: a path to the root of installed system
:type sysroot: str
"""
super().__init__()
self._sysroot = sysroot
@property
def name(self):
return "Set file contexts"
def run(self):
"""Relabel files (set contexts).
Do not fail if the executable is not present.
"""
dirs_to_relabel = [
"/boot",
"/dev",
"/etc",
"/lib64",
"/root",
"/usr/lib",
"/usr/lib64",
"/var/cache/yum",
"/var/home",
"/var/lib",
"/var/lock",
"/var/log",
"/var/media",
"/var/mnt",
"/var/opt",
"/var/roothome",
"/var/run",
"/var/spool",
"/var/srv"
]
log.info("Restoring SELinux contexts.")
if not restorecon(dirs_to_relabel, root=self._sysroot, skip_nonexistent=True):
log.warning("Cannot restore contexts because restorecon was not installed.")
# Module-private helper for RunInstallationTask.
class _RemoteErrorUI:
"""Error UI proxy that forwards dialog calls to the real UI over D-Bus.
This is used in the Boss process where errorHandler.ui is not set.
It forwards showYesNoQuestion, showDetailedError, and showError
calls via the RunInstallationTask's error_raised_signal, blocking
until the UI responds via respond_to_error.
"""
def __init__(self, task):
self._task = task
def showYesNoQuestion(self, message):
return self._task._show_dialog(message, InstallationErrorDialogType.YES_NO)
def showDetailedError(self, message, details, buttons=None):
full_message = message
if details:
full_message += "\n\n" + details
self._task._show_dialog(full_message, InstallationErrorDialogType.FATAL_ERROR)
return False
def showError(self, message):
self._task._show_dialog(message, InstallationErrorDialogType.FATAL_ERROR)
class RunInstallationTask(InstallationTask):
"""Task to run the installation queue."""
def __init__(self, install_manager):
"""Create a new task.
"""
super().__init__()
self._total_steps = 0
self._install_manager = install_manager
self._error_raised_signal = Signal()
self._error_response_event = Event()
self._error_should_continue = False
# FWS: the post-install scripts task reports one step per phase instead
# of taking a single step for the whole %post, so the progress bar
# follows what the installer is actually doing. _fws_scripts_steps is
# how many steps it occupies, _fws_scripts_base the absolute position
# where the phase starts.
self._fws_scripts_task = None
self._fws_scripts_steps = 1
self._fws_scripts_base = 0
self._fws_scripts_active = False
@property
def error_raised_signal(self):
"""Signal emitted when an error needs user interaction.
Carries the error message string and InstallationErrorDialogType value.
"""
return self._error_raised_signal
def _show_dialog(self, message, dialog_type):
"""Emit error signal and block until UI responds.
:param message: the error message to display
:param dialog_type: the type of dialog to show
"""
self._error_response_event.clear()
self._error_raised_signal.emit(message, dialog_type.value)
self._error_response_event.wait()
return self._error_should_continue
def respond_to_error(self, should_continue):
"""Respond to a previously reported error.
:param should_continue: True to continue, False to abort.
"""
self._error_should_continue = should_continue
self._error_response_event.set()
@property
def name(self):
"""Name of the task"""
return "Run the installation queue."
@property
def steps(self):
"""Total number of steps."""
return self._total_steps
def run(self):
"""Run the task."""
self._run_installation()
def for_publication(self):
"""Return a DBus representation."""
return CategoryReportTaskInterface(self)
def _queue_started_cb(self, task):
"""The installation queue was started."""
self.report_category(task.task_category)
self.report_progress(task.status_message)
# FWS: remember where the post-install scripts start, so the sub-steps
# they report land inside the span reserved for them in _total_steps.
if task.name == "Post installation scripts" and self._fws_scripts_steps > 1:
self._fws_scripts_active = True
self._fws_scripts_base = self.progress[0]
def _task_completed_cb(self, task):
"""The installation task was completed."""
if task is self._fws_scripts_task:
# FWS: this task owned several steps, not just one.
self._fws_scripts_active = False
self.report_progress("", step_size=self._fws_scripts_steps)
return
self.report_progress("", step_size=1)
def _progress_report_cb(self, step, message):
"""Handle a progress report of a task."""
if self._fws_scripts_active:
# FWS: the scripts task reports its own step numbers; translate
# them into absolute positions of the installation progress.
self.report_progress(
message,
step_number=min(self._fws_scripts_base + step, self.steps)
)
return
self.report_progress(message)
def _prepare_configuration(self):
"""Prepare queue with tasks configuring installed system."""
payloads_proxy = PAYLOADS.get_proxy()
payload_path = payloads_proxy.ActivePayload
if not payload_path:
log.error("No active payload found! Can't continue install.")
raise RuntimeError("No active payload")
payload_proxy = PAYLOADS.get_proxy(payload_path)
configuration_queue = TaskQueue("Configuration queue")
# connect progress reporting
configuration_queue.queue_started.connect(self._queue_started_cb)
configuration_queue.task_completed.connect(self._task_completed_cb)
# import certificates first
# they may be required for subscription, initramfs regenerating, ... ?
if is_module_available(SECURITY):
certificates_import = TaskQueue(
"Certificates import",
_("Importing certificates"),
CATEGORY_SYSTEM
)
certificates_proxy = SECURITY.get_proxy(CERTIFICATES)
certificates_import.append_dbus_tasks(SECURITY, [
certificates_proxy.InstallWithTask()
])
configuration_queue.append(certificates_import)
# schedule the execute methods of ksdata that require an installed system to be present
os_config = TaskQueue(
"Installed system configuration",
_("Configuring installed system"),
CATEGORY_SYSTEM
)
# add installation tasks for the Security DBus module
if is_module_available(SECURITY):
security_proxy = SECURITY.get_proxy()
security_dbus_tasks = security_proxy.InstallWithTasks()
os_config.append_dbus_tasks(SECURITY, security_dbus_tasks)
# add installation tasks for the Timezone DBus module
# run these tasks before tasks of the Services module
if is_module_available(TIMEZONE):
timezone_proxy = TIMEZONE.get_proxy()
timezone_dbus_tasks = timezone_proxy.InstallWithTasks()
os_config.append_dbus_tasks(TIMEZONE, timezone_dbus_tasks)
# add installation tasks for the Services DBus module
if is_module_available(SERVICES):
services_proxy = SERVICES.get_proxy()
services_dbus_tasks = services_proxy.InstallWithTasks()
os_config.append_dbus_tasks(SERVICES, services_dbus_tasks)
# add installation tasks for the Localization DBus module
if is_module_available(LOCALIZATION):
localization_proxy = LOCALIZATION.get_proxy()
localization_dbus_tasks = localization_proxy.InstallWithTasks()
os_config.append_dbus_tasks(LOCALIZATION, localization_dbus_tasks)
# add the Firewall configuration task
if conf.target.can_configure_network:
firewall_proxy = NETWORK.get_proxy(FIREWALL)
firewall_dbus_task = firewall_proxy.InstallWithTask()
os_config.append_dbus_tasks(NETWORK, [firewall_dbus_task])
configuration_queue.append(os_config)
# schedule network configuration (if required)
if conf.target.can_configure_network and conf.system.provides_network_config:
overwrite = payload_proxy.Type in PAYLOAD_LIVE_TYPES
network_config = TaskQueue(
"Network configuration",
_("Writing network configuration"),
CATEGORY_SYSTEM
)
network_config.append(Task(
"Network configuration",
network.write_configuration,
(overwrite, )
))
configuration_queue.append(network_config)
# add installation tasks for the Subscription DBus module
if is_module_available(SUBSCRIPTION):
# we only run the tasks if the Subscription module is available
subscription_config = TaskQueue(
"Subscription configuration",
_("Configuring Red Hat subscription"),
CATEGORY_SYSTEM
)
subscription_proxy = SUBSCRIPTION.get_proxy()
subscription_dbus_tasks = subscription_proxy.InstallWithTasks()
subscription_config.append_dbus_tasks(SUBSCRIPTION, subscription_dbus_tasks)
configuration_queue.append(subscription_config)
# add installation tasks for the Users DBus module
if is_module_available(USERS):
user_config = TaskQueue(
"User creation",
_("Creating users"),
CATEGORY_SYSTEM
)
users_proxy = USERS.get_proxy()
users_dbus_tasks = users_proxy.InstallWithTasks()
user_config.append_dbus_tasks(USERS, users_dbus_tasks)
configuration_queue.append(user_config)
# Anaconda addon configuration
addon_config = TaskQueue(
"Anaconda addon configuration",
_("Configuring addons"),
CATEGORY_SYSTEM
)
tasks_list = self._install_manager.collect_install_system_tasks()
for task_proxy in tasks_list:
addon_config.append(DBusTask(task_proxy))
configuration_queue.append(addon_config)
# Initramfs generation
generate_initramfs = TaskQueue(
"Initramfs generation",
_("Generating initramfs"),
CATEGORY_BOOTLOADER
)
bootloader_proxy = STORAGE.get_proxy(BOOTLOADER)
def run_generate_initramfs():
tasks = bootloader_proxy.GenerateInitramfsWithTasks(
payload_proxy.Type,
payloads_proxy.GetKernelVersionList()
)
for task in tasks:
sync_run_task(STORAGE.get_proxy(task))
generate_initramfs.append(Task(
"Generate initramfs",
run_generate_initramfs
))
configuration_queue.append(generate_initramfs)
if is_module_available(SECURITY):
security_proxy = SECURITY.get_proxy()
# Configure FIPS.
configuration_queue.append_dbus_tasks(SECURITY, [
security_proxy.ConfigureFIPSWithTask()
])
# Join a realm. This can run only after network
# is configured in the target system chroot.
configuration_queue.append_dbus_tasks(SECURITY, [
security_proxy.JoinRealmWithTask()
])
# Calling zipl should be the last task on s390
configuration_queue.append_dbus_tasks(STORAGE, [
bootloader_proxy.FixZIPLBootloaderWithTask()
])
# setup kexec reboot if requested
if flags.flags.kexec:
kexec_setup = TaskQueue(
"Kexec setup",
_("Setting up kexec"),
CATEGORY_BOOTLOADER
)
kexec_setup.append(Task(
"Setup kexec",
setup_kexec
))
configuration_queue.append(kexec_setup)
# write anaconda related configs & kickstarts
write_configs = TaskQueue(
"Write configs and kickstarts",
_("Storing configuration files and kickstarts"),
CATEGORY_SYSTEM
)
# Write the kickstart file to the installed system (or, copy the input
# kickstart file over if one exists).
if conf.target.can_save_output_kickstart:
# write anaconda related configs & kickstarts
write_configs.append(Task("Store kickstarts", _writeKS_via_boss))
else:
# don't write the kickstart file to the installed system if this has
# been disabled by the nosave option
log.warning("Writing of the output kickstart to installed system has been disabled"
" by the nosave option.")
# only add write_configs to the main queue if we actually store some kickstarts/configs
if write_configs.task_count:
configuration_queue.append(write_configs)
post_scripts = TaskQueue(
"Post installation scripts",
_("Running post-installation scripts"),
CATEGORY_SYSTEM
)
scripts_proxy = RUNTIME.get_proxy(SCRIPTS)
# FWS: keep a handle on this task and learn how many steps it declares
# (one per installation phase), so the progress bar can track them.
scripts_task_proxy = RUNTIME.get_proxy(
scripts_proxy.RunScriptsWithTask(KS_SCRIPT_POST)
)
try:
self._fws_scripts_steps = max(1, int(scripts_task_proxy.Steps))
except DBusError:
# Progress is cosmetic: never fail the installation over it.
log.warning("FWS: cannot read the post-script steps, using one step")
self._fws_scripts_steps = 1
self._fws_scripts_task = DBusTask(scripts_task_proxy)
post_scripts.append(self._fws_scripts_task)
configuration_queue.append(post_scripts)
configuration_queue.append(Task(
"Copy installation logs",
CopyLogsTask(conf.target.system_root).run
))
configuration_queue.append(Task(
"Set file contexts",
SetContextsTask(conf.target.system_root).run
))
return configuration_queue
def _prepare_installation(self):
"""Prepare the installation task queue.
This method builds and returns a queue of tasks that perform the system installation.
The queue includes tasks for setting up the environment, configuring storage,
installing the software payload, running installation scripts, setting up the
bootloader, and executing post-installation steps.
"""
payloads_proxy = PAYLOADS.get_proxy()
payload_path = payloads_proxy.ActivePayload
if not payload_path:
log.error("No active payload found! Can't continue install.")
raise RuntimeError("No active payload")
payload_proxy = PAYLOADS.get_proxy(payload_path)
installation_queue = TaskQueue("Installation queue")
# connect progress reporting
installation_queue.queue_started.connect(self._queue_started_cb)
installation_queue.task_completed.connect(self._task_completed_cb)
# setup the installation environment
setup_environment = TaskQueue(
"Installation environment setup",
_("Setting up the installation environment"),
CATEGORY_ENVIRONMENT
)
tasks_list = self._install_manager.collect_configure_runtime_tasks()
for task_proxy in tasks_list:
setup_environment.append(DBusTask(task_proxy))
# Add configuration tasks for the Localization DBus module.
if is_module_available(LOCALIZATION):
localization_proxy = LOCALIZATION.get_proxy()
# Populate the missing keyboard values before the payload installation,
# so the module requirements can be generated for the right configuration.
# FIXME: Make sure that the module always returns right values.
populate_task = localization_proxy.PopulateMissingKeyboardConfigurationWithTask()
setup_environment.append_dbus_tasks(LOCALIZATION, [populate_task])
installation_queue.append(setup_environment)
# Do partitioning.
# Depending on current payload the storage might be apparently configured
# either before or after package/payload installation.
# So let's have two task queues - early storage & late storage.
storage_proxy = STORAGE.get_proxy()
early_storage = TaskQueue(
"Early storage configuration",
_("Configuring storage"),
CATEGORY_STORAGE
)
early_storage.append_dbus_tasks(STORAGE, storage_proxy.InstallWithTasks())
if payload_proxy.Type == PAYLOAD_TYPE_DNF:
conf_task = storage_proxy.WriteConfigurationWithTask()
early_storage.append_dbus_tasks(STORAGE, [conf_task])
installation_queue.append(early_storage)
# Run %pre-install scripts with the filesystem mounted and no packages
pre_install_scripts = TaskQueue(
"Pre-install scripts",
_("Running pre-installation scripts"),
CATEGORY_ENVIRONMENT
)
scripts_proxy = RUNTIME.get_proxy(SCRIPTS)
pre_install_scripts.append_dbus_tasks(RUNTIME, [
scripts_proxy.RunScriptsWithTask(KS_SCRIPT_PREINSTALL)
])
installation_queue.append(pre_install_scripts)
# Do various pre-installation tasks
# - try to discover a realm (if any)
# - check for possibly needed additional packages.
pre_install = TaskQueue(
"Pre install tasks",
_("Running pre-installation tasks"),
CATEGORY_SOFTWARE
)
# Make name resolution work for rpm scripts in chroot.
# Also make sure dns resolution works in %post scripts
# when systemd-resolved is not available.
if conf.system.provides_resolver_config and \
not is_service_installed("systemd-resolved.service"):
pre_install.append(Task(
"Copy resolv.conf to sysroot",
network.copy_resolv_conf_to_root,
(conf.target.system_root, )
))
if is_module_available(SECURITY):
security_proxy = SECURITY.get_proxy()
# Discover a realm.
pre_install.append_dbus_tasks(SECURITY, [
security_proxy.DiscoverRealmWithTask()
])
# Set up FIPS for the payload installation.
fips_task = security_proxy.PreconfigureFIPSWithTask(payload_proxy.Type)
pre_install.append_dbus_tasks(SECURITY, [fips_task])
# Import certificates so they are available for rpm scripts
certificates_proxy = SECURITY.get_proxy(CERTIFICATES)
certificates_task = certificates_proxy.PreInstallWithTask(payload_proxy.Type)
pre_install.append_dbus_tasks(SECURITY, [certificates_task])
installation_queue.append(pre_install)
payload_install = TaskQueue(
"Payload installation",
_("Installing the software"),
CATEGORY_SOFTWARE
)
tasks = payloads_proxy.InstallWithTasks()
payload_install.append_dbus_tasks(PAYLOADS, tasks)
installation_queue.append(payload_install)
# for some payloads storage is configured after the payload is installed
if payload_proxy.Type != PAYLOAD_TYPE_DNF:
late_storage = TaskQueue(
"Late storage configuration",
_("Configuring storage"),
CATEGORY_STORAGE,
)
conf_task = storage_proxy.WriteConfigurationWithTask()
late_storage.append_dbus_tasks(STORAGE, [conf_task])
installation_queue.append(late_storage)
# Do bootloader.
bootloader_proxy = STORAGE.get_proxy(BOOTLOADER)
bootloader_install = TaskQueue(
"Bootloader installation",
_("Installing boot loader"),
CATEGORY_BOOTLOADER
)
def run_configure_bootloader():
task_proxies = self._install_manager.collect_configure_bootloader_tasks(payloads_proxy.GetKernelVersionList())
for proxy in task_proxies:
sync_run_task(proxy)
bootloader_install.append(Task(
"Configure bootloader",
run_configure_bootloader
))
def run_install_bootloader():
tasks = bootloader_proxy.InstallBootloaderWithTasks(
payload_proxy.Type,
payloads_proxy.GetKernelVersionList()
)
for task in tasks:
sync_run_task(STORAGE.get_proxy(task))
bootloader_install.append(Task(
"Install bootloader",
run_install_bootloader
))
installation_queue.append(bootloader_install)
post_install = TaskQueue(
"Post-installation setup tasks",
_("Performing post-installation setup tasks"),
CATEGORY_SYSTEM
)
tasks = payloads_proxy.PostInstallWithTasks()
post_install.append_dbus_tasks(PAYLOADS, tasks)
installation_queue.append(post_install)
# Create snapshot
snapshot_proxy = STORAGE.get_proxy(SNAPSHOT)
if snapshot_proxy.IsRequested(SNAPSHOT_WHEN_POST_INSTALL):
snapshot_creation = TaskQueue(
"Creating post installation snapshots",
_("Creating snapshots"),
CATEGORY_STORAGE
)
snapshot_task = snapshot_proxy.CreateWithTask(SNAPSHOT_WHEN_POST_INSTALL)
snapshot_creation.append_dbus_tasks(STORAGE, [snapshot_task])
installation_queue.append(snapshot_creation)
return installation_queue
def _run_installation(self):
"""Run the complete installation."""
from pyanaconda.errors import errorHandler
queue = TaskQueue("Complete installation queue")
queue.append(self._prepare_installation())
queue.append(self._prepare_configuration())
# notify progress tracking about the number of steps
# FWS: the post-install scripts task reports its own sub-steps, so it
# takes more than the single step counted for it by task_count.
self._total_steps = queue.task_count + max(0, self._fws_scripts_steps - 1)
# Set the progress reporting callback of the DBus tasks.
# FIXME: This is a temporary workaround.
for item in queue.nested_items:
if isinstance(item, DBusTask):
item._progress_cb = self._progress_report_cb
# log contents of the main task queue
log.info(queue.summary)
# log tasks and queues when they are started
# - note that we are using generators to add the counter
queue_counter = util.item_counter(queue.queue_count)
task_started_counter = util.item_counter(queue.task_count)
task_completed_counter = util.item_counter(queue.task_count)
queue.queue_started.connect(
lambda x: log.info("Queue started: %s (%s)", x.name, next(queue_counter))
)
queue.task_started.connect(
lambda x: log.info("Task started: %s (%s)", x.name, next(task_started_counter))
)
queue.task_completed.connect(
lambda x: log.debug("Task completed: %s (%s) (%1.1f s)", x.name,
next(task_completed_counter), x.elapsed_time)
)
# Boss has no UserInterface; during the installation queue, tasks may call
# errorHandler.cb() for non-fatal errors. Temporarily install a D-Bus proxy
# that forwards dialogs to the progress spoke in the UI process.
previous_ui = errorHandler.ui
errorHandler.ui = _RemoteErrorUI(self)
try:
queue.start()
finally:
errorHandler.ui = previous_ui
# done
self.report_progress(_("Complete!"), step_number=self.steps)
# this message is automatically detected by QE tools, do not change it lightly
log.info(
"All tasks in the installation queue are done. "
"Installation successfully finished."
)
@@ -0,0 +1,199 @@
#
# Copyright (C) 2024 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY expressed or implied, including the implied warranties of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details. You should have received a copy of the
# GNU General Public License along with this program; if not, write to the
# Free Software Foundation, Inc., 31 Milk Street #960789 Boston, MA
# 02196 USA. Any Red Hat trademarks that are incorporated in the
# source code or documentation are not subject to the GNU General Public
# License and may only be used or replicated with the express permission of
# Red Hat, Inc.
#
# FWS: this file is an overlay of the upstream Anaconda module. Upstream runs
# every kickstart script of a type in one task without reporting anything, so
# the GUI could only say "Running post-installation scripts" and the progress
# bar sat still until the whole %post was done. FWS scripts publish their own
# progress (helper: /usr/local/bin/fws-install-step), so the task below turns
# that into one step per installation phase and a message that says which
# script is running and what it is doing.
#
import os
import re
import threading
from pykickstart.constants import KS_SCRIPT_POST
from pyanaconda.anaconda_loggers import get_module_logger
from pyanaconda.core.configuration.anaconda import conf
from pyanaconda.modules.common.errors.runtime import ScriptError
from pyanaconda.modules.common.task import Task
log = get_module_logger(__name__)
# Progress file written by fws-install-step, relative to a root. The %post
# running in the chroot writes it into the target, the --nochroot ones into
# the live system; both are read so any script can publish progress.
FWS_PROGRESS_FILE = "var/log/fws-install-progress"
FWS_PROGRESS_POLL = 0.5
# Title of a script, declared as its first comment:
# # FWS-TITLE: Configuration du système installé
FWS_TITLE_PATTERN = re.compile(r"^#\s*FWS-TITLE:\s*(.+?)\s*$", re.MULTILINE)
class _ProgressWatcher(threading.Thread):
"""Follow the progress published by the running kickstart script.
The scripts cannot talk to the installer directly: they are plain shell
processes, possibly inside a chroot. They write "<percent>|<label>" to a
file instead and this thread reports every change to the task, which
forwards it to the GUI label and progress bar.
"""
def __init__(self, task):
super().__init__(daemon=True, name="fws-install-progress")
self._task = task
self._stop_event = threading.Event()
# Start from what the previous script already published: otherwise the
# new script would immediately re-report the last phase of the old one.
self._last_report = task.last_phase
def stop(self):
self._stop_event.set()
def _read_report(self):
"""Return the newest (percent, label) published, or None."""
newest = None
for path in self._task.progress_files:
try:
mtime = os.path.getmtime(path)
except OSError:
continue
# Strictly newer: on a tie the first candidate (the target) wins,
# and the list order keeps us from flapping between two files.
if newest is None or mtime > newest[0]:
newest = (mtime, path)
if newest is None:
return None
try:
with open(newest[1], encoding="utf-8", errors="replace") as handle:
line = handle.readline().strip()
except OSError:
return None
percent, separator, label = line.partition("|")
if not separator or not percent.isdigit() or not label:
return None
return min(100, int(percent)), label
def run(self):
while not self._stop_event.is_set():
report = self._read_report()
if report and report != self._last_report:
self._last_report = report
self._task.report_phase(*report)
self._stop_event.wait(FWS_PROGRESS_POLL)
class RunScriptsTask(Task):
"""Task for running scripts."""
# The scripts report percentages; the bar gets this many steps so it moves
# every 5 % instead of once at the end. The installer reserves the same
# number of steps for this task (see pyanaconda/modules/boss/installation.py).
FWS_STEPS = 20
def __init__(self, script_type, scripts):
"""Create a new task.
:param script_type: type of scripts to be run
:type script_type: int
:param scripts: list of scripts
:type scripts: list(Script)
"""
super().__init__()
self._script_type = script_type
self._scripts = scripts
self._current_script = (0, 1, "")
self.last_phase = None
@property
def name(self):
return "Run scripts"
@property
def steps(self):
count = len([s for s in self._scripts if s.type == self._script_type])
return self.FWS_STEPS if count else 1
@property
def progress_files(self):
"""Where the scripts may publish their progress."""
target = str(conf.target.system_root)
return [os.path.join(target, FWS_PROGRESS_FILE), "/" + FWS_PROGRESS_FILE]
def report_phase(self, percent, label):
"""Report one installation phase to the GUI.
:param percent: progress of the whole script sequence, 0-100
:param label: what is being done, in the installer language
"""
index, total, title = self._current_script
message = "%s — %s %%" % (label, percent)
if total > 1:
message = "Script %d/%d · %s" % (index, total, message)
elif title:
message = "%s · %s" % (title, message)
step = min(self.steps, int(percent * self.steps / 100))
log.debug("FWS install progress: %s (step %s/%s)", message, step, self.steps)
self.last_phase = (percent, label)
self.report_progress(message, step_number=step)
@staticmethod
def _title(script, index):
"""Title of a script: its "# FWS-TITLE:" line, else a generic one."""
match = FWS_TITLE_PATTERN.search(getattr(script, "script", "") or "")
if match:
return match.group(1)
return "Script %d" % index
def run(self):
"""Execute the task."""
scripts = [s for s in self._scripts if s.type == self._script_type]
total = max(1, len(scripts))
for index, script in enumerate(scripts, start=1):
self._current_script = (index, total, self._title(script, index))
# Only the message changes here: the bar is moved by the
# percentages published by the script itself, so it never runs
# ahead of what has actually been done.
self.report_progress(
"Script %d/%d · %s" % (index, total, self._current_script[2])
)
watcher = _ProgressWatcher(self)
watcher.start()
try:
if script.type == KS_SCRIPT_POST:
result = script.run(conf.target.system_root)
else:
result = script.run("/")
finally:
watcher.stop()
watcher.join()
if result:
lineno, err = result
error_message = f"{lineno}\n\n{err.strip()}"
raise ScriptError(error_message)
@@ -0,0 +1,254 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- FWS — écran « Connexion Internet » (cf. fws_network.py).
Squelette calqué sur fws_recap.glade (AnacondaStandaloneWindow + boutons
Continuer/Quitter fournis automatiquement par le widget). -->
<interface>
<requires lib="gtk+" version="3.0"/>
<requires lib="AnacondaWidgets" version="3.0"/>
<object class="AnacondaStandaloneWindow" id="fwsNetworkWindow">
<property name="can_focus">False</property>
<property name="window_name" translatable="yes">CONNEXION INTERNET</property>
<child internal-child="main_box">
<object class="GtkBox" id="AnacondaStandaloneWindow-main_box1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child internal-child="nav_box">
<object class="GtkEventBox" id="AnacondaStandaloneWindow-nav_box1">
<property name="can_focus">False</property>
<child internal-child="nav_area">
<object class="GtkGrid" id="AnacondaStandaloneWindow-nav_area1">
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child internal-child="alignment">
<object class="GtkAlignment" id="AnacondaStandaloneWindow-alignment1">
<property name="can_focus">False</property>
<property name="yalign">0</property>
<property name="left_padding">12</property>
<property name="right_padding">6</property>
<child internal-child="action_area">
<object class="GtkBox" id="fwsNetworkWindow-actionArea">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="netContent">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<property name="margin_top">8</property>
<property name="margin_bottom">8</property>
<child>
<object class="GtkLabel" id="netTitle">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Connexion à Internet</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="netHint">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Choisissez votre réseau Wi-Fi dans la liste, ou branchez un câble Ethernet. (Vous pourrez continuer sans réseau si besoin.)</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="listHeader">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="listTitle">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Réseaux détectés :</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="refreshButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Rafraîchir</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="netScroll">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="vexpand">True</property>
<property name="shadow_type">in</property>
<property name="min-content-height">120</property>
<child>
<object class="GtkListBox" id="netList">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="selection_mode">browse</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="netFeedback">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes"></property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkBox" id="pwPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="pwTitle">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Mot de passe du réseau Wi-Fi :</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="pwEntryRow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkEntry" id="pwEntry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="visibility">False</property>
<property name="activates_default">True</property>
<property name="placeholder_text" translatable="yes">Mot de passe</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="pwShow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Afficher</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="pwConnect">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Se connecter</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
+4 -1
View File
@@ -104,7 +104,10 @@ virtualbox-guest-utils-nox
open-vm-tools open-vm-tools
# --- FWS (fws-local) --- # --- FWS (fws-local) ---
winboat-bin # Gestionnaire de paquets graphique PacManager (Qt6). Installé dans un
# répertoire dédié /opt/fws-pacmanage : son self-update réécrit CE dossier
# (binaire + fichier version + plugins) sans toucher à /usr.
fws-pacmanage
# Gestionnaire D&D 5e (dés, personnages, grimoire, sessions, combat). # Gestionnaire D&D 5e (dés, personnages, grimoire, sessions, combat).
fws-dnd fws-dnd
+3
View File
@@ -29,6 +29,7 @@ file_permissions=(
["/usr/bin/load_policy"]="0:0:755" ["/usr/bin/load_policy"]="0:0:755"
["/usr/bin/setstatus"]="0:0:755" ["/usr/bin/setstatus"]="0:0:755"
["/usr/local/bin/fws-setup-hardware"]="0:0:755" ["/usr/local/bin/fws-setup-hardware"]="0:0:755"
["/usr/local/bin/fws-grub-finalize"]="0:0:755"
["/usr/local/bin/fws-keys"]="0:0:755" ["/usr/local/bin/fws-keys"]="0:0:755"
["/usr/local/bin/fws-vr-setup"]="0:0:755" ["/usr/local/bin/fws-vr-setup"]="0:0:755"
["/usr/local/bin/fws-hello"]="0:0:755" ["/usr/local/bin/fws-hello"]="0:0:755"
@@ -40,5 +41,7 @@ file_permissions=(
["/usr/local/bin/fws-recovery-gui"]="0:0:755" ["/usr/local/bin/fws-recovery-gui"]="0:0:755"
["/usr/local/bin/fws-powermenu"]="0:0:755" ["/usr/local/bin/fws-powermenu"]="0:0:755"
["/usr/local/bin/fws-about"]="0:0:755" ["/usr/local/bin/fws-about"]="0:0:755"
["/usr/local/bin/fws-wallpaper"]="0:0:755"
["/usr/local/bin/fws-install-step"]="0:0:755"
["/etc/grub.d/42_fws-recovery"]="0:0:755" ["/etc/grub.d/42_fws-recovery"]="0:0:755"
) )
+12
View File
@@ -0,0 +1,12 @@
# FWS — configuration GRUB du système installé.
# Cet overlay écrase le /etc/default/grub par défaut du paquet « grub » dans le
# live (l'installé étant une copie du live, il en hérite).
#
# DIFFÉRENCE CLÉ vs Arch : os-prober est ACTIVÉ (défaut Arch = désactivé, donc
# Windows/autres OS n'apparaissaient JAMAIS au menu GRUB d'une install FWS en
# dual-boot). fws-grub-finalize et le %post du kickstart re-génèrent aussi le
# menu avec ce réglage après l'installation.
GRUB_DEFAULT=0
GRUB_TIMEOUT=8
GRUB_DISTRIBUTOR="FWS"
GRUB_DISABLE_OS_PROBER=false
@@ -0,0 +1,66 @@
// FWS — configuration fastfetch SYSTÈME (/etc/fastfetch/config.jsonc).
//
// Posée ici pour que le logo FWS apparaisse quel que soit le lancement :
// shell de login (cf. etc/profile.d/fastfetch.sh), terminal d'un bureau,
// TTY, root ou utilisateur, live ou système installé — fastfetch lit ce
// fichier en dernier recours, pour tout compte sans config personnelle
// (~/.config/fastfetch/config.jsonc d'un utilisateur reste prioritaire).
//
// Le logo est un fichier texte avec des marqueurs $1..$6 (4 carrés FWS + le
// « W »), coloriés par « logo.color ». Chemin ABSOLU : le rendu ne dépend donc
// pas du répertoire courant.
//
// « modules » reprend la structure par DÉFAUT de fastfetch : dès qu'un fichier
// de config existe, fastfetch n'affiche plus sa liste par défaut (on n'obtenait
// que le logo, sans aucune information). Les modules indisponibles sur la
// machine (batterie d'un fixe, DE absent…) se masquent d'eux-mêmes.
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "file",
"source": "/usr/local/share/fws/logo.txt",
"padding": {
"top": 1,
"left": 2
},
"color": {
"1": "#1ea064",
"2": "#2d7dd2",
"3": "#f0b428",
"4": "#195591",
"5": "#1c1c22",
"6": "#f5a523"
}
},
"modules": [
"title",
"separator",
"os",
"host",
"kernel",
"uptime",
"packages",
"shell",
"display",
"de",
"wm",
"wmtheme",
"theme",
"icons",
"font",
"cursor",
"terminal",
"terminalfont",
"cpu",
"gpu",
"memory",
"swap",
"disk",
"localip",
"battery",
"poweradapter",
"locale",
"break",
"colors"
]
}
@@ -0,0 +1,48 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<!-- FWS — emoji par défaut (Noto Color Emoji, paquet noto-fonts-emoji).
Sans cette configuration, l'emoji ne s'affiche que dans les applications
qui font elles-mêmes du fallback glyphe par glyphe (Pango le fait, un
renderer simple non), et une règle « no bitmap » (70-no-bitmaps.conf)
suffirait à tout désactiver : Noto Color Emoji est une police bitmap
(CBDT), pas une police vectorielle.
1) famille « emoji » : c'est le nom que demandent Qt/GTK/Electron.
2) polices génériques : l'emoji est ajouté en DERNIER recours
(mode="append", binding="weak") pour ne JAMAIS prendre la place de la
police principale — un binding « strong » ferait basculer le texte
latin dans la police emoji.
3) embeddedbitmap forcé : les emoji restent affichés même si une règle
système désactive les polices bitmap.
Numéroté 99- pour s'appliquer APRÈS les alias génériques (60-latin.conf)
qu'il complète. -->
<fontconfig>
<alias binding="same">
<family>emoji</family>
<prefer><family>Noto Color Emoji</family></prefer>
</alias>
<match target="pattern">
<test qual="any" name="family"><string>sans-serif</string></test>
<edit name="family" mode="append" binding="weak"><string>Noto Color Emoji</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>serif</string></test>
<edit name="family" mode="append" binding="weak"><string>Noto Color Emoji</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>monospace</string></test>
<edit name="family" mode="append" binding="weak"><string>Noto Color Emoji</string></edit>
</match>
<match target="font">
<test qual="any" name="family"><string>Noto Color Emoji</string></test>
<edit name="embeddedbitmap" mode="assign" binding="strong"><bool>true</bool></edit>
</match>
</fontconfig>
@@ -5,14 +5,8 @@
# On utilise donc un autre nom. # On utilise donc un autre nom.
_fastfetch_rc=$? _fastfetch_rc=$?
if [ "${_fastfetch_rc}" -eq 0 ]; then if [ "${_fastfetch_rc}" -eq 0 ]; then
# Logo FWS maison (4 carrés + Tux) au lieu du logo Arch détecté par défaut. # Le logo FWS vient de la config SYSTÈME (/etc/fastfetch/config.jsonc) :
fastfetch \ # aucun flag ici, pour que le rendu soit identique quand fastfetch est
--logo-type file \ # lancé à la main (terminal d'un bureau, TTY, n'importe quel compte).
--logo /usr/local/share/fws/logo.txt \ fastfetch
--logo-color-1 '38;2;30;160;100' \
--logo-color-2 '38;2;45;125;210' \
--logo-color-3 '38;2;240;180;40' \
--logo-color-4 '38;2;25;85;145' \
--logo-color-5 '38;2;28;28;34' \
--logo-color-6 '38;2;245;165;35'
fi fi
@@ -0,0 +1,18 @@
[Unit]
Description=FWS - finalisation GRUB au premier demarrage (NVRAM + dual-boot)
# Filet de securite bare-metal : l'installation (%post) peut se terminer sans
# entree NVRAM (efivars inaccessible dans le chroot) ou sans Windows au menu
# (os-prober). Au 1er demarrage du systeme installe, fws-grub-finalize pose
# GRUB en --removable + entree NVRAM « FWS » + regenere le menu avec
# os-prober. Marqueur de succes -> le service ne se relance plus ensuite.
ConditionPathExists=!/var/lib/fws/grub-finalize-done
After=local-fs.target
Wants=systemd-udev-settle.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/fws-grub-finalize
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Name=Fond d'écran FWS
Comment=Applique le fond d'écran FWS au premier démarrage (le choix de l'utilisateur est conservé ensuite)
Exec=fws-wallpaper --autostart
Icon=preferences-desktop-wallpaper
Terminal=false
NoDisplay=true
Categories=System;
X-GNOME-Autostart-enabled=true
@@ -125,7 +125,7 @@ def _project_tab(osr):
feats.set_markup( feats.set_markup(
"<b>Inclus :</b> installateur graphique · plusieurs bureaux " "<b>Inclus :</b> installateur graphique · plusieurs bureaux "
"(GNOME, KDE, Hyprland, i3, XFCE) · Steam &amp; Proton-GE · " "(GNOME, KDE, Hyprland, i3, XFCE) · Steam &amp; Proton-GE · "
"réalité virtuelle (SteamVR) · winboat (applications Windows) · " "réalité virtuelle (SteamVR) · PacManager (paquets) · "
"pare-feu · réparation système intégrée.") "pare-feu · réparation système intégrée.")
feats.set_line_wrap(True) feats.set_line_wrap(True)
feats.set_max_width_chars(52) feats.set_max_width_chars(52)
@@ -0,0 +1,146 @@
#!/bin/bash
# ============================================================
# FWS — fws-grub-finalize : verrouille le bootloader au 1er démarrage.
#
# POURQUOI : sur du vrai matériel (bare-metal UEFI — cartes mères ASUS et
# autres), l'installation peut se terminer sans que GRUB soit inscrit dans la
# NVRAM, ou sans que Windows soit détecté (os-prober désactivé / partitions
# pas visibles pendant l'install). Résultats vus en conditions réelles :
# « le PC redémarre sur Windows », ou « GRUB s'ouvre mais le menu est vide ».
#
# Ce service tourne au premier démarrage du système installé (marqueur
# /var/lib/fws/grub-finalize-done posé seulement en cas de SUCCÈS, le service
# ne se relance donc pas ensuite). À ce moment-là, contrairement au chroot de
# l'installateur :
# - /sys/firmware/efi/efivars est accessible → l'entrée NVRAM « FWS »
# (efibootmgr) PEUT être créée/rafraîchie,
# - tous les disques sont présents → os-prober retrouve Windows (et tout
# autre OS) sur les autres disques/partitions,
# - le chemin de secours EFI/BOOT/BOOTX64.EFI (--removable) est (re)posé :
# les firmwares récalcitrants (ASUS…) bootent quand même dessus.
#
# Journal : /var/log/fws-grub-finalize.log
# ============================================================
set -u
LOG=/var/log/fws-grub-finalize.log
DONE=/var/lib/fws/grub-finalize-done
# Déjà finalisé → ne rien faire (le service a une ConditionPathExists=…, on se
# protège aussi d'un lancement manuel).
[ -e "$DONE" ] && exit 0
mkdir -p /var/lib/fws
exec >>"$LOG" 2>&1
echo "== fws-grub-finalize : $(date '+%F %T')"
# Laisse udev finir d'énumérer les disques (os-prober a besoin de tout voir).
udevadm settle --timeout=30 2>/dev/null || true
# os-prober doit être présent et ACTIF (par défaut sur Arch : désactivé → les
# autres OS n'apparaissent jamais au menu). Les paquets sont normalement dans
# l'image installée (os-prober + ntfs-3g listés dans packages.x86_64) ; on
# tente un install de secours sans bloquer si pas de réseau.
if command -v os-prober >/dev/null 2>&1; then
if grep -q '^GRUB_DISABLE_OS_PROBER=' /etc/default/grub 2>/dev/null; then
sed -i 's/^GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=false/' /etc/default/grub
else
echo 'GRUB_DISABLE_OS_PROBER=false' >> /etc/default/grub
fi
else
pacman -S --noconfirm --needed os-prober ntfs-3g >/dev/null 2>&1 || \
echo "[FWS] os-prober indisponible — Windows ne sera pas détecté au menu GRUB"
fi
# --- UEFI : installer GRUB sur une ESP ---------------------------------------
# Règle : on préfère une ESP PORTÉE PAR LE MÊME DISQUE que « / » (installation
# FWS typique : /boot/efi déjà dans le fstab). Si l'installation a réutilisé
# l'ESP d'un autre OS (cas dual-boot vu en réel : ESP Windows sur le 1er
# disque), on retombe sur la première ESP FAT32 trouvée.
OK=1
if [ -d /sys/firmware/efi ]; then
esp=""
if ! mountpoint -q /boot/efi; then
# /boot/efi pas monté (ou pas dans le fstab) : on cherche.
rootsrc="$(findmnt -no SOURCE / 2>/dev/null)"
rootdisk="$(lsblk -spno NAME,TYPE "$rootsrc" 2>/dev/null | awk '$2=="disk"{print $1; exit}')"
if [ -n "$rootdisk" ]; then
esp="$(lsblk -nro PATH,PARTTYPENAME,FSTYPE "$rootdisk" 2>/dev/null \
| awk '$2=="EFI System" && $3=="vfat" {print $1; exit}')"
fi
# Repli : première ESP du système (ex. ESP Windows réutilisée).
[ -n "$esp" ] || \
esp="$(lsblk -nro PATH,PARTTYPENAME,FSTYPE 2>/dev/null \
| awk '$2=="EFI System" && $3=="vfat" {print $1; exit}')"
if [ -n "$esp" ]; then
echo "[FWS] ESP : $esp → montage sur /boot/efi (ne pas démonter, reboot ensuite)"
mkdir -p /boot/efi
mount "$esp" /boot/efi 2>/dev/null || echo "[FWS] montage ESP impossible ($esp)"
else
echo "[FWS] aucune partition EFI trouvée sur ce système"
fi
fi
if mountpoint -q /boot/efi || [ -d /boot/efi/EFI ]; then
# (a) Entrée NVRAM « FWS » + fichiers EFI/FWS (best effort : grub-install
# crée lui-même l'entrée si efivars est accessible) :
grub-install --target=x86_64-efi --efi-directory=/boot/efi \
--bootloader-id=FWS --recheck || echo "[FWS] grub-install (NVRAM) : échec, ignoré"
# (b) Chemin de SECOURS EFI/BOOT/BOOTX64.EFI (--removable) : boote SANS
# aucune entrée NVRAM. INDISPENSABLE sur firmware qui « oublie »
# l'entrée (ASUS…) — c'est lui qui garantit le 1er boot.
if ! grub-install --target=x86_64-efi --efi-directory=/boot/efi \
--bootloader-id=FWS --removable --recheck; then
OK=0
fi
# Copie physique de secours si --removable n'a pas produit le fichier.
if [ ! -f /boot/efi/EFI/BOOT/BOOTX64.EFI ] \
&& [ -f /boot/efi/EFI/FWS/grubx64.efi ]; then
mkdir -p /boot/efi/EFI/BOOT
cp -f /boot/efi/EFI/FWS/grubx64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI \
&& echo "[FWS] BOOTX64.EFI copié depuis EFI/FWS" || OK=0
fi
# (c) Rafraîchir l'entrée NVRAM si elle manque (efibootmgr). GRUB booté
# a déjà créé « FWS » ; on ne duplique pas si l'entrée existe.
if command -v efibootmgr >/dev/null 2>&1 \
&& [ -d /sys/firmware/efi/efivars ]; then
espdev="$(findmnt -no SOURCE /boot/efi 2>/dev/null)"
if [ -n "$espdev" ]; then
disk="$(lsblk -spno NAME,TYPE "$espdev" | awk '$2=="disk"{print $1; exit}')"
part="$(printf '%s' "$espdev" | grep -oE '[0-9]+$')"
if ! efibootmgr 2>/dev/null | grep -qi 'FWS'; then
efibootmgr -c -d "${disk:-/dev/null}" -p "${part:-1}" \
-L "FWS" -l '\EFI\FWS\grubx64.efi' >/dev/null 2>&1 \
&& echo "[FWS] entrée NVRAM FWS créée" || \
echo "[FWS] NVRAM non modifiable — le chemin --removable suffit"
else
echo "[FWS] entrée NVRAM FWS déjà présente"
fi
fi
fi
else
echo "[FWS] aucune ESP montée sur /boot/efi — grub-install UEFI impossible ici"
OK=0
fi
else
# --- BIOS/CSM : GRUB dans le MBR du disque portant « / » ---------------
rootsrc="$(findmnt -no SOURCE / 2>/dev/null)"
disk="$(lsblk -spno NAME,TYPE "$rootsrc" 2>/dev/null \
| awk '$2=="disk"{print $1; exit}' | grep -oE '/dev/[a-z0-9]+')"
if [ -n "$disk" ]; then
grub-install --target=i386-pc --recheck "$disk" || OK=0
else
echo "[FWS] disque BIOS introuvable"
OK=0
fi
fi
# Régénère le menu COMPLET (FWS + recovery + Windows/autres OS via os-prober).
if grub-mkconfig -o /boot/grub/grub.cfg; then
if grep -q 'menuentry' /boot/grub/grub.cfg; then
touch "$DONE"
echo "[FWS] GRUB finalisé : entrées NVRAM + menu OK ($(date '+%T'))"
exit 0
fi
fi
echo "[FWS] grub.cfg absent/vide — nouvel essai au prochain démarrage"
exit 1
@@ -0,0 +1,33 @@
#!/bin/sh
# FWS — publie l'avancement de l'installation pour l'écran de progression
# d'Anaconda (pyanaconda/modules/runtime/scripts/runtime.py lit ce fichier et
# le transforme en « Script 2/3 · Installation du bureau — 62 % »).
#
# Usage : fws-install-step <pourcentage 0-100> "<ce qui est en cours>"
#
# Le fichier est toujours écrit dans le rootfs COURANT (/var/log/…) : dans le
# %post chrooté c'est le système installé (que l'installeur lit via
# /mnt/sysroot), dans les %post --nochroot c'est le live. Écriture atomique
# (fichier temporaire + mv) pour que l'installeur ne lise jamais une ligne à
# moitié écrite.
#
# Best-effort : le code retour est toujours 0 — un souci de progression ne doit
# jamais faire échouer l'installation (les %post sont en `set -x`, pas en
# `set -e`, mais autant ne pas tenter le diable).
set -u
FILE=/var/log/fws-install-progress
[ "$#" -ge 2 ] || exit 0
PERCENT="$1"
shift
case "$PERCENT" in
''|*[!0-9]*) exit 0 ;;
esac
[ "$PERCENT" -le 100 ] || PERCENT=100
mkdir -p "${FILE%/*}" 2>/dev/null || exit 0
if printf '%s|%s\n' "$PERCENT" "$*" > "$FILE.tmp" 2>/dev/null; then
mv -f "$FILE.tmp" "$FILE" 2>/dev/null || rm -f "$FILE.tmp" 2>/dev/null
fi
exit 0
@@ -8,24 +8,48 @@
# pas l'installation. # pas l'installation.
# #
# Installe : # Installe :
# - les drivers GPU détectés via lspci (Intel / AMD / NVIDIA) + Mesa/Vulkan, # - les drivers GPU détectés via lspci (Intel / AMD / NVIDIA) + Mesa/Vulkan :
# l'ICD Vulkan de CHAQUE GPU trouvé (portables hybrides compris), le loader,
# vulkaninfo et les variantes 32 bits (Steam/Proton) quand un bureau est choisi,
# - les outils invité selon l'hyperviseur (VMware/VirtualBox/QEMU/Hyper-V), # - les outils invité selon l'hyperviseur (VMware/VirtualBox/QEMU/Hyper-V),
# - le son/micro/casque (PipeWire), le Bluetooth (BlueZ), les conteneurs # - le son/micro/casque (PipeWire), le Bluetooth (BlueZ), les conteneurs
# (Podman), # (Podman), la police emoji par défaut (Noto Color Emoji, cf.
# etc/fonts/conf.d/99-fws-emoji.conf),
# - et — si un bureau est choisi — la stack « comme Windows » : Steam, Wine, # - et — si un bureau est choisi — la stack « comme Windows » : Steam, Wine,
# VR (Monado/OpenXR → SteamVR pour HTC Vive / Valve Index ; Oculus n'a pas # VR (Monado/OpenXR → SteamVR pour HTC Vive / Valve Index ; Oculus n'a pas
# de support Linux officiel), winboat-bin (apps Windows). # de support Linux officiel), et le gestionnaire de paquets PacManager.
# ============================================================================ # ============================================================================
DESK="${1:-cli}" DESK="${1:-cli}"
log() { echo "[FWS-hw] $*"; } log() { echo "[FWS-hw] $*"; }
# ── 1) Drivers GPU (détection lspci) ───────────────────────────────────────── # ── 1) Drivers GPU (détection lspci) ─────────────────────────────────────────
DRIVERS="mesa" # Un portable hybride expose DEUX contrôleurs (iGPU Intel/AMD + dGPU NVIDIA).
# Trois tests indépendants (et non un `case` exclusif) : sinon, sur un Optimus,
# le premier constructeur trouvé gagnait et l'autre GPU restait sans Vulkan.
# vulkan-icd-loader : le loader, sans lequel aucune appli Vulkan ne démarre.
# vulkan-tools : vulkaninfo, pour vérifier l'API réellement exposée.
# Sans constructeur reconnu (VM, GPU virtuel), Mesa fournit lavapipe : Vulkan
# fonctionne en logiciel au lieu d'être absent.
GPU="$(lspci 2>/dev/null | grep -iE 'VGA compatible controller|3D controller|Display controller')" GPU="$(lspci 2>/dev/null | grep -iE 'VGA compatible controller|3D controller|Display controller')"
DRIVERS="mesa vulkan-icd-loader vulkan-tools"
VULKAN32="" # ICD 32 bits : Steam/Proton (multilib, donc bureaux seulement)
case "$GPU" in case "$GPU" in
*NVIDIA*|*GeForce*) DRIVERS="$DRIVERS nvidia-dkms nvidia-utils linux-headers dkms" ;; *NVIDIA*|*GeForce*|*Quadro*|*RTX*|*Tesla*)
*AMD*|*ATI*|*Radeon*) DRIVERS="$DRIVERS vulkan-radeon libva-mesa-driver" ;; # libva-nvidia-driver : le pilote VA-API (décodage vidéo matériel) —
*Intel*) DRIVERS="$DRIVERS vulkan-intel intel-media-driver" ;; # nvidia-utils ne fournit que le VDPAU historique ; sans ce paquet,
# Firefox/Chrome et les lecteurs décodent en CPU et saccadent en 4K.
DRIVERS="$DRIVERS nvidia-dkms nvidia-utils libva-nvidia-driver linux-headers dkms"
VULKAN32="$VULKAN32 lib32-nvidia-utils" ;;
esac
case "$GPU" in
*AMD*|*ATI*|*Radeon*)
DRIVERS="$DRIVERS vulkan-radeon libva-mesa-driver"
VULKAN32="$VULKAN32 lib32-vulkan-radeon" ;;
esac
case "$GPU" in
*Intel*)
DRIVERS="$DRIVERS vulkan-intel intel-media-driver"
VULKAN32="$VULKAN32 lib32-vulkan-intel" ;;
esac esac
# ── 2) Outils invité selon l'hyperviseur ───────────────────────────────────── # ── 2) Outils invité selon l'hyperviseur ─────────────────────────────────────
@@ -41,7 +65,8 @@ esac
# brightnessctl : réglage de luminosité sans root (via logind) — consommé par # brightnessctl : réglage de luminosité sans root (via logind) — consommé par
# les touches XF86MonBrightness* et la molette du module backlight de waybar. # les touches XF86MonBrightness* et la molette du module backlight de waybar.
BASE="pipewire pipewire-alsa pipewire-pulse pipewire-jack wireplumber \ BASE="pipewire pipewire-alsa pipewire-pulse pipewire-jack wireplumber \
pavucontrol bluez bluez-utils brightnessctl podman" pavucontrol bluez bluez-utils brightnessctl podman \
noto-fonts-emoji"
# Gestionnaire Bluetooth graphique : KDE et GNOME ont le leur ; blueman pour # Gestionnaire Bluetooth graphique : KDE et GNOME ont le leur ; blueman pour
# les bureaux qui n'en fournissent pas (tray + assistant d'appairage). # les bureaux qui n'en fournissent pas (tray + assistant d'appairage).
case "$DESK" in case "$DESK" in
@@ -59,6 +84,11 @@ if [ "$DESK" != "cli" ]; then
lib32-mesa lib32-pipewire monado gamemode \ lib32-mesa lib32-pipewire monado gamemode \
mangohud lib32-mangohud \ mangohud lib32-mangohud \
noto-fonts ttf-liberation" noto-fonts ttf-liberation"
# Vulkan 32 bits : sans lui, les jeux Steam/Proton 32 bits n'ont AUCUN ICD
# (mesa seul ne suffit pas) — c'est le cas le plus fréquent de « le jeu
# plante » après une install FWS.
DESKTOP="$DESKTOP lib32-vulkan-icd-loader"
[ -n "$VULKAN32" ] && DESKTOP="$DESKTOP $VULKAN32"
fi fi
# ── Sync + filtre aux paquets RÉELLEMENT existants ─────────────────────────── # ── Sync + filtre aux paquets RÉELLEMENT existants ───────────────────────────
@@ -71,14 +101,40 @@ done
if [ -n "$VALID" ]; then if [ -n "$VALID" ]; then
log "installation :$VALID" log "installation :$VALID"
pacman -S --noconfirm --needed $VALID || log "certains paquets non installés" pacman -S --noconfirm --needed $VALID || log "certains paquets non installés"
# polices : le cache fontconfig doit inclure la police emoji qui vient
# d'être installée, sinon les applications déjà lancées ne la voient qu'au
# prochain démarrage de session.
command -v fc-cache >/dev/null 2>&1 && fc-cache -f >/dev/null 2>&1
fi fi
# NB : winboat-bin (AUR) n'est PAS installé ici (fws-local n'existe pas sur la # NB : fws-pacmanage n'est PAS installé ici (fws-local n'existe pas sur la
# cible) : il est intégré à l'image FWS via packages.x86_64 et recopié par le # cible) : il est intégré à l'image FWS via packages.x86_64 et recopié par le
# payload LiveOS d'Anaconda → déjà présent sur le système installé. # payload LiveOS d'Anaconda → déjà présent sur le système installé, dans
# /opt/fws-pacmanage (répertoire que son self-update réécrit).
# ── Services matériels ─────────────────────────────────────────────────────── # ── Services matériels ───────────────────────────────────────────────────────
[ -n "$VMSVC" ] && systemctl enable $VMSVC 2>/dev/null [ -n "$VMSVC" ] && systemctl enable $VMSVC 2>/dev/null
systemctl enable bluetooth.service 2>/dev/null systemctl enable bluetooth.service 2>/dev/null
systemctl enable podman.socket 2>/dev/null systemctl enable podman.socket 2>/dev/null
# ── Rapport Vulkan ───────────────────────────────────────────────────────────
# Un paquet installé ne prouve pas que Vulkan fonctionne : les ICD déclarés
# dans /usr/share/vulkan/icd.d sont la source de vérité (c'est ce que lisent
# Vulkan Loader et les jeux). Utile pour diagnostiquer un « il me manque Vulkan »
# après install.
ICD_DIR=/usr/share/vulkan/icd.d
if [ -d "$ICD_DIR" ]; then
ICDS="$(ls "$ICD_DIR" 2>/dev/null | sed -n 's/\.json$//p' | tr '\n' ' ')"
if [ -n "$ICDS" ]; then
log "Vulkan : pilotes (ICD) présents → $ICDS"
else
log "Vulkan : aucun ICD — rendu matériel absent (repli Mesa/lavapipe)"
fi
fi
# Dans le chroot du %post il n'y a pas de /dev/dri : vulkaninfo n'a de sens
# qu'une fois le système démarré (relance manuelle du script).
if [ -e /dev/dri ] && command -v vulkaninfo >/dev/null 2>&1; then
vulkaninfo --summary 2>/dev/null | sed -n 's/^[[:space:]]*deviceName *= *//p' |
while IFS= read -r _dev; do log " Vulkan → $_dev"; done
fi
exit 0 exit 0
+150
View File
@@ -0,0 +1,150 @@
#!/bin/sh
# FWS — fond d'écran par défaut, posé au PREMIER démarrage graphique.
#
# L'image est EMBARQUÉE dans l'ISO (/usr/local/share/fws/wallpaper.png) au lieu
# d'être téléchargée : aucun réseau requis au premier boot, même rendu sur
# toutes les installations, et rien à héberger.
#
# Lancement :
# - /etc/xdg/autostart/fws-wallpaper.desktop (KDE, GNOME, XFCE) → « une fois » ;
# - Hyprland/i3 (pas d'autostart XDG) : la config de session appelle
# « fws-wallpaper --session » à chaque session — ces bureaux n'ont pas de
# réglage de fond persistant hors de leur config
# (swaybg respawné / feh repose le pixmap racine).
#
# Marqueur ~/.config/fws/wallpaper-done (même dossier que fws-hello) : une fois
# le fond posé, ce script ne touche PLUS à rien — le choix fait ensuite par
# l'utilisateur est conservé.
# fws-wallpaper --force réapplique le fond FWS par-dessus le choix actuel.
#
# Code retour : 0 = fond posé (ou déjà posé), 1 = rien à faire (session non
# reconnue, outil absent, sans affichage) — l'échec est volontairement silencieux,
# on ne casse jamais un démarrage de session pour un fond d'écran.
set -u
[ -n "${HOME:-}" ] || exit 1
WALL=/usr/local/share/fws/wallpaper.png
STATE_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/fws"
FLAG="$STATE_DIR/wallpaper-done"
MODE=once # once = ignore si déjà posé ; session = repose à chaque
# session (Hyprland/i3) ; force = réapplique maintenant
for _arg in "$@"; do
case "$_arg" in
--session) MODE=session ;;
--force) MODE=force ;;
--autostart) ;; # entrée /etc/xdg/autostart : comportement par défaut
-h|--help) awk 'NR > 1 { if ($0 !~ /^#/) exit; sub(/^# ?/, ""); print }' "$0"; exit 0 ;;
*) echo "Usage : fws-wallpaper [--force|--session]" >&2; exit 1 ;;
esac
done
[ -r "$WALL" ] || exit 1
# Pas de session graphique joignable (console, script lancé par un service) : rien à faire.
if [ -z "${DISPLAY:-}" ] && [ -z "${WAYLAND_DISPLAY:-}" ]; then
exit 1
fi
[ "$MODE" = "once" ] && [ -e "$FLAG" ] && exit 0
# --- Détection du bureau ----------------------------------------------------
# HYPRLAND_INSTANCE_SIGNATURE / I3SOCK sont les signatures FIABLES exportées aux
# processus de session (XDG_CURRENT_DESKTOP n'est pas garanti pour i3).
_lower() { printf '%s' "$1" | tr '[:upper:]' '[:lower:]'; }
DE=""
if [ -n "${HYPRLAND_INSTANCE_SIGNATURE:-}" ]; then
DE=hyprland
elif [ -n "${I3SOCK:-}" ]; then
DE=i3
else
case "$(_lower "${XDG_CURRENT_DESKTOP:-}")" in
*kde*|*plasma*) DE=kde ;;
*xfce*) DE=xfce ;;
*gnome*|*unity*) DE=gnome ;;
*i3*) DE=i3 ;;
esac
fi
[ -n "$DE" ] || exit 1
# --- KDE --------------------------------------------------------------------
# plasma-apply-wallpaperimage passe par plasmashell (DBus) : au tout premier
# login plasmashell peut ne pas être prêt → on réessaie ~20 s avant d'abandonner
# (sans marqueur, le prochain démarrage retentera).
_apply_kde() {
command -v plasma-apply-wallpaperimage >/dev/null 2>&1 || return 1
_i=0
while [ "$_i" -lt 10 ]; do
plasma-apply-wallpaperimage "$WALL" >/dev/null 2>&1 && return 0
_i=$((_i + 1))
sleep 2
done
return 1
}
# --- GNOME ------------------------------------------------------------------
_apply_gnome() {
command -v gsettings >/dev/null 2>&1 || return 1
gsettings set org.gnome.desktop.background picture-uri "file://$WALL" || return 1
# Thème sombre (GNOME ≥ 42) : GNOME lit picture-uri-dark dans ce cas.
gsettings set org.gnome.desktop.background picture-uri-dark "file://$WALL" 2>/dev/null || true
return 0
}
# --- XFCE ------------------------------------------------------------------
# xfce4-desktop stocke une propriété « last-image » par moniteur × espace de
# travail ; on remplit celles qui existent et, au tout premier login (propriétés
# pas encore créées), on les crée pour chaque sortie de xrandr (xfconf nomme les
# moniteurs par connecteur depuis XFCE 4.16 : monitorHDMI-1, monitoreDP-1…).
_apply_xfce() {
command -v xfconf-query >/dev/null 2>&1 || return 1
_done=0
for _p in $(xfconf-query -c xfce4-desktop -l 2>/dev/null | grep 'last-image$'); do
if xfconf-query -c xfce4-desktop -p "$_p" -s "$WALL" >/dev/null 2>&1; then
_done=1
# 5 = « zoom » (remplit l'écran sans déformer l'image).
xfconf-query -c xfce4-desktop -p "${_p%last-image}image-style" \
-n -t int -s 5 >/dev/null 2>&1 || true
fi
done
if [ "$_done" -eq 0 ] && command -v xrandr >/dev/null 2>&1; then
for _out in $(xrandr --listmonitors 2>/dev/null | awk 'NR>1 {print $4}' | sed 's#.*/##'); do
_base="/backdrop/screen0/monitor${_out}/workspace0"
xfconf-query -c xfce4-desktop -p "$_base/last-image" \
-n -t string -s "$WALL" >/dev/null 2>&1 && _done=1
xfconf-query -c xfce4-desktop -p "$_base/image-style" \
-n -t int -s 5 >/dev/null 2>&1 || true
done
fi
[ "$_done" -eq 1 ]
}
# --- Hyprland ---------------------------------------------------------------
# swaybg (layer-shell) affiche le fond ; setsid le détache du script, qui se
# termine tout de suite (sinon Hyprland attendrait un exec-once zombie).
_apply_hyprland() {
command -v swaybg >/dev/null 2>&1 || return 1
pkill -x swaybg >/dev/null 2>&1 || true
setsid swaybg -i "$WALL" -m fill >/dev/null 2>&1 &
return 0
}
# --- i3 --------------------------------------------------------------------
_apply_i3() {
command -v feh >/dev/null 2>&1 || return 1
feh --bg-fill "$WALL" >/dev/null 2>&1
}
case "$DE" in
kde) _apply_kde ;;
gnome) _apply_gnome ;;
xfce) _apply_xfce ;;
hyprland) _apply_hyprland ;;
i3) _apply_i3 ;;
*) exit 1 ;;
esac || exit 1
# Marqueur seulement hors « --session » : sur Hyprland/i3 le fond est reposé à
# chaque session par la config, le marqueur n'aurait aucun sens.
if [ "$MODE" != "session" ]; then
mkdir -p "$STATE_DIR" 2>/dev/null && : > "$FLAG" 2>/dev/null || true
fi
exit 0
@@ -65,6 +65,10 @@ misc {
# Démarrage de session : barre d'état, notifications, réseau dans le tray, # Démarrage de session : barre d'état, notifications, réseau dans le tray,
# agent d'authentification GUI (indispensable pour les apps qui demandent # agent d'authentification GUI (indispensable pour les apps qui demandent
# les droits admin : gestionnaire de disques, blueman…). # les droits admin : gestionnaire de disques, blueman…).
# Fond d'écran FWS : image EMBARQUÉE dans l'ISO (aucun réseau requis) — swaybg
# la repose à chaque session, Hyprland n'ayant pas de réglage de fond persistant
# hors config. « background_color » ci-dessus reste le repli si swaybg manque.
exec-once = fws-wallpaper --session
exec-once = waybar exec-once = waybar
exec-once = mako exec-once = mako
exec-once = nm-applet exec-once = nm-applet
@@ -152,6 +152,9 @@ exec_always --no-startup-id sh -c 'pkill -x polybar; sleep 0.3; exec polybar -q
# rate le repaint des fenêtres GTK → contenus noirs/artefacts. Les coins # rate le repaint des fenêtres GTK → contenus noirs/artefacts. Les coins
# arrondis sont sacrifiés en VM ; sur matériel réel picom se lance normalement. # arrondis sont sacrifiés en VM ; sur matériel réel picom se lance normalement.
exec --no-startup-id sh -c 'systemd-detect-virt --quiet || exec picom --config ~/.config/picom.conf' exec --no-startup-id sh -c 'systemd-detect-virt --quiet || exec picom --config ~/.config/picom.conf'
# Fond d'écran FWS : image EMBARQUÉE dans l'ISO (aucun réseau requis) — feh
# repose le pixmap racine à chaque session (i3 n'a pas de fond persistant).
exec --no-startup-id fws-wallpaper --session
exec --no-startup-id dunst exec --no-startup-id dunst
exec --no-startup-id nm-applet exec --no-startup-id nm-applet
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
@@ -3,7 +3,7 @@ PRETTY_NAME="FWS Linux"
ID=fws ID=fws
ID_LIKE=arch ID_LIKE=arch
BUILD_ID=rolling BUILD_ID=rolling
VERSION_ID="0.6.0" VERSION_ID="0.7.0"
ANSI_COLOR="38;2;23;147;209" ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://github.com/You-re-like-Windows-a-bitch/fws" HOME_URL="https://github.com/You-re-like-Windows-a-bitch/fws"
SUPPORT_URL="https://github.com/You-re-like-Windows-a-bitch/fws/issues" SUPPORT_URL="https://github.com/You-re-like-Windows-a-bitch/fws/issues"
@@ -35,6 +35,8 @@ line-size = 0
font-0 = Noto Sans:size=10;2 font-0 = Noto Sans:size=10;2
font-1 = Symbols Nerd Font:size=12;3 font-1 = Symbols Nerd Font:size=12;3
font-2 = Noto Sans:weight=bold:size=10;2 font-2 = Noto Sans:weight=bold:size=10;2
; dernier recours = emoji (police par défaut, etc/fonts/conf.d/99-fws-emoji.conf)
font-3 = Noto Color Emoji:size=10;2
modules-left = i3 xwindow modules-left = i3 xwindow
modules-center = date modules-center = date
modules-right = updates keyhelp backlight pulseaudio network cpu memory tray power modules-right = updates keyhelp backlight pulseaudio network cpu memory tray power
Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

@@ -3,7 +3,9 @@
(paquet ttf-nerd-fonts-symbols, installé avec le bureau Hyprland). */ (paquet ttf-nerd-fonts-symbols, installé avec le bureau Hyprland). */
* { * {
font-family: "Noto Sans", "Symbols Nerd Font", sans-serif; /* Noto Color Emoji : dernier recours, pour les emoji des titres/notifications
(police par défaut, cf. etc/fonts/conf.d/99-fws-emoji.conf). */
font-family: "Noto Sans", "Symbols Nerd Font", "Noto Color Emoji", sans-serif;
font-size: 13px; font-size: 13px;
min-height: 0; min-height: 0;
} }
@@ -6,7 +6,7 @@ window {
background-color: rgba(30, 30, 46, 0.97); background-color: rgba(30, 30, 46, 0.97);
border: 2px solid #89b4fa; border: 2px solid #89b4fa;
border-radius: 14px; border-radius: 14px;
font-family: "Noto Sans Mono", monospace; font-family: "Noto Sans Mono", "Noto Color Emoji", monospace;
font-size: 13px; font-size: 13px;
} }
@@ -17,7 +17,7 @@ window {
border-radius: 10px; border-radius: 10px;
margin: 12px; margin: 12px;
padding: 8px 12px; padding: 8px 12px;
font-family: "Noto Sans", sans-serif; font-family: "Noto Sans", "Noto Color Emoji", sans-serif;
} }
#input image { color: #89b4fa; } #input image { color: #89b4fa; }
@@ -4,7 +4,7 @@ window {
background-color: rgba(30, 30, 46, 0.96); /* base #1e1e2e */ background-color: rgba(30, 30, 46, 0.96); /* base #1e1e2e */
border: 2px solid #89b4fa; border: 2px solid #89b4fa;
border-radius: 14px; border-radius: 14px;
font-family: "Noto Sans", sans-serif; font-family: "Noto Sans", "Noto Color Emoji", sans-serif;
font-size: 14px; font-size: 14px;
} }
@@ -94,6 +94,9 @@ bootloader --disabled
# pacman, choix de bureau écrit par l'addon de sélection). # pacman, choix de bureau écrit par l'addon de sélection).
# ============================================================================ # ============================================================================
%post --nochroot --log=/tmp/fws-post-nochroot.log %post --nochroot --log=/tmp/fws-post-nochroot.log
# FWS-TITLE: Préparation de l'installation (live)
# Écran de progression : chaque phase publie son avancement (fws-install-step),
# l'installeur affiche le script en cours, ce qu'il fait et un pourcentage.
set -x set -x
# Selon la version d'Anaconda la cible est sous /mnt/sysroot (récent) ou # Selon la version d'Anaconda la cible est sous /mnt/sysroot (récent) ou
@@ -136,6 +139,23 @@ if [ -n "$SRC_KERN" ]; then
else else
echo "[FWS] AVERTISSEMENT : noyau vmlinuz-linux introuvable sur le média" echo "[FWS] AVERTISSEMENT : noyau vmlinuz-linux introuvable sur le média"
fi fi
# --- Wi-Fi choisi sur l'écran « Connexion Internet » → système installé -----
# La connexion est faite par NetworkManager sur le LIVE (spoke fws_network) :
# son profil vit dans /etc/NetworkManager/system-connections du live — un
# overlay TEMPORAIRE que le payload LiveOS (copie du squashfs) ne recopie PAS.
# Si l'utilisateur s'est connecté à un Wi-Fi (marqueur /tmp/fws-keep-wifi posé
# par le spoke), on copie donc les profils NM du live vers la cible : le Wi-Fi
# fonctionnera au 1er démarrage du système installé SANS ressaisie du mot de
# passe (et le %post chrooté, qui tourne sur la pile réseau du live, a déjà pu
# installer le bureau).
if [ -f /tmp/fws-keep-wifi ]; then
install -d -m 700 "$SYSROOT/etc/NetworkManager/system-connections"
cp -a /etc/NetworkManager/system-connections/. \
"$SYSROOT/etc/NetworkManager/system-connections/" 2>/dev/null || true
fi
fws-install-step 6 "Système de base préparé — configuration"
%end %end
@@ -145,7 +165,9 @@ fi
# Log persistant : /var/log/fws-post.log sur le système installé. # Log persistant : /var/log/fws-post.log sur le système installé.
# ============================================================================ # ============================================================================
%post --log=/var/log/fws-post.log %post --log=/var/log/fws-post.log
# FWS-TITLE: Configuration du système installé
set -x set -x
fws-install-step 8 "Nettoyage des résidus du live"
# --- 1) Purge des résidus « live » (modèle Sabayon = live copié tel quel) ---- # --- 1) Purge des résidus « live » (modèle Sabayon = live copié tel quel) ----
# Ce qui est propre au live casserait ou pollue le système installé. # Ce qui est propre au live casserait ou pollue le système installé.
@@ -164,6 +186,8 @@ if pacman -Q mkinitcpio-archiso &>/dev/null; then
pacman -Rns --noconfirm mkinitcpio-archiso || true pacman -Rns --noconfirm mkinitcpio-archiso || true
fi fi
fws-install-step 14 "Construction de l'initramfs"
# --- 2) initramfs propre (preset Arch standard, sans archiso) ---------------- # --- 2) initramfs propre (preset Arch standard, sans archiso) ----------------
# Le live fournit un preset 'archiso' (/etc/mkinitcpio.d/linux.preset qui pointe # Le live fournit un preset 'archiso' (/etc/mkinitcpio.d/linux.preset qui pointe
# vers conf.d/archiso.conf + hooks archiso) → inadapté à un disque normal. On # vers conf.d/archiso.conf + hooks archiso) → inadapté à un disque normal. On
@@ -184,12 +208,35 @@ if ! grep -qE '^HOOKS=.*\blvm2\b' /etc/mkinitcpio.conf; then
fi fi
mkinitcpio -P || echo "[FWS] AVERTISSEMENT : mkinitcpio a échoué" mkinitcpio -P || echo "[FWS] AVERTISSEMENT : mkinitcpio a échoué"
fws-install-step 22 "Installation de GRUB"
# --- 3) GRUB installé à la main (cf. bootloader --disabled) ------------------ # --- 3) GRUB installé à la main (cf. bootloader --disabled) ------------------
install_grub() { install_grub() {
if [ -d /sys/firmware/efi ]; then if [ -d /sys/firmware/efi ]; then
# UEFI. efibootmgr crée l'entrée NVRAM « FWS », mais il peut MANQUER de # UEFI. efibootmgr crée l'entrée NVRAM « FWS », mais il peut MANQUER de
# l'airootfs et son install dépend du réseau → on ne BLOQUE pas dessus. # l'airootfs et son install dépend du réseau → on ne BLOQUE pas dessus.
pacman -Q efibootmgr &>/dev/null || pacman -Sy --noconfirm efibootmgr || true pacman -Q efibootmgr &>/dev/null || pacman -Sy --noconfirm efibootmgr || true
# L'ESP doit être montée sur /boot/efi DANS le chroot pour que
# grub-install écrive dessus. Anaconda (bootloader --disabled) ne la
# monte pas toujours → sur du vrai matériel on se retrouvait SANS GRUB
# posé (à refaire à la main en TTY après coup). Si elle n'est pas
# montée, on cherche une partition EFI FAT32 — y compris celle d'un
# autre OS (cas dual-boot réel : ESP Windows réutilisée) — et on la
# monte. Échec ⇒ non bloquant : fws-grub-finalize (3ter) finalisera au
# 1er démarrage, quand efivars et tous les disques seront accessibles.
if ! mountpoint -q /boot/efi 2>/dev/null; then
esp="$(lsblk -nro PATH,PARTTYPENAME,FSTYPE 2>/dev/null \
| awk '$2=="EFI System" && $3=="vfat" {print $1; exit}')"
if [ -n "$esp" ]; then
mkdir -p /boot/efi
mount "$esp" /boot/efi 2>/dev/null \
&& echo "[FWS] ESP '$esp' montée sur /boot/efi (chroot)" || true
fi
fi
if ! mountpoint -q /boot/efi 2>/dev/null && [ ! -d /boot/efi/EFI ]; then
echo "[FWS] aucune ESP accessible dans le chroot — le 1er démarrage finalisera GRUB"
return 1
fi
# (a) Entrée NVRAM dédiée (best effort, si efibootmgr dispo) : # (a) Entrée NVRAM dédiée (best effort, si efibootmgr dispo) :
grub-install --target=x86_64-efi --efi-directory=/boot/efi \ grub-install --target=x86_64-efi --efi-directory=/boot/efi \
--bootloader-id=FWS --recheck || true --bootloader-id=FWS --recheck || true
@@ -217,9 +264,28 @@ install_grub() {
if install_grub; then if install_grub; then
grub-mkconfig -o /boot/grub/grub.cfg || echo "[FWS] grub-mkconfig a échoué" grub-mkconfig -o /boot/grub/grub.cfg || echo "[FWS] grub-mkconfig a échoué"
else else
echo "[FWS] AVERTISSEMENT : grub-install a échoué — bootloader à refaire à la main" echo "[FWS] AVERTISSEMENT : grub-install a échoué — le 1er démarrage finalisera GRUB"
fi fi
# --- 3ter) Filet de sécurité BARE-METAL : finalisation GRUB au 1er boot ------
# fws-grub-finalize.service (unité + script livrés par l'airootfs, recopiés sur
# le système installé par le payload) est ACTIVÉ ici. Au 1er démarrage du
# système installé — efivars accessible, tous les disques présents — il :
# (a) réinstalle GRUB en --removable (EFI/BOOT/BOOTX64.EFI) : boote même si
# le firmware (ASUS…) « oublie » l'entrée NVRAM,
# (b) crée/rafraîchit l'entrée NVRAM « FWS » (efibootmgr),
# (c) régénère le menu avec os-prober ACTIF → Windows apparaît enfin au menu
# GRUB des dual-boot (sur Arch, GRUB_DISABLE_OS_PROBER=true par défaut :
# c'était le « menu GRUB vide » vu sur du vrai matériel ; l'overlay
# airootfs /etc/default/grub pose déjà false, on re-vérifie ici).
# C'est la réparation qui devait être faite à la main en TTY après une install
# bare-metal — désormais automatique. Marqueur de succès posé par le script ;
# le service ne tourne qu'une fois. Il reste INActif sur le live (le symlink
# d'activation n'est créé qu'ici, dans le système installé).
systemctl enable fws-grub-finalize.service || true
fws-install-step 28 "Clavier et langue du système"
# --- 3bis) Clavier (X11) + LOCALE -------------------------------------------- # --- 3bis) Clavier (X11) + LOCALE --------------------------------------------
# CLAVIER : Anaconda passe par localed et n'écrit pas fiablement la disposition X # CLAVIER : Anaconda passe par localed et n'écrit pas fiablement la disposition X
# sur la CIBLE → SDDM / sessions X en QWERTY US. On CALCULE la disposition CHOISIE # sur la CIBLE → SDDM / sessions X en QWERTY US. On CALCULE la disposition CHOISIE
@@ -258,6 +324,8 @@ if [ -n "$FWSLANG" ]; then
locale-gen || echo "[FWS] locale-gen a échoué pour $FWSLANG" locale-gen || echo "[FWS] locale-gen a échoué pour $FWSLANG"
fi fi
fws-install-step 32 "Installation du bureau (pacman)"
# --- 4) Bureau choisi : pacman -S du DE (non bloquant si pas de réseau) ------- # --- 4) Bureau choisi : pacman -S du DE (non bloquant si pas de réseau) -------
DESK="cli" DESK="cli"
[ -f /tmp/fws-desktop ] && DESK="$(tr -d '[:space:]' < /tmp/fws-desktop)" [ -f /tmp/fws-desktop ] && DESK="$(tr -d '[:space:]' < /tmp/fws-desktop)"
@@ -280,56 +348,134 @@ case "$DESK" in
# (fws-setup-hardware les re-propose ensuite en --needed : sans effet # (fws-setup-hardware les re-propose ensuite en --needed : sans effet
# s'ils sont déjà là, filet de secours sinon). # s'ils sont déjà là, filet de secours sinon).
xfce) PKGS="xfce4 xfce4-goodies sddm noto-fonts pipewire pipewire-pulse wireplumber pavucontrol"; DM="sddm" ;; xfce) PKGS="xfce4 xfce4-goodies sddm noto-fonts pipewire pipewire-pulse wireplumber pavucontrol"; DM="sddm" ;;
hyprland) PKGS="hyprland kitty wofi waybar sddm noto-fonts dolphin kio-extras udisks2 hyprlock grim slurp wl-clipboard playerctl mako libnotify polkit-gnome network-manager-applet xdg-desktop-portal-hyprland ttf-nerd-fonts-symbols pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol bluez bluez-utils blueman"; DM="sddm" ;; hyprland) PKGS="hyprland kitty wofi waybar swaybg sddm noto-fonts dolphin kio-extras udisks2 hyprlock grim slurp wl-clipboard playerctl mako libnotify polkit-gnome network-manager-applet xdg-desktop-portal-hyprland ttf-nerd-fonts-symbols pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol bluez bluez-utils blueman"; DM="sddm" ;;
# i3 : session X11 → COMPATIBLE VR (SteamVR ne marche pas sous Wayland). # i3 : session X11 → COMPATIBLE VR (SteamVR ne marche pas sous Wayland).
# xorg-server est requis (SDDM ne le tire pas) ; maim+xclip = captures X11, # xorg-server est requis (SDDM ne le tire pas) ; maim+xclip = captures X11,
# dunst = notifications X11 (équivalent de mako), i3lock = verrouillage. # dunst = notifications X11 (équivalent de mako), i3lock = verrouillage.
# fws-vr-setup (Super+Shift+V ou menu) installe les drivers du casque. # fws-vr-setup (Super+Shift+V ou menu) installe les drivers du casque.
i3) PKGS="i3-wm i3lock xorg-server polybar picom rofi kitty dolphin kio-extras udisks2 sddm noto-fonts ttf-nerd-fonts-symbols maim xclip dunst libnotify polkit-gnome network-manager-applet playerctl brightnessctl pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol bluez bluez-utils blueman"; DM="sddm" ;; i3) PKGS="i3-wm i3lock xorg-server polybar picom feh rofi kitty dolphin kio-extras udisks2 sddm noto-fonts ttf-nerd-fonts-symbols maim xclip dunst libnotify polkit-gnome network-manager-applet playerctl brightnessctl pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol bluez bluez-utils blueman"; DM="sddm" ;;
cli|*) PKGS="" ;; cli|*) PKGS="" ;;
esac esac
# Navigateur de base ajouté DÈS QU'un bureau est choisi (jamais en CLI). # Navigateur de base ajouté DÈS QU'un bureau est choisi (jamais en CLI).
# + python-gobject : fenêtre de bienvenue fws-hello (GTK3 vient avec Firefox) # + python-gobject : fenêtre de bienvenue fws-hello (GTK3 vient avec Firefox)
# + pacman-contrib : checkupdates/paccache (indicateur de MàJ + fws-update) # + pacman-contrib : checkupdates/paccache (indicateur de MàJ + fws-update)
[ -n "$PKGS" ] && PKGS="$PKGS firefox python-gobject pacman-contrib" # + noto-fonts-emoji : police emoji par défaut, dans la MÊME transaction que le
# bureau (règle fontconfig : etc/fonts/conf.d/99-fws-emoji.conf) — sans elle,
# les emoji des notifications/menus s'affichent en carrés vides.
[ -n "$PKGS" ] && PKGS="$PKGS firefox python-gobject pacman-contrib noto-fonts-emoji"
if [ -n "$PKGS" ]; then if [ -n "$PKGS" ]; then
pacman-key --init &>/dev/null || true pacman-key --init &>/dev/null || true
pacman-key --populate archlinux &>/dev/null || true pacman-key --populate archlinux &>/dev/null || true
# Script de RATTRAPAGE généré avec les valeurs de CE choix : si l'install # Script de RATTRAPAGE généré avec les valeurs de CE choix : si l'install
# du bureau échoue (réseau/miroirs), l'utilisateur la rejoue en une # du bureau échoue (réseau/miroirs), le système installé se répare TOUT
# commande depuis le système installé. --needed → inoffensif si déjà fait. # SEUL au premier démarrage (fws-desktop-finalize.service ci-dessous), et
# l'utilisateur peut aussi relancer le script à la main.
# --needed → inoffensif si déjà fait. --auto → bascule immédiatement
# sur l'écran de connexion après succès (pas de reboot à faire).
cat > /usr/local/bin/fws-desktop-retry <<RETRYEOF cat > /usr/local/bin/fws-desktop-retry <<RETRYEOF
#!/bin/bash #!/bin/bash
# Généré par l'installateur FWS — (ré)installe le bureau « $DESK ». # Généré par l'installateur FWS — (ré)installe le bureau « $DESK ».
# Usage : fws-desktop-retry [--auto] (--auto = relancé par le service au 1er démarrage)
set -u set -u
[ "\$(id -u)" -eq 0 ] || exec sudo "\$0" "\$@" [ "\$(id -u)" -eq 0 ] || exec sudo "\$0" "\$@"
AUTO=""
[ "\${1:-}" = "--auto" ] && AUTO=1
if [ -n "\$AUTO" ]; then
wall "FWS : installation du bureau « $DESK » en cours… ne coupez pas l'alimentation." 2>/dev/null || true
fi
echo "==> Installation du bureau $DESK…" echo "==> Installation du bureau $DESK…"
pacman -Syy --noconfirm --needed $PKGS || { echo "Échec (réseau ?) — réessayez."; exit 1; } # Keyring pacman : s'il est périmé, -Sy échoue alors que le réseau va bien
# (typique d'un système fraîchement installé depuis une image).
pacman-key --init &>/dev/null || true
pacman-key --populate archlinux &>/dev/null || true
# Attente du réseau (DNS) : au 1er démarrage, NetworkManager peut mettre
# ~30 s à monter la connexion.
for _i in 1 2 3 4 5 6 7 8 9 10; do
getent hosts geo.mirror.pkgbuild.com >/dev/null 2>&1 && break
sleep 3
done
# Synchro + filtre : un paquet renommé/absent ne doit pas faire échouer TOUT
# le bureau (même approche que fws-setup-hardware pour la stack matérielle).
pacman -Syy --noconfirm || { echo "Échec de la synchro (réseau ?) — réessayez."; exit 1; }
_FILTERED=""
for _p in $PKGS; do
pacman -Si "\$_p" >/dev/null 2>&1 && _FILTERED="\$_FILTERED \$_p"
done
PKGS="\${_FILTERED# }"
[ -n "\$PKGS" ] || { echo "Aucun paquet du bureau $DESK trouvé dans les dépôts — réessayez plus tard."; exit 1; }
pacman -S --noconfirm --needed \$PKGS || { echo "Échec (réseau ?) — réessayez."; exit 1; }
[ -n "$DM" ] && systemctl enable "$DM" [ -n "$DM" ] && systemctl enable "$DM"
systemctl set-default graphical.target systemctl set-default graphical.target
rm -f /var/lib/fws/desktop-failed rm -f /var/lib/fws/desktop-failed
[ -f /etc/motd ] && grep -q fws-desktop-retry /etc/motd && rm -f /etc/motd [ -f /etc/motd ] && grep -q fws-desktop-retry /etc/motd && rm -f /etc/motd
echo "==> Bureau installé ✔ — redémarrez (reboot) pour arriver sur l'écran de connexion." echo "==> Bureau installé ✔"
if [ -n "\$AUTO" ]; then
echo "==> Passage sur l'écran de connexion…"
systemctl isolate graphical.target || true
else
echo "==> Redémarrez (reboot) pour arriver sur l'écran de connexion."
fi
RETRYEOF RETRYEOF
chmod 755 /usr/local/bin/fws-desktop-retry chmod 755 /usr/local/bin/fws-desktop-retry
# Service de FINALISATION au 1er démarrage : si l'installation du bureau
# a échoué pendant le %post (réseau/miroirs indisponibles à ce moment-là),
# le système installé se répare TOUT SEUL. Au premier boot — et aux
# suivants tant que le marqueur /var/lib/fws/desktop-failed existe — il
# relance fws-desktop-retry --auto : le bureau est installé, le DM activé
# et l'écran de connexion apparaît sans redémarrage manuel.
cat > /etc/systemd/system/fws-desktop-finalize.service <<'FINEOF'
[Unit]
Description=FWS - Finalisation du bureau au premier demarrage
# Ne fait rien si le bureau a ete installe correctement pendant l'install.
ConditionPathExists=/var/lib/fws/desktop-failed
After=NetworkManager.service systemd-resolved.service
Wants=NetworkManager.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/fws-desktop-retry --auto
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
FINEOF
systemctl enable fws-desktop-finalize.service || true
# Le réseau peut mettre quelques secondes à monter dans l'environnement # Le réseau peut mettre quelques secondes à monter dans l'environnement
# d'installation : on attend la résolution DNS avant le premier essai, # d'installation : on attend la résolution DNS avant le premier essai.
# puis on tente pacman jusqu'à 3 fois (miroir capricieux ≠ échec définitif).
for _i in 1 2 3 4 5 6 7 8 9 10; do for _i in 1 2 3 4 5 6 7 8 9 10; do
getent hosts geo.mirror.pkgbuild.com >/dev/null 2>&1 && break getent hosts geo.mirror.pkgbuild.com >/dev/null 2>&1 && break
sleep 3 sleep 3
done done
# Synchro unique + filtre : un paquet renommé/absent ne doit pas faire
# échouer TOUT le bureau (même approche que fws-setup-hardware), puis on
# tente pacman jusqu'à 3 fois (miroir capricieux ≠ échec définitif).
pacman -Sy --noconfirm || echo "[FWS] synchro pacman initiale échouée (réseau ?)"
_FILTERED=""
for _p in $PKGS; do
pacman -Si "$_p" >/dev/null 2>&1 && _FILTERED="$_FILTERED $_p"
done
[ -n "$_FILTERED" ] && PKGS="${_FILTERED# }"
_DE_OK="" _DE_OK=""
for _try in 1 2 3; do for _try in 1 2 3; do
pacman -Sy --noconfirm --needed $PKGS && { _DE_OK=1; break; } pacman -S --noconfirm --needed $PKGS && { _DE_OK=1; break; }
echo "[FWS] installation du bureau : tentative $_try échouée — nouvel essai dans 15 s…" echo "[FWS] installation du bureau : tentative $_try échouée — nouvel essai dans 15 s…"
sleep 15 sleep 15
done done
if [ -n "$_DE_OK" ]; then if [ -n "$_DE_OK" ]; then
[ -n "$DM" ] && systemctl enable "$DM" || true # Activation graphique : DM + graphical.target. Si l'une des deux
systemctl set-default graphical.target || true # échoue (improbable), on laisse quand même le marqueur → le service
# fws-desktop-finalize réparera automatiquement au 1er démarrage.
_ACTIVATED=""
[ -n "$DM" ] && systemctl enable "$DM" && _ACTIVATED=1
systemctl set-default graphical.target && _ACTIVATED=1
if [ -z "$_ACTIVATED" ]; then
echo "[FWS] activation graphique échouée — rattrapage automatique au 1er démarrage"
mkdir -p /var/lib/fws
echo "$DESK" > /var/lib/fws/desktop-failed
fi
# SDDM (KDE / XFCE / Hyprland) : pavé numérique + écran de connexion FWS. # SDDM (KDE / XFCE / Hyprland) : pavé numérique + écran de connexion FWS.
# Le thème « fws » (livré par l'airootfs → recopié par le payload dans # Le thème « fws » (livré par l'airootfs → recopié par le payload dans
# /usr/share/sddm/themes/fws) est en pur QtQuick/Controls Basic : # /usr/share/sddm/themes/fws) est en pur QtQuick/Controls Basic :
@@ -425,8 +571,9 @@ HYEOF
gtk-update-icon-cache -f /usr/share/icons/hicolor 2>/dev/null || true gtk-update-icon-cache -f /usr/share/icons/hicolor 2>/dev/null || true
fi fi
else else
echo "[FWS] Bureau '$DESK' NON installé après 3 tentatives (réseau/miroirs ?)." echo "[FWS] Bureau '$DESK' NON installé pendant le %post (réseau/miroirs ?)."
echo "[FWS] Rattrapage sur le système installé : sudo fws-desktop-retry" echo "[FWS] Rattrapage AUTOMATIQUE au prochain démarrage (fws-desktop-finalize.service)."
echo "[FWS] Manuellement : sudo fws-desktop-retry"
mkdir -p /var/lib/fws mkdir -p /var/lib/fws
echo "$DESK" > /var/lib/fws/desktop-failed echo "$DESK" > /var/lib/fws/desktop-failed
# Le premier login (console) explique quoi faire — le motd est retiré # Le premier login (console) explique quoi faire — le motd est retiré
@@ -436,22 +583,27 @@ HYEOF
⚠ FWS : l'installation du bureau a échoué (réseau indisponible pendant ⚠ FWS : l'installation du bureau a échoué (réseau indisponible pendant
l'installation). Le système fonctionne, mais en console. l'installation). Le système fonctionne, mais en console.
Une fois le réseau branché, lancez : sudo fws-desktop-retry Le système va réessayer AUTOMATIQUEMENT au prochain démarrage.
puis redémarrez : le bureau choisi sera installé et activé. Manuellement : sudo fws-desktop-retry
MOTD MOTD
fi fi
fi fi
fws-install-step 62 "Bureau installé — pilotes et pile matérielle"
# --- 4quater) ADN FWS : détection matériel + drivers + stack « Windows » ------ # --- 4quater) ADN FWS : détection matériel + drivers + stack « Windows » ------
# Script dédié (NON bloquant ; réseau requis) : drivers GPU détectés via lspci + # Script dédié (NON bloquant ; réseau requis) : drivers GPU détectés via lspci
# outils invité VM, son/micro/casque (PipeWire), Bluetooth, Podman, et — si un # (+ ICD Vulkan 64/32 bits de chaque GPU, loader, vulkaninfo), outils invité VM,
# bureau est choisi — Steam, Wine, VR (Monado/SteamVR), winboat-bin (apps # son/micro/casque (PipeWire), Bluetooth, Podman, et — si un
# Windows). C'est le cœur « remplacement de Windows » de FWS. # bureau est choisi — Steam, Wine, VR (Monado/SteamVR), PacManager (gestionnaire
# de paquets). C'est le cœur « remplacement de Windows » de FWS.
if [ -x /usr/local/bin/fws-setup-hardware ]; then if [ -x /usr/local/bin/fws-setup-hardware ]; then
/usr/local/bin/fws-setup-hardware "$DESK" || true /usr/local/bin/fws-setup-hardware "$DESK" || true
fi fi
fws-install-step 76 "Configuration du bureau (raccourcis, barres, thème)"
# --- Config Hyprland (si choisi) : clavier + apps + waybar ------------------- # --- Config Hyprland (si choisi) : clavier + apps + waybar -------------------
# Hyprland (Wayland) NE lit PAS /etc/X11/xorg.conf.d/00-keyboard.conf : sa # Hyprland (Wayland) NE lit PAS /etc/X11/xorg.conf.d/00-keyboard.conf : sa
# disposition est dans SA config (input { kb_layout }). Sans config il démarre nu # disposition est dans SA config (input { kb_layout }). Sans config il démarre nu
@@ -508,6 +660,8 @@ if [ "$DESK" = "i3" ] && [ -f /usr/local/share/fws/i3-config ]; then
done < /etc/passwd done < /etc/passwd
fi fi
fws-install-step 84 "Droits administrateur et identité FWS"
# --- 4bis) Sudo : l'utilisateur créé doit pouvoir administrer ----------------- # --- 4bis) Sudo : l'utilisateur créé doit pouvoir administrer -----------------
# Arch laisse « %wheel » COMMENTÉ dans sudoers → même un membre de wheel ne peut # Arch laisse « %wheel » COMMENTÉ dans sudoers → même un membre de wheel ne peut
# pas sudo. On active le groupe wheel (drop-in) ET on y ajoute tous les # pas sudo. On active le groupe wheel (drop-in) ET on y ajoute tous les
@@ -570,6 +724,8 @@ systemctl enable systemd-timesyncd.service 2>/dev/null || true
# normal), la target le tire par Requires. Dans le bureau, le lanceur # normal), la target le tire par Requires. Dans le bureau, le lanceur
# « Récupération FWS » (fws-recovery.desktop, polkit) fait le même travail. # « Récupération FWS » (fws-recovery.desktop, polkit) fait le même travail.
fws-install-step 92 "Sécurité et réseau du système installé"
# --- 5) Sécurité : verrouiller root s'il est resté SANS mot de passe ---------- # --- 5) Sécurité : verrouiller root s'il est resté SANS mot de passe ----------
# L'airootfs live a souvent un root sans mot de passe ; si l'utilisateur n'en a # L'airootfs live a souvent un root sans mot de passe ; si l'utilisateur n'en a
# pas défini dans le GUI, on verrouille plutôt que de laisser le compte ouvert. # pas défini dans le GUI, on verrouille plutôt que de laisser le compte ouvert.
@@ -592,6 +748,8 @@ ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
systemctl enable systemd-resolved.service 2>/dev/null || true systemctl enable systemd-resolved.service 2>/dev/null || true
install -d /etc/NetworkManager/conf.d install -d /etc/NetworkManager/conf.d
printf '[main]\ndns=systemd-resolved\n' > /etc/NetworkManager/conf.d/dns.conf printf '[main]\ndns=systemd-resolved\n' > /etc/NetworkManager/conf.d/dns.conf
fws-install-step 99 "Finalisation"
%end %end
@@ -604,7 +762,9 @@ printf '[main]\ndns=systemd-resolved\n' > /etc/NetworkManager/conf.d/dns.conf
# le disque va booter. # le disque va booter.
# ============================================================================ # ============================================================================
%post --nochroot %post --nochroot
# FWS-TITLE: Finalisation et copie des journaux
SYSROOT=/mnt/sysroot SYSROOT=/mnt/sysroot
[ -d "$SYSROOT" ] || SYSROOT=/mnt/sysimage [ -d "$SYSROOT" ] || SYSROOT=/mnt/sysimage
cp -f "$SYSROOT/var/log/fws-post.log" /tmp/fws-post-chroot.log 2>/dev/null || true cp -f "$SYSROOT/var/log/fws-post.log" /tmp/fws-post-chroot.log 2>/dev/null || true
fws-install-step 100 "Installation terminée"
%end %end
+7 -1
View File
@@ -95,6 +95,9 @@ xorg-xrandr
xorg-xsetroot xorg-xsetroot
openbox openbox
ttf-dejavu ttf-dejavu
# Emoji de l'installateur et du live (règle fontconfig :
# etc/fonts/conf.d/99-fws-emoji.conf) — Anaconda affiche des emoji FWS.
noto-fonts-emoji
# --- Agents VM (pratique pour tester l'ISO) --- # --- Agents VM (pratique pour tester l'ISO) ---
qemu-guest-agent qemu-guest-agent
@@ -102,7 +105,10 @@ virtualbox-guest-utils-nox
open-vm-tools open-vm-tools
# --- FWS (fws-local) --- # --- FWS (fws-local) ---
winboat-bin # Gestionnaire de paquets graphique PacManager (Qt6). Installé dans un
# répertoire dédié /opt/fws-pacmanage : son self-update réécrit CE dossier
# (binaire + fichier version + plugins) sans toucher à /usr.
fws-pacmanage
# --- Installateur Anaconda (fws-local) --- # --- Installateur Anaconda (fws-local) ---
# 'anaconda' tire automatiquement anaconda-widgets + toutes ses dépendances # 'anaconda' tire automatiquement anaconda-widgets + toutes ses dépendances
+3
View File
@@ -25,6 +25,7 @@ file_permissions=(
["/usr/bin/load_policy"]="0:0:755" ["/usr/bin/load_policy"]="0:0:755"
["/usr/bin/setstatus"]="0:0:755" ["/usr/bin/setstatus"]="0:0:755"
["/usr/local/bin/fws-setup-hardware"]="0:0:755" ["/usr/local/bin/fws-setup-hardware"]="0:0:755"
["/usr/local/bin/fws-grub-finalize"]="0:0:755"
["/usr/local/bin/fws-keys"]="0:0:755" ["/usr/local/bin/fws-keys"]="0:0:755"
["/usr/local/bin/fws-vr-setup"]="0:0:755" ["/usr/local/bin/fws-vr-setup"]="0:0:755"
["/usr/local/bin/fws-hello"]="0:0:755" ["/usr/local/bin/fws-hello"]="0:0:755"
@@ -36,5 +37,7 @@ file_permissions=(
["/usr/local/bin/fws-recovery-gui"]="0:0:755" ["/usr/local/bin/fws-recovery-gui"]="0:0:755"
["/usr/local/bin/fws-powermenu"]="0:0:755" ["/usr/local/bin/fws-powermenu"]="0:0:755"
["/usr/local/bin/fws-about"]="0:0:755" ["/usr/local/bin/fws-about"]="0:0:755"
["/usr/local/bin/fws-wallpaper"]="0:0:755"
["/usr/local/bin/fws-install-step"]="0:0:755"
["/etc/grub.d/42_fws-recovery"]="0:0:755" ["/etc/grub.d/42_fws-recovery"]="0:0:755"
) )
+24 -5
View File
@@ -25,7 +25,7 @@
# ============================================================================ # ============================================================================
pkgname=anaconda pkgname=anaconda
pkgver=45.8 pkgver=45.8
pkgrel=4 pkgrel=5
pkgdesc="The Anaconda installer (porté sur Arch pour FWS, payload liveimg)" pkgdesc="The Anaconda installer (porté sur Arch pour FWS, payload liveimg)"
arch=('x86_64') arch=('x86_64')
url="https://github.com/rhinstaller/anaconda" url="https://github.com/rhinstaller/anaconda"
@@ -75,9 +75,13 @@ prepare() {
# ── FWS : champ « Nom de machine » dans le spoke Utilisateur ─────────────── # ── FWS : champ « Nom de machine » dans le spoke Utilisateur ───────────────
# Anaconda ne propage PAS le hostname (le champ du spoke Réseau est perdu chez # Anaconda ne propage PAS le hostname (le champ du spoke Réseau est perdu chez
# nous → /etc/hostname vide). On ajoute donc un champ Hostname à l'onglet de # nous → /etc/hostname vide). Le nom de machine est désormais demandé PLUS TÔT,
# création de compte (ligne 2 de la grille, libre) ; user.py écrit la valeur # à l'écran « Réseau » (spoke fws_network.py de l'airootfs, qui écrit
# dans /tmp/fws-hostname, que le %post du kickstart applique à /etc/hostname. # /tmp/fws-hostname). Le champ ci-dessous sert de RE-DEMANDE au moment de la
# création de compte : il est PRÉ-REMPLI depuis /tmp/fws-hostname (pour ne pas
# écraser le nom choisi à l'écran Réseau par une valeur vide) et user.py écrit
# la valeur (éventuellement modifiée) dans /tmp/fws-hostname, que le %post du
# kickstart applique à /etc/hostname.
python3 - <<'PYEOF' python3 - <<'PYEOF'
import glob import glob
@@ -136,7 +140,22 @@ s = open(p, encoding='utf-8').read()
anchor = 'self._username_entry = self.builder.get_object("username_entry")' anchor = 'self._username_entry = self.builder.get_object("username_entry")'
assert anchor in s, "FWS: ancre username_entry absente" assert anchor in s, "FWS: ancre username_entry absente"
s = s.replace(anchor, s = s.replace(anchor,
anchor + '\n self._hostname_entry = self.builder.get_object("hostname_entry")', anchor + '\n self._hostname_entry = self.builder.get_object("hostname_entry")' + '''
# FWS : pré-remplir depuis l'écran Réseau (fws_network.py) si un nom y a
# déjà été saisi — sinon apply() ci-dessous écraserait ce nom par une
# valeur vide (le champ démarre vide). initialize() relit le fichier à
# chaque entrée dans le spoke.
try:
with open("/tmp/fws-hostname") as _fh:
_hn0 = _fh.read().strip()
except OSError:
_hn0 = ""
if _hn0:
try:
self._hostname_entry.set_text(_hn0)
except Exception:
pass''',
1) 1)
ap = 'set_user_list(self._users_module, self._user_list, remove_unset=True)' ap = 'set_user_list(self._users_module, self._user_list, remove_unset=True)'
assert ap in s, "FWS: ancre apply() absente" assert ap in s, "FWS: ancre apply() absente"
+31
View File
@@ -0,0 +1,31 @@
# Maintainer: FWS
pkgname=fws-dnd
pkgver=2.0.0
pkgrel=1
pkgdesc="Gestionnaire D&D 5e pour FWS (GTK4) : dés, créateur de personnage (règles officielles), grimoire, sessions, tracker de combat"
arch=('any')
url="https://fws.local/fws-dnd"
license=('MIT')
depends=('python' 'python-gobject' 'gtk4')
source=("${pkgname}-${pkgver}.tar.gz")
sha256sums=('SKIP')
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
# Module Python (application GTK4)
install -d "${pkgdir}/usr/share/${pkgname}"
cp -r gui/fwsdnd "${pkgdir}/usr/share/${pkgname}/"
# pas de bytecode pré-généré dans le paquet
find "${pkgdir}/usr/share/${pkgname}" -name '__pycache__' -type d -exec rm -rf {} +
# Exécutable
install -Dm755 bin/fws-dnd "${pkgdir}/usr/bin/fws-dnd"
# Intégration bureau
install -Dm644 fws-dnd.desktop "${pkgdir}/usr/share/applications/fws-dnd.desktop"
install -Dm644 fws-dnd.svg "${pkgdir}/usr/share/icons/hicolor/scalable/apps/fws-dnd.svg"
# Documentation
install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
}
Binary file not shown.
+59
View File
@@ -0,0 +1,59 @@
# Maintainer: FWS
pkgname=fws-pacmanage
pkgver=1.6.2
pkgrel=1
pkgdesc="PacManager — gestionnaire de paquets graphique FWS (Qt6, sur pacman)"
arch=('x86_64')
url="https://gitea.nocode-var.tech/FWS/FWS-PacManage"
# FWS owns PacManager; the upstream LICENSE is source-available, not free.
license=('custom')
depends=('qt6-base' 'zlib' 'pacman')
makedepends=('cmake' 'gcc')
# Pinned to the commit the V1.6.2 tag points at instead of the tag name: a sha
# keeps the archive reproducible even if the tag is moved (V1.6.2).
_commit=d27792975ed572d7ba4c617d910d10e017fd0649
source=("${pkgname}-${pkgver}.tar.gz::https://gitea.nocode-var.tech/FWS/FWS-PacManage/archive/${_commit}.tar.gz")
sha256sums=('be6be117c7ac55a6d4ff8d95967eea80f972d4edaf2c3f4737673d58063b6c59')
# The whole app lives under /opt/fws-pacmanage because it updates itself: the
# self-update replaces the binary, the `version` marker and the plugins in the
# directory of the running executable. A real prefix keeps those files out of
# /usr/bin (a bare `bin` install would drop /usr/bin/version and /usr/bin/plugins).
build() {
cmake -S "${srcdir}/${pkgname}" -B "${srcdir}/build" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/fws-pacmanage \
-DFWS_BUILD_FLATPAK_PLUGIN=ON \
-DFWS_BUILD_AUR_PLUGIN=ON
cmake --build "${srcdir}/build" -j"$(nproc)"
}
package() {
DESTDIR="${pkgdir}" cmake --install "${srcdir}/build"
# The upstream CMakeLists declares its plugin install() rules ABOVE the
# FWS_BUILD_*_PLUGIN option() calls, so both are undefined there and
# `cmake --install` never ships the providers. Install the built modules by
# hand into the first search path, which is also where the self-update
# refreshes them (<prefix>/bin/plugins).
install -d "${pkgdir}/opt/fws-pacmanage/bin/plugins"
install -m755 "${srcdir}/build/plugins/"*.so \
"${pkgdir}/opt/fws-pacmanage/bin/plugins/"
# Entry point outside the self-updating tree: launchers and shells find it on
# PATH while the update keeps rewriting /opt/fws-pacmanage/bin.
install -d "${pkgdir}/usr/bin"
ln -s /opt/fws-pacmanage/bin/PacManager "${pkgdir}/usr/bin/PacManager"
# Launchers only read /usr/share; the prefix copies stay in /opt.
install -Dm644 "${pkgdir}/opt/fws-pacmanage/share/applications/org.fws.PacManager.desktop" \
"${pkgdir}/usr/share/applications/org.fws.PacManager.desktop"
install -Dm644 "${pkgdir}/opt/fws-pacmanage/share/icons/hicolor/scalable/apps/org.fws.PacManager.svg" \
"${pkgdir}/usr/share/icons/hicolor/scalable/apps/org.fws.PacManager.svg"
# Restrictive upstream license (FWS, all rights reserved): the notice has to
# travel with the redistributed binary.
install -Dm644 "${srcdir}/${pkgname}/LICENSE" \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
+29
View File
@@ -0,0 +1,29 @@
```markdown
# Projet FWS-ISO
## Aperçu du projet
Ce projet vise à créer une image ISO personnalisée pour un environnement de travail multi-plateforme, incluant des configurations pour différents systèmes d'exploitation (Linux, Windows, macOS). Il intègre des scripts de détection matérielle, des outils de configuration de bureau, et des processus de build automatisés.
## Composants clés
- **Détection matérielle** : Scripts pour identifier les composants matériels et configurer les pilotes appropriés.
- **Configuration de bureau** : Support pour des environnements comme Hyprland, Anaconda, et autres configurations personnalisées.
- **Processus de build** : Génération d'images ISO avec des dates de build dynamiques et des versions/variants personnalisés.
- **Systèmes d'exploitation** : Configuration pour Linux (via des outils comme Anaconda), Windows, et macOS.
## Instructions de configuration
1. **Cloner le repository** : `git clone https://github.com/BlackAngelTVdev/FWS-ISO`
2. **Configurer les paramètres** : Modifiez les fichiers de configuration dans le dossier `config/` pour adapter le projet à vos besoins.
3. **Exécuter les scripts** : Utilisez les scripts fournis dans le dossier `scripts/` pour automatiser la configuration et la génération de l'ISO.
4. **Tester l'ISO** : Après la génération, testez l'image ISO sur des machines virtuelles ou physiques pour vérifier les configurations.
## Prochaines étapes
- Ajouter des tests automatisés pour valider les configurations.
- Intégrer des outils de sécurité pour garantir la robustesse de l'ISO.
- Documenter davantage les étapes de configuration pour faciliter l'utilisation par d'autres utilisateurs.
## Notes importantes
- Le projet utilise Git pour le suivi des versions. Assurez-vous de travailler sur la branche `Multi-Desktop` ou `Main` selon vos besoins.
- Les scripts sont conçus pour être exécutés dans un environnement Windows, mais des adaptations peuvent être nécessaires pour d'autres systèmes.
Date de création : 2026-07-06
```
+65
View File
@@ -0,0 +1,65 @@
#!/bin/bash
# ============================================================================
# FWS — Repli Docker Desktop (Windows sans distro WSL Arch)
#
# Sur Windows, les scripts racines (setup-aur.sh, build.sh, build-offi.sh)
# cherchent une distro WSL Arch puis basculent dedans. Si aucune n'est
# joignable mais que Docker Desktop tourne, on relance le script à
# l'identique dans un conteneur archlinux : l'équivalent Windows du repli
# podman des hôtes Linux non-Arch (mêmes principes : pull explicite de
# l'image, volume de cache pacman partagé fws-pacman-cache, --privileged
# pour mkarchiso, -e FWS_IN_CONTAINER=1).
#
# Sourcé DEPUIS la branche Git Bash d'un script racine (Windows uniquement) :
# source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/fws-docker-repl.sh"
# if fws_docker_repl "setup-aur.sh" "$SCRIPT_DIR_WIN"; then exit 0; fi
#
# fws_docker_repl ne rend la main QUE si Docker est absent ou injoignable
# (code 1) — dans ce cas l'appelant garde son message « installe une distro
# WSL Arch » et sort. Dès que le conteneur est lancé, elle propage son code
# de sortie et termine le script (exit), donc le code après l'appel n'est
# jamais atteint en cas de succès.
#
# Le dépôt Windows est monté sur un chemin stable /fws dans le conteneur
# (le script calcule son WORK_DIR depuis $0 → local-repo/, out/ et les
# PKGBUILD restent ceux du dépôt monté). makepkg (setup-aur.sh) exige sudo
# dans l'image : installé par le script lui-même (étape 1/4, ligne
# « base-devel git sudo »). Les fichiers écrits par le conteneur sur le
# montage sont créés par le proxy de Docker Desktop côté Windows → pas de
# re-chown nécessaire (contrairement à podman rootful sur Linux).
# ============================================================================
fws_docker_repl() {
local self="$1" repo_win="$2" tty=()
[ -t 0 ] && tty=(-it)
echo -e "\e[36mAucune distro WSL Arch joignable — repli Docker Desktop (conteneur Arch)...\e[0m"
command -v docker >/dev/null 2>&1 || {
echo -e "\e[31m docker introuvable. Installe Docker Desktop, ou une distro WSL Arch (voir message de l'appelant).\e[0m" >&2
return 1
}
if ! docker info >/dev/null 2>&1; then
echo -e "\e[31m Le moteur Docker ne répond pas — démarre Docker Desktop puis relance.\e[0m" >&2
return 1
fi
local image="docker.io/library/archlinux:latest"
# pull explicite : « run » ne re-résout jamais le tag « latest » une fois
# l'image en cache → sinon on build sur une image qui vieillit (même
# parade que le repli podman ; une image fraîche a un keyring valide).
echo -e "\e[36m==> Pull de l'image $image...\e[0m"
docker pull "$image" || return 1
echo -e "\e[36m==> Relance dans le conteneur ($self)...\e[0m"
# MSYS_NO_PATHCONV=1 : passe des arguments bruts (chemin Windows + /fws)
# à docker.exe sans conversion de chemins Git Bash.
MSYS_NO_PATHCONV=1 docker run --rm "${tty[@]}" --privileged \
-e FWS_IN_CONTAINER=1 \
-v fws-pacman-cache:/var/cache/pacman/pkg \
-v "$repo_win:/fws" \
-w /fws \
"$image" \
bash "/fws/$self"
exit $?
}
+67 -11
View File
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# ============================================================ # ============================================================
# FWS — Build des paquets AUR (winboat-bin) + PKGBUILD locaux (deps Anaconda) # FWS — Build des paquets AUR + PKGBUILD locaux (deps Anaconda, fws-dnd,
# et création du repo pacman local fws-local/. # fws-pacmanage) et création du repo pacman local fws-local/.
# #
# Rejoue-le si tu changes la liste AUR_PACKAGES ou pour # Rejoue-le si tu changes la liste AUR_PACKAGES ou pour
# rafraîchir le repo local. # rafraîchir le repo local.
@@ -13,7 +13,6 @@ trap 'rc=$?; echo -e "\033[0;31m[ERR] Échec (setup-aur.sh) ligne $LINENO, code
# boucle plus bas installe chaque paquet après build pour résoudre les chaînes). # boucle plus bas installe chaque paquet après build pour résoudre les chaînes).
# - libxmlrpc, satyr : deps de libreport (deps officielles uniquement) # - libxmlrpc, satyr : deps de libreport (deps officielles uniquement)
# - libreport : tiré par python-meh ; chaîne AUR→AUR → APRÈS satyr+libxmlrpc # - libreport : tiré par python-meh ; chaîne AUR→AUR → APRÈS satyr+libxmlrpc
# - winboat-bin : app FWS
# - python-* : deps Anaconda présentes dans l'AUR (deps officielles only) # - python-* : deps Anaconda présentes dans l'AUR (deps officielles only)
# python-blivet est packagé en LOCAL (pkgbuilds/, patché sans libselinux). # python-blivet est packagé en LOCAL (pkgbuilds/, patché sans libselinux).
# gnome-kiosk (WM de la session GUI) est différé au chantier C. # gnome-kiosk (WM de la session GUI) est différé au chantier C.
@@ -21,7 +20,7 @@ trap 'rc=$?; echo -e "\033[0;31m[ERR] Échec (setup-aur.sh) ligne $LINENO, code
# packagé en LOCAL (pkgbuilds/python-iso639, projet PyPI « iso639 » 0.1.4). # packagé en LOCAL (pkgbuilds/python-iso639, projet PyPI « iso639 » 0.1.4).
# NB : python-langtable RETIRÉ de l'AUR (figé 0.0.51, sans list_common_languages) → # NB : python-langtable RETIRÉ de l'AUR (figé 0.0.51, sans list_common_languages) →
# packagé en LOCAL (pkgbuilds/python-langtable, 0.0.71). # packagé en LOCAL (pkgbuilds/python-langtable, 0.0.71).
AUR_PACKAGES=(libxmlrpc satyr libreport winboat-bin python-pid python-xkbregistry python-requests-ftp) AUR_PACKAGES=(libxmlrpc satyr libreport python-pid python-xkbregistry python-requests-ftp)
DISTRO_NAME="${ARCH_WSL_DISTRO:-Arch}" DISTRO_NAME="${ARCH_WSL_DISTRO:-Arch}"
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m' RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'
@@ -42,6 +41,10 @@ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || -n "$WINDIR" ]]; then
export MSYS_NO_PATHCONV=1 export MSYS_NO_PATHCONV=1
export MSYS2_ARG_CONV_EXCL="*" export MSYS2_ARG_CONV_EXCL="*"
# Repli Docker Desktop si aucune distro WSL Arch n'est joignable
# (définit fws_docker_repl, cf. scripts/fws-docker-repl.sh).
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/fws-docker-repl.sh"
# WSL doit être présent. # WSL doit être présent.
command -v wsl.exe >/dev/null 2>&1 \ command -v wsl.exe >/dev/null 2>&1 \
|| error "WSL introuvable — PowerShell admin : 'wsl --install', puis installe une distro Arch et relance." || error "WSL introuvable — PowerShell admin : 'wsl --install', puis installe une distro Arch et relance."
@@ -66,7 +69,15 @@ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || -n "$WINDIR" ]]; then
if ! pick_arch_distro; then if ! pick_arch_distro; then
warn "Distros WSL installées :" warn "Distros WSL installées :"
wsl.exe -l -v 2>/dev/null | tr -d '\0' >&2 || true wsl.exe -l -v 2>/dev/null | tr -d '\0' >&2 || true
error "Aucune distro WSL Arch joignable. Installe ArchWSL (nom 'Arch') ou 'wsl --install -d archlinux', ou exporte ARCH_WSL_DISTRO=<nom>." # Aucune distro WSL Arch ? Si Docker Desktop tourne, on relance ce
# script dans un conteneur archlinux (même principe que le repli
# podman des hôtes Linux non-Arch). fws_docker_repl sort le script
# lui-même en cas de succès ; sinon on garde le message d'erreur.
SCRIPT_DIR_WIN="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -W)"
if fws_docker_repl "setup-aur.sh" "$SCRIPT_DIR_WIN"; then
exit 0
fi
error "Aucune distro WSL Arch joignable (repli Docker indisponible). Installe ArchWSL (nom 'Arch') ou 'wsl --install -d archlinux', ou exporte ARCH_WSL_DISTRO=<nom>."
fi fi
info "Distro WSL : $DISTRO_NAME" info "Distro WSL : $DISTRO_NAME"
@@ -184,13 +195,24 @@ pacman-key --populate archlinux 2>/dev/null || true
# (ex. gcc-libs → libgcc + libstdc++) sinon makepkg plantera sur # (ex. gcc-libs → libgcc + libstdc++) sinon makepkg plantera sur
# "conflicting files" lors de l'install des dépendances. # "conflicting files" lors de l'install des dépendances.
info "Mise à jour complète du système (peut être long la première fois)…" info "Mise à jour complète du système (peut être long la première fois)…"
pacman -Syu --noconfirm \ if ! pacman -Syu --noconfirm; then
|| warn "pacman -Syu a partiellement échoué — on continue" # État « sale » (upgrade interrompu = fichiers présents mais non possédés par
# pacman) : la transaction échoue avec « exists in filesystem ». Ces fichiers
# appartiennent AUX paquets à mettre à jour → un --overwrite les réinstalle et
# répare l'état. Sans ça, tous les pacman -U suivants (install depuis
# local-repo) échouent en cascade avec des erreurs hors-sujet.
warn "pacman -Syu a échoué (conflits de fichiers ?) — retry avec --overwrite pour réparer l'état…"
pacman -Syu --noconfirm --overwrite='*' \
|| warn "pacman -Syu a partiellement échoué — on continue"
fi
# ============================================================ # ============================================================
step "1/4 — Outils de build" step "1/4 — Outils de build"
# ============================================================ # ============================================================
pacman -Sy --needed --noconfirm base-devel git # sudo : requis par makepkg -s (syncdeps) quand le build tourne dans un
# conteneur (fwsbuild est non-root ; l'image archlinux n'emporte pas sudo).
# Sur Arch natif / WSL, sudo est déjà présent → --needed ne fait rien.
pacman -Sy --needed --noconfirm base-devel git sudo
# ============================================================ # ============================================================
step "2/4 — Préparation utilisateur de build (non-root pour makepkg)" step "2/4 — Préparation utilisateur de build (non-root pour makepkg)"
@@ -229,6 +251,39 @@ repo_has() {
return 1 return 1
} }
# Installe des .pkg (pacman -U) en tolérant les fichiers RÉSIDUELS NON POSSÉDÉS
# (« <pkg>: <path> exists in filesystem »). Ces fichiers sont des restes d'un
# pacman -Syu interrompu (extraction à moitié faite, DB jamais commitée) : ils
# n'appartiennent à AUCUN paquet et le transaction en cours les réécrit de toute
# façon → on ne supprime QUE les fichiers sans propriétaire (pacman -Qo vide),
# puis on réessaie. Un fichier possédé par un AUTRE paquet reste un vrai conflit
# (on ne le touche pas et le pacman -U finit par échouer proprement).
pacman_ur() {
local i out rc conflicts=() f removed
for i in 1 2 3 4 5 6 7 8; do
if out="$(pacman -U --noconfirm --needed "$@" 2>&1)"; then
return 0
fi
rc=$?
mapfile -t conflicts < <(printf '%s\n' "$out" \
| sed -n 's/^[^:]*: \(.*\) exists in filesystem$/\1/p')
if [ "${#conflicts[@]}" -eq 0 ]; then
printf '%s\n' "$out" >&2
return "$rc"
fi
removed=0
for f in "${conflicts[@]}"; do
if ! pacman -Qo "$f" >/dev/null 2>&1; then
if [ -f "$f" ] || [ -L "$f" ]; then
rm -f "$f" && removed=$((removed + 1))
fi
fi
done
warn "Fichiers résiduels non possédés supprimés : $removed — nouvel essai ($i/8)…"
done
error "pacman -U a échoué après 8 essais (conflits de fichiers non résolus)"
}
# Publie les .pkg d'un build vers local-repo en purgeant d'abord les anciennes # Publie les .pkg d'un build vers local-repo en purgeant d'abord les anciennes
# versions de CE paquet (+ son sous-paquet -debug). Le « -[0-9] » empêche # versions de CE paquet (+ son sous-paquet -debug). Le « -[0-9] » empêche
# « anaconda » d'attraper « anaconda-widgets » / « anaconda-debug ». # « anaconda » d'attraper « anaconda-widgets » / « anaconda-debug ».
@@ -254,8 +309,7 @@ build_or_skip() {
ver="$(pkgbuild_fullver "$d")" ver="$(pkgbuild_fullver "$d")"
if repo_has "$name" "$ver"; then if repo_has "$name" "$ver"; then
success "$name $ver déjà construit → saut (install depuis local-repo)" success "$name $ver déjà construit → saut (install depuis local-repo)"
pacman -U --noconfirm --needed "$LOCAL_REPO/$name-$ver-"*.pkg.tar.* \ pacman_ur "$LOCAL_REPO/$name-$ver-"*.pkg.tar.*
|| error "Install (repo) de $name échouée"
return 0 return 0
fi fi
info "Build $name ${ver:+($ver) }(peut prendre plusieurs minutes)…" info "Build $name ${ver:+($ver) }(peut prendre plusieurs minutes)…"
@@ -277,7 +331,7 @@ build_or_skip() {
| grep -E '\.pkg\.tar\.') | grep -E '\.pkg\.tar\.')
for f in "${pkgfiles[@]}"; do [ -e "$f" ] && existing+=("$f"); done for f in "${pkgfiles[@]}"; do [ -e "$f" ] && existing+=("$f"); done
[ "${#existing[@]}" -gt 0 ] || error "Aucun paquet produit trouvé pour $name" [ "${#existing[@]}" -gt 0 ] || error "Aucun paquet produit trouvé pour $name"
pacman -U --noconfirm "${existing[@]}" || error "Install de $name échouée" pacman_ur "${existing[@]}"
publish_to_repo "$name" "${existing[@]}" publish_to_repo "$name" "${existing[@]}"
success "$name build + install OK" success "$name build + install OK"
} }
@@ -297,6 +351,8 @@ done
# --- PKGBUILD locaux FWS (ordre explicite, feuilles d'abord, anaconda dernier) --- # --- PKGBUILD locaux FWS (ordre explicite, feuilles d'abord, anaconda dernier) ---
LOCAL_PKGBUILDS_DIR="$SCRIPT_DIR/pkgbuilds" LOCAL_PKGBUILDS_DIR="$SCRIPT_DIR/pkgbuilds"
LOCAL_BUILD_ORDER=( LOCAL_BUILD_ORDER=(
fws-pacmanage
fws-dnd
pykickstart python-productmd python-requests-file python-simpleline pykickstart python-productmd python-requests-file python-simpleline
python-crypt_r python-iso639 python-langtable python-meh python-blivet python-crypt_r python-iso639 python-langtable python-meh python-blivet
anaconda-widgets anaconda anaconda-widgets anaconda