feat(build): add podman container support for non-arch linux distributions
Add automatic detection and relaunching of build scripts in an Arch Linux container via podman when running on non-Arch distributions (Fedora, Ubuntu, Debian, etc.). Key changes: - Implement host_is_arch() function to detect if running on Arch Linux by checking both pacman availability and /etc/os-release - When non-Arch host is detected, scripts automatically pull docker.io/library/archlinux:latest and relaunch themselves in rootful podman container with --privileged - Mount repository at same absolute path inside container so WORK_DIR and out/ directories work transparently - Set up persistent pacman cache volume (fws-pacman-cache) between runs - Auto-chown output files back to host user after build completes - Update pacman config to disable landlock sandbox in containers (similar to WSL workaround) - Run full pacman -Syu upgrade in container before installing archiso to avoid partial upgrade issues - Add comprehensive documentation in README about Fedora/non-Arch setup - Update .gitignore to exclude pkgbuilds/ directory - Add environnement.md documentation file
This commit is contained in:
@@ -349,3 +349,32 @@ Réseau : accès archlinux.org (HTTP/2 200), pas de proxy bloquant
|
||||
```
|
||||
|
||||
Si **tout** ce qui précède est aligné, `./setup-aur.sh && ./build.sh` doit produire `out/FWS-*.iso` en 25-55 min au total.
|
||||
|
||||
---
|
||||
|
||||
## 17. Build depuis Fedora / Linux non-Arch (bascule conteneur podman)
|
||||
|
||||
Les trois scripts (`setup-aur.sh`, `build.sh`, `build-offi.sh`) détectent un hôte
|
||||
**non-Arch** et se relancent automatiquement à l'identique dans un conteneur Arch
|
||||
podman. Aucune Arch native ni WSL n'est nécessaire — il suffit d'installer podman.
|
||||
|
||||
```bash
|
||||
sudo dnf install -y podman # Fedora
|
||||
sudo apt install -y podman # Debian / Ubuntu
|
||||
./setup-aur.sh && ./build.sh # exactement comme sur Arch
|
||||
```
|
||||
|
||||
### Design (points à NE PAS « simplifier »)
|
||||
|
||||
| Choix | Pourquoi |
|
||||
|---|---|
|
||||
| **Détection hôte Arch** = `command -v pacman` **ET** `grep -qiE '^ID(_LIKE)?=.*arch' /etc/os-release` | Fedora empaquette aussi `pacman` → sa seule présence ne suffit pas à conclure « hôte Arch ». |
|
||||
| **podman rootful** (`sudo podman`) | mkarchiso exige des mounts/chroot/loop privilégiés ; podman rootless ne les gère pas. |
|
||||
| **`--privileged`** | Donne les capabilities mkarchiso **et** relâche SELinux (enforcing sur Fedora) sur le bind-mount, sans avoir besoin de `:Z` (qui relabellerait le dépôt). |
|
||||
| **`pull` explicite** avant `run` | `run` ne re-résout jamais le tag `latest` une fois l'image en cache → sinon on build sur une image qui vieillit. |
|
||||
| **`pacman -Syu archiso`** (pas `-Sy`) quand `FWS_IN_CONTAINER=1` | Évite le partial upgrade : sur une image de base vieillissante, `-Sy archiso` tire des deps plus récentes que la base installée. |
|
||||
| **`FWS_IN_CONTAINER=1`** | Garde anti-récursion **et** active `DisableSandbox` (landlock) comme le chemin WSL. |
|
||||
| **Dépôt monté au MÊME chemin absolu** + volume `fws-pacman-cache` | `WORK_DIR`, `out/` et `local-repo/` restent identiques côté hôte ; le cache pacman persiste entre les runs. Les artefacts (root, podman rootful) sont re-`chown` vers le propriétaire du dépôt en fin de run. |
|
||||
|
||||
> Validé par revue adversariale sur Fedora 43 (podman 5.8.2, SELinux enforcing).
|
||||
> Image : `docker.io/library/archlinux:latest`.
|
||||
|
||||
Reference in New Issue
Block a user