1 Commits

Author SHA1 Message Date
BlackAngelTV d3cceaffd5 Fix(build): scripte build
[20][DONE]
2026-05-26 16:59:09 +02:00
19 changed files with 118 additions and 178 deletions
-2
View File
@@ -11,7 +11,6 @@ Le projet est construit avec une chaîne `mkarchiso` adaptée pour fonctionner *
- **Base** : Arch Linux (rolling release) - **Base** : Arch Linux (rolling release)
- **Installeur** : Calamares (compilé depuis l'AUR, servi via un repo local pacman) - **Installeur** : Calamares (compilé depuis l'AUR, servi via un repo local pacman)
- **Affichage live** : Xorg + Openbox, lancement automatique de Calamares - **Affichage live** : Xorg + Openbox, lancement automatique de Calamares
- **Bureau installé** : XFCE + LightDM avec autologin du premier compte créé
- **Boot** : BIOS (syslinux) + UEFI (systemd-boot) - **Boot** : BIOS (syslinux) + UEFI (systemd-boot)
- **Compression** : squashfs (xz) - **Compression** : squashfs (xz)
- **Build** : Windows + WSL (Arch) ou directement depuis Arch - **Build** : Windows + WSL (Arch) ou directement depuis Arch
@@ -60,7 +59,6 @@ Les deux scripts détectent automatiquement s'ils sont lancés depuis **Git Bash
3. `xorg-start.service``Xorg :0` 3. `xorg-start.service``Xorg :0`
4. `calamares.service``DISPLAY=:0 calamares` 4. `calamares.service``DISPLAY=:0 calamares`
5. **Fallback** : si les services échouent, `.zprofile` relance Xorg + Openbox + Calamares manuellement 5. **Fallback** : si les services échouent, `.zprofile` relance Xorg + Openbox + Calamares manuellement
6. Après installation, le système démarre sur LightDM puis ouvre automatiquement la session XFCE du compte installé
## Test rapide en QEMU ## Test rapide en QEMU
+28 -12
View File
@@ -82,15 +82,23 @@ 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
echo "==> Lancement de mkarchiso..." echo "==> Lancement de mkarchiso..."
mkdir -p "\$WORK_DIR/out" # Simulation Try/Catch en Bash pour l'écriture du fichier ISO
chmod -f 777 "\$WORK_DIR/out/"FWS-*.iso 2>/dev/null || true TARGET_OUT="\$WORK_DIR/out"
rm -f "\$WORK_DIR/out/"FWS-*.iso 2>/dev/null || true mkdir -p "\$TARGET_OUT" 2>/dev/null || true
mkarchiso -v -w /tmp/fws-build/work -o "\$WORK_DIR/out" /tmp/fws-build/releng
if [ -w "\$TARGET_OUT" ]; then
mkarchiso -v -w /tmp/fws-build/work -o "\$TARGET_OUT" /tmp/fws-build/releng
echo "==> Build terminé ! ISO dans \$TARGET_OUT"
else
echo -e "\e[33m[Attention] Impossible d'écrire dans \$TARGET_OUT. Utilisation d'un dossier temporaire de secours...\e[0m"
BACKUP_OUT="/tmp/fws-out-backup"
mkdir -p "\$BACKUP_OUT"
mkarchiso -v -w /tmp/fws-build/work -o "\$BACKUP_OUT" /tmp/fws-build/releng
echo -e "\e[32m==> Build terminé ! ISO sauvegardée en sécurité dans : \$BACKUP_OUT\e[0m"
fi
echo "==> Nettoyage..." echo "==> Nettoyage..."
rm -rf /tmp/fws-build/work rm -rf /tmp/fws-build/work
echo "==> Build terminé ! ISO dans \$WORK_DIR/out"
EOF EOF
else else
@@ -150,15 +158,23 @@ else
find /tmp/fws-build/releng -type f -exec dos2unix {} + 2>/dev/null find /tmp/fws-build/releng -type f -exec dos2unix {} + 2>/dev/null
echo "==> Lancement de mkarchiso..." echo "==> Lancement de mkarchiso..."
mkdir -p "$WORK_DIR/out" # Simulation Try/Catch en Bash pour l'écriture du fichier ISO
chmod -f 777 "$WORK_DIR/out/"FWS-*.iso 2>/dev/null || true TARGET_OUT="$WORK_DIR/out"
rm -f "$WORK_DIR/out/"FWS-*.iso 2>/dev/null || true mkdir -p "$TARGET_OUT" 2>/dev/null || true
mkarchiso -v -w /tmp/fws-build/work -o "$WORK_DIR/out" /tmp/fws-build/releng
if [ -w "$TARGET_OUT" ]; then
mkarchiso -v -w /tmp/fws-build/work -o "$TARGET_OUT" /tmp/fws-build/releng
echo "==> Build terminé ! ISO dans $TARGET_OUT"
else
echo -e "\e[33m[Attention] Impossible d'écrire dans $TARGET_OUT. Utilisation d'un dossier temporaire de secours...\e[0m"
BACKUP_OUT="/tmp/fws-out-backup"
mkdir -p "$BACKUP_OUT"
mkarchiso -v -w /tmp/fws-build/work -o "$BACKUP_OUT" /tmp/fws-build/releng
echo -e "\e[32m==> Build terminé ! ISO sauvegardée en sécurité dans : $BACKUP_OUT\e[0m"
fi
echo "==> Nettoyage..." echo "==> Nettoyage..."
rm -rf /tmp/fws-build/work rm -rf /tmp/fws-build/work
echo "==> Build terminé ! L'ISO se trouve dans '$WORK_DIR/out'."
fi fi
echo -e "\e[32mScript de build terminé avec succès.\e[0m" echo -e "\e[32mScript de build terminé avec succès.\e[0m"
@@ -1,12 +1,18 @@
--- ---
efiBootLoader: "grub" efiBootLoader: "grub"
kernel: "/vmlinuz-linux"
img: "/initramfs-linux.img"
fallback: "/initramfs-linux-fallback.img"
timeout: "5"
grubInstall: "grub-install" grubInstall: "grub-install"
grubMkconfig: "grub-mkconfig" grubMkconfig: "grub-mkconfig"
grubCfg: "/boot/grub/grub.cfg" grubCfg: "/boot/grub/grub.cfg"
grubProbe: "grub-probe" grubProbe: "grub-probe"
efiBootMgr: "efibootmgr" efiBootMgr: "efibootmgr"
efiDirectory: "/boot/efi"
efiBootloaderId: "FWS" efiBootloaderId: "FWS"
installEFIFallback: true installEFIFallback: true
installHybridGRUB: false
@@ -1,10 +1,13 @@
--- ---
crypttabOptions: luks,keyscript=/bin/cat mountOptions:
default: defaults,noatime
btrfs: defaults,noatime,compress=zstd,space_cache=v2
tmpOptions: ssdExtraMountOptions:
default: ext4: discard
tmpfs: false jfs: discard
options: "" xfs: discard
ssd: swap: discard
tmpfs: true btrfs: discard=async
options: "defaults,noatime,mode=1777"
crypttabOptions: luks,keyscript=/bin/cat
@@ -1,10 +1,19 @@
--- ---
# Calamares 3.3+ : initcpiocfg modifie le mkinitcpio.conf existant # Hooks par défaut Arch + support clavier/LUKS avant block/filesystems.
# au lieu de le réécrire entièrement. modules: []
binaries: []
useSystemdHook: false files: []
hooks: hooks:
prepend: [] - base
append: [] - udev
remove: [] - autodetect
- microcode
- modconf
- kms
- keyboard
- keymap
- consolefont
- block
- filesystems
- fsck
@@ -18,28 +18,8 @@ extraMounts:
- device: /run/udev - device: /run/udev
mountPoint: /run/udev mountPoint: /run/udev
options: [bind] options: [bind]
extraMountsEfi:
- device: efivarfs - device: efivarfs
fs: efivarfs fs: efivarfs
mountPoint: /sys/firmware/efi/efivars mountPoint: /sys/firmware/efi/efivars
efi: true
mountOptions:
- filesystem: default
options: [ defaults, noatime ]
- filesystem: efi
options: [ defaults, umask=0077 ]
- filesystem: ext4
ssdOptions: [ discard ]
- filesystem: xfs
ssdOptions: [ discard ]
- filesystem: btrfs
options: [ defaults, noatime, "compress=zstd:1", "space_cache=v2" ]
ssdOptions: [ discard=async ]
hddOptions: [ autodefrag ]
- filesystem: btrfs_swap
options: [ defaults, noatime ]
- filesystem: f2fs
options: [ defaults, noatime ]
ssdOptions: [ discard ]
- filesystem: swap
ssdOptions: [ discard ]
@@ -1,7 +1,7 @@
--- ---
# Étape post-unpackfs : retire les paquets live-only. # Étape post-unpackfs : on retire les paquets qui ne servent que dans
# Tous les paquets utiles sont déjà dans le squashfs. # l'ISO live (installeur + outils archiso). Les paquets utiles sont déjà
# Pas besoin d'installer quoi que ce soit depuis internet. # présents sur le système cible parce qu'unpackfs a copié tout le live.
backend: pacman backend: pacman
update_db: false update_db: false
@@ -11,4 +11,6 @@ operations:
- remove: - remove:
- calamares - calamares
- kpmcore - kpmcore
- archinstall
- livecd-sounds
- mkinitcpio-archiso - mkinitcpio-archiso
@@ -1,21 +1,15 @@
--- ---
units: services:
- name: "NetworkManager.service" - name: NetworkManager
action: "enable"
mandatory: true mandatory: true
- name: "systemd-resolved.service" - name: systemd-resolved
action: "enable"
mandatory: false
- name: "systemd-timesyncd.service"
action: "enable"
mandatory: false
- name: "lightdm.service"
action: "enable"
mandatory: true mandatory: true
- name: "sshd.service" - name: systemd-timesyncd
action: "enable" mandatory: true
- name: sshd
mandatory: false mandatory: false
targets: []
@@ -1,22 +0,0 @@
---
# Exécuté HORS chroot (live system) pour accéder à l'ISO montée.
# But : restaurer le kernel (retiré du squashfs par mkarchiso) et
# corriger les fichiers mkinitcpio archiso-spécifiques.
dontChroot: true
script:
# Copie le kernel depuis l'ISO vers /boot du système cible
- 'cp "$(find /run/archiso/bootmnt -name vmlinuz-linux 2>/dev/null | head -1)" "${ROOT}/boot/vmlinuz-linux"'
# Configure LightDM pour démarrer automatiquement la session XFCE du premier utilisateur créé.
- 'FIRST_USER="$(awk -F: ''$$3 >= 1000 && $$1 != "nobody" { print $$1; exit }'' "${ROOT}/etc/passwd")"'
- 'if [ -n "$$FIRST_USER" ]; then mkdir -p "${ROOT}/etc/lightdm/lightdm.conf.d"; printf ''[Seat:*]\nautologin-user=%s\nautologin-user-timeout=0\nuser-session=xfce\nautologin-session=xfce\ngreeter-hide-users=true\nallow-guest=false\n'' "$$FIRST_USER" > "${ROOT}/etc/lightdm/lightdm.conf.d/50-fws.conf"; fi'
- 'if [ -n "$$FIRST_USER" ] && [ -d "${ROOT}/home/$$FIRST_USER" ]; then printf ''[Desktop]\nSession=xfce\n'' > "${ROOT}/home/$$FIRST_USER/.dmrc"; fi'
# Supprime le drop-in archiso (surcharge HOOKS avec des hooks inexistants post-install)
- '-rm -f "${ROOT}/etc/mkinitcpio.conf.d/archiso.conf"'
# Remplace le linux.preset archiso par le preset standard (default + fallback)
# \x27 = ' et \x22 = " pour éviter les conflits de quotes dans YAML/bash
- 'printf "PRESETS=(\x27default\x27 \x27fallback\x27)\nALL_kver=\x22/boot/vmlinuz-linux\x22\nALL_config=\x22/etc/mkinitcpio.conf\x22\nALL_microcode=(/boot/*-ucode.img)\ndefault_image=\x22/boot/initramfs-linux.img\x22\nfallback_image=\x22/boot/initramfs-linux-fallback.img\x22\nfallback_options=\x22-S autodetect\x22\n" > "${ROOT}/etc/mkinitcpio.d/linux.preset"'
@@ -12,7 +12,7 @@ defaultGroups:
autologinGroup: autologin autologinGroup: autologin
sudoersGroup: wheel sudoersGroup: wheel
setRootPassword: true setRootPassword: true
doAutologin: true doAutologin: false
userShell: /bin/bash userShell: /bin/bash
passwordRequirements: passwordRequirements:
@@ -22,8 +22,3 @@ passwordRequirements:
allowWeakPasswords: false allowWeakPasswords: false
allowWeakPasswordsDefault: false allowWeakPasswordsDefault: false
hostname:
location: EtcFile
writeHostsFile: true
setSystemdHostname: true
@@ -23,14 +23,14 @@ sequence:
- keyboard - keyboard
- localecfg - localecfg
- users - users
- hostname
- hwclock - hwclock
- networkcfg - networkcfg
- packages
- shellprocess
- initcpiocfg - initcpiocfg
- initcpio - initcpio
- grubcfg - grubcfg
- bootloader - bootloader
- packages
- services-systemd - services-systemd
- umount - umount
- show: - show:
+1 -5
View File
@@ -1,9 +1,5 @@
#!/bin/sh #!/bin/sh
# Lancé par startx (cf. /root/.zprofile), uniquement dans le live FWS. # Lancé par startx (cf. /root/.zprofile)
if [ ! -d /run/archiso ]; then
exit 0
fi
xsetroot -solid "#1a1a2e" xsetroot -solid "#1a1a2e"
openbox & openbox &
sleep 1 sleep 1
+3 -3
View File
@@ -1,5 +1,5 @@
# Démarrage automatique de Xorg + Calamares uniquement dans le live FWS. # Démarrage automatique de Xorg + Calamares sur tty1 (autologin root).
# Sur le système installé, /run/archiso n'existe pas, donc rien ne se lance. # La session X exécute /root/.xinitrc qui lance Openbox + Calamares.
if [[ -d /run/archiso && "$(tty)" == "/dev/tty1" && -z "$DISPLAY" ]]; then if [[ "$(tty)" == "/dev/tty1" && -z "$DISPLAY" ]]; then
exec startx -- vt1 exec startx -- vt1
fi fi
+1 -7
View File
@@ -26,7 +26,6 @@ memtest86+
memtest86+-efi memtest86+-efi
# --- Filesystems --- # --- Filesystems ---
squashfs-tools
btrfs-progs btrfs-progs
e2fsprogs e2fsprogs
exfatprogs exfatprogs
@@ -93,17 +92,12 @@ xorg-xsetroot
openbox openbox
ttf-dejavu ttf-dejavu
# --- Bureau FWS installé ---
xfce4
xfce4-goodies
lightdm
lightdm-gtk-greeter
# --- Calamares (fournis par fws-local) --- # --- Calamares (fournis par fws-local) ---
calamares calamares
kpmcore kpmcore
qt5-base qt5-base
qt5-svg qt5-svg
qt5-webengine
qt6-base qt6-base
# --- Agents VM (pratique pour tester l'ISO) --- # --- Agents VM (pratique pour tester l'ISO) ---
@@ -1,10 +1,24 @@
--- # ============================================================
# Calamares 3.3+ : initcpiocfg modifie le mkinitcpio.conf existant # FWS Linux — modules/initcpiocfg.conf
# au lieu de le réécrire entièrement. # Configure /etc/mkinitcpio.conf sur le système cible
# ============================================================
useSystemdHook: false # Modules à inclure dans le initramfs
modules: []
# Binaires supplémentaires
binaries: []
# Fichiers supplémentaires
files: []
# Hooks — ordre important !
hooks: hooks:
prepend: [] - base
append: [] - udev
remove: [] - autodetect
- modconf
- block
- filesystems
- keyboard
- fsck
@@ -16,10 +16,6 @@ services:
- name: systemd-timesyncd - name: systemd-timesyncd
mandatory: true mandatory: true
# Gestionnaire de session graphique
- name: lightdm
mandatory: true
# Ajoute ici tes services FWS supplémentaires # Ajoute ici tes services FWS supplémentaires
# - name: mon-service-fws # - name: mon-service-fws
# mandatory: false # mandatory: false
@@ -17,7 +17,6 @@ defaultGroups:
# Autoriser le login automatique # Autoriser le login automatique
autologinGroup: autologin autologinGroup: autologin
doAutologin: true
# Sudoers — donne les droits sudo au groupe wheel # Sudoers — donne les droits sudo au groupe wheel
sudoersGroup: wheel sudoersGroup: wheel
+1 -7
View File
@@ -26,7 +26,6 @@ memtest86+
memtest86+-efi memtest86+-efi
# --- Filesystems --- # --- Filesystems ---
squashfs-tools
btrfs-progs btrfs-progs
e2fsprogs e2fsprogs
exfatprogs exfatprogs
@@ -93,17 +92,12 @@ xorg-xsetroot
openbox openbox
ttf-dejavu ttf-dejavu
# --- Bureau FWS installé ---
xfce4
xfce4-goodies
lightdm
lightdm-gtk-greeter
# --- Calamares (fournis par fws-local) --- # --- Calamares (fournis par fws-local) ---
calamares calamares
kpmcore kpmcore
qt5-base qt5-base
qt5-svg qt5-svg
qt5-webengine
qt6-base qt6-base
# --- Agents VM (pratique pour tester l'ISO) --- # --- Agents VM (pratique pour tester l'ISO) ---
+1 -35
View File
@@ -58,41 +58,6 @@ LOCAL_REPO="$SCRIPT_DIR/local-repo"
BUILD_DIR="/tmp/fws-aur-build" BUILD_DIR="/tmp/fws-aur-build"
BUILD_USER="fwsbuild" BUILD_USER="fwsbuild"
# ============================================================
step "0/4 — Préparation pacman (sandbox WSL + keyring)"
# ============================================================
# pacman ≥ 7 utilise landlock pour sandboxer les ops fs.
# Le kernel WSL ne supporte pas landlock → désactivation explicite.
if grep -qi 'microsoft\|wsl' /proc/version 2>/dev/null; then
if ! grep -qE '^[[:space:]]*DisableSandbox' /etc/pacman.conf; then
sed -i '/^\[options\]/a DisableSandbox' /etc/pacman.conf
warn "WSL détecté → DisableSandbox ajouté à /etc/pacman.conf"
fi
fi
# Keyring : sur une WSL Arch ancienne, archlinux-keyring est périmé et
# bloque tout install ("unknown trust"). On bypass SigLevel uniquement
# pour mettre à jour le paquet keyring, puis on rétablit.
info "Refresh du trousseau pacman…"
pacman-key --init 2>/dev/null || true
if [ -f /etc/pacman.conf ] && ! grep -qE '^[[:space:]]*SigLevel[[:space:]]*=[[:space:]]*Never' /etc/pacman.conf; then
cp -f /etc/pacman.conf /etc/pacman.conf.fws.bak
sed -i 's/^SigLevel.*/SigLevel = Never/' /etc/pacman.conf
pacman -Sy --noconfirm --needed archlinux-keyring \
|| warn "Maj archlinux-keyring échouée (sigs bypass) — on continue"
mv -f /etc/pacman.conf.fws.bak /etc/pacman.conf
fi
pacman-key --populate archlinux 2>/dev/null || true
# Maj système complète : indispensable pour gérer les "package splits"
# (ex. gcc-libs → libgcc + libstdc++) sinon makepkg plantera sur
# "conflicting files" lors de l'install des dépendances.
info "Mise à jour complète du système (peut être long la première fois)…"
pacman -Syu --noconfirm \
|| warn "pacman -Syu a partiellement échoué — on continue"
# ============================================================ # ============================================================
step "1/4 — Outils de build" step "1/4 — Outils de build"
# ============================================================ # ============================================================
@@ -151,3 +116,4 @@ echo ""
echo -e "${GREEN}╔══════════════════════════════════════════════════╗${NC}" echo -e "${GREEN}╔══════════════════════════════════════════════════╗${NC}"
echo -e "${GREEN}║ Setup terminé. Lance maintenant : ./build.sh ║${NC}" echo -e "${GREEN}║ Setup terminé. Lance maintenant : ./build.sh ║${NC}"
echo -e "${GREEN}╚══════════════════════════════════════════════════╝${NC}" echo -e "${GREEN}╚══════════════════════════════════════════════════╝${NC}"
bash ./build.sh