From c50db7a5bfb234192bd960a3f46e8986b5e431aa Mon Sep 17 00:00:00 2001 From: fkDeath Date: Tue, 26 May 2026 15:05:12 +0200 Subject: [PATCH] build(calamares): update calamares configuration and enable networkmanager on live --- build.sh | 12 +- .../etc/calamares/branding/fws/branding.desc | 14 +- .../etc/calamares/modules/bootloader.conf | 32 +- .../etc/calamares/modules/finished.conf | 15 +- .../airootfs/etc/calamares/modules/fstab.conf | 13 + .../etc/calamares/modules/grubcfg.conf | 35 +- .../etc/calamares/modules/hostname.conf | 6 + .../etc/calamares/modules/hwclock.conf | 1 + .../etc/calamares/modules/initcpiocfg.conf | 19 +- .../etc/calamares/modules/keyboard.conf | 23 +- .../etc/calamares/modules/locale.conf | 18 +- .../etc/calamares/modules/localecfg.conf | 1 + .../etc/calamares/modules/machineid.conf | 4 + .../airootfs/etc/calamares/modules/mount.conf | 25 ++ .../etc/calamares/modules/networkcfg.conf | 2 + .../etc/calamares/modules/packages.conf | 58 +-- .../etc/calamares/modules/partition.conf | 46 +-- .../calamares/modules/services-systemd.conf | 18 +- .../etc/calamares/modules/unpackfs.conf | 19 +- .../airootfs/etc/calamares/modules/users.conf | 39 +- .../etc/calamares/modules/welcome.conf | 45 +-- .../airootfs/etc/calamares/settings.conf | 58 ++- .../etc/systemd/network/20-ethernet.network | 11 - .../ipv6-privacy-extensions.conf | 2 - .../etc/systemd/system/calamares.service | 16 - .../cloud-config.service | 1 - .../cloud-final.service | 1 - .../cloud-init-local.service | 1 - .../cloud-init-main.service | 1 - .../cloud-init-network.service | 1 - .../systemd-networkd-wait-online.service | 1 - .../systemd-networkd.socket | 1 - .../wait-for-only-one-interface.conf | 6 - .../etc/systemd/system/xorg-start.service | 14 - configs/baseline/airootfs/root/.xinitrc | 2 + configs/baseline/airootfs/root/.zprofile | 11 +- configs/baseline/packages.x86_64 | 221 +++++------ configs/releng/packages.x86_64 | 221 +++++------ setup-calamares.sh | 372 ++++-------------- 39 files changed, 486 insertions(+), 900 deletions(-) create mode 100644 configs/baseline/airootfs/etc/calamares/modules/fstab.conf create mode 100644 configs/baseline/airootfs/etc/calamares/modules/hostname.conf create mode 100644 configs/baseline/airootfs/etc/calamares/modules/hwclock.conf create mode 100644 configs/baseline/airootfs/etc/calamares/modules/localecfg.conf create mode 100644 configs/baseline/airootfs/etc/calamares/modules/machineid.conf create mode 100644 configs/baseline/airootfs/etc/calamares/modules/mount.conf create mode 100644 configs/baseline/airootfs/etc/calamares/modules/networkcfg.conf delete mode 100644 configs/baseline/airootfs/etc/systemd/network/20-ethernet.network delete mode 100644 configs/baseline/airootfs/etc/systemd/networkd.conf.d/ipv6-privacy-extensions.conf delete mode 100644 configs/baseline/airootfs/etc/systemd/system/calamares.service delete mode 100644 configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-config.service delete mode 100644 configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-final.service delete mode 100644 configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-init-local.service delete mode 100644 configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-init-main.service delete mode 100644 configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-init-network.service delete mode 100644 configs/baseline/airootfs/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service delete mode 100644 configs/baseline/airootfs/etc/systemd/system/sockets.target.wants/systemd-networkd.socket delete mode 100644 configs/baseline/airootfs/etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf delete mode 100644 configs/baseline/airootfs/etc/systemd/system/xorg-start.service diff --git a/build.sh b/build.sh index 34f1997..7eb8525 100644 --- a/build.sh +++ b/build.sh @@ -48,11 +48,16 @@ if [ -d "\$WORK_DIR/configs/baseline" ]; then echo "==> configs/baseline/ fusionné (prioritaire)" fi +echo "==> Activation de NetworkManager.service sur le live (symlink réel WSL)..." +mkdir -p /tmp/fws-build/releng/airootfs/etc/systemd/system/multi-user.target.wants +ln -sf /usr/lib/systemd/system/NetworkManager.service \ + /tmp/fws-build/releng/airootfs/etc/systemd/system/multi-user.target.wants/NetworkManager.service + 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/multi-user.target.wants/ 2>/dev/null || echo " (aucun symlink)" -# Copie le repo local Calamares +# Copie le repo local (calamares + winboat-bin) if ls "\$WORK_DIR/local-repo/"*.pkg.tar.zst &>/dev/null 2>&1; then echo "==> Copie du repo local Calamares..." mkdir -p /tmp/fws-build/local-repo @@ -110,6 +115,11 @@ else echo "==> configs/baseline/ fusionné (prioritaire)" fi + echo "==> Activation de NetworkManager.service sur le live (symlink réel)..." + mkdir -p /tmp/fws-build/releng/airootfs/etc/systemd/system/multi-user.target.wants + ln -sf /usr/lib/systemd/system/NetworkManager.service \ + /tmp/fws-build/releng/airootfs/etc/systemd/system/multi-user.target.wants/NetworkManager.service + 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/multi-user.target.wants/ 2>/dev/null || echo " (aucun symlink)" diff --git a/configs/baseline/airootfs/etc/calamares/branding/fws/branding.desc b/configs/baseline/airootfs/etc/calamares/branding/fws/branding.desc index 9b85604..ce5397a 100644 --- a/configs/baseline/airootfs/etc/calamares/branding/fws/branding.desc +++ b/configs/baseline/airootfs/etc/calamares/branding/fws/branding.desc @@ -5,17 +5,17 @@ componentName: fws strings: - productName: "FWS Linux" + productName: "FWS" shortProductName: "FWS" version: "1.0" shortVersion: "1.0" - versionedName: "FWS Linux 1.0" + versionedName: "FWS 1.0" shortVersionedName: "FWS 1.0" - bootloaderEntryName: "FWS Linux" - productUrl: "https://fws-linux.org" - supportUrl: "https://fws-linux.org/support" - releaseNotesUrl: "https://fws-linux.org/release-notes" - donateUrl: "https://fws-linux.org/donate" + bootloaderEntryName: "FWS" + productUrl: "" + supportUrl: "" + releaseNotesUrl: "" + donateUrl: "" images: productLogo: "logo.png" diff --git a/configs/baseline/airootfs/etc/calamares/modules/bootloader.conf b/configs/baseline/airootfs/etc/calamares/modules/bootloader.conf index b865d38..f6425d1 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/bootloader.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/bootloader.conf @@ -1,22 +1,18 @@ -# ============================================================ -# FWS Linux — modules/bootloader.conf -# ============================================================ +--- +efiBootLoader: "grub" -# Bootloader à utiliser -# Options: grub, systemd-boot, refind -efiBootLoader: "grub" +kernel: "/vmlinuz-linux" +img: "/initramfs-linux.img" +fallback: "/initramfs-linux-fallback.img" +timeout: "5" -# Paramètres GRUB -grubInstall: "grub-install" -grubMkconfig: "grub-mkconfig" -grubCfg: "/boot/grub/grub.cfg" +grubInstall: "grub-install" +grubMkconfig: "grub-mkconfig" +grubCfg: "/boot/grub/grub.cfg" +grubProbe: "grub-probe" +efiBootMgr: "efibootmgr" -# Chemin EFI -efiDirectory: "/boot/efi" +efiDirectory: "/boot/efi" +efiBootloaderId: "FWS" -# ID pour l'entrée EFI -efiBootEntryName: "FWS Linux" - -# Menu GRUB -grubTimeout: 5 -grubQuiet: false +installEFIFallback: true diff --git a/configs/baseline/airootfs/etc/calamares/modules/finished.conf b/configs/baseline/airootfs/etc/calamares/modules/finished.conf index 1f12bf5..f34e952 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/finished.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/finished.conf @@ -1,11 +1,6 @@ -# ============================================================ -# FWS Linux — modules/finished.conf -# ============================================================ +--- +restartNowEnabled: true +restartNowChecked: false +restartNowCommand: "systemctl -i reboot" -# Redémarrer automatiquement après l'installation -restartNowEnabled: true -restartNowChecked: false -restartNowCommand: "systemctl reboot" - -# Message de fin affiché à l'utilisateur -notifyOnFinished: true +notifyOnFinished: true diff --git a/configs/baseline/airootfs/etc/calamares/modules/fstab.conf b/configs/baseline/airootfs/etc/calamares/modules/fstab.conf new file mode 100644 index 0000000..d2d5bcc --- /dev/null +++ b/configs/baseline/airootfs/etc/calamares/modules/fstab.conf @@ -0,0 +1,13 @@ +--- +mountOptions: + default: defaults,noatime + btrfs: defaults,noatime,compress=zstd,space_cache=v2 + +ssdExtraMountOptions: + ext4: discard + jfs: discard + xfs: discard + swap: discard + btrfs: discard=async + +crypttabOptions: luks,keyscript=/bin/cat diff --git a/configs/baseline/airootfs/etc/calamares/modules/grubcfg.conf b/configs/baseline/airootfs/etc/calamares/modules/grubcfg.conf index c56e240..daa44ff 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/grubcfg.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/grubcfg.conf @@ -1,28 +1,13 @@ -# ============================================================ -# FWS Linux — modules/grubcfg.conf -# Paramètres passés à grub-mkconfig -# ============================================================ +--- +overwrite: true -# Nom de l'entrée dans le menu GRUB -defaultEntry: "FWS Linux" +kernel_params: + - "quiet" defaults: - GRUB_ENABLE_CRYPTODISK: true - -# Paramètres kernel supplémentaires -kernel_params: "" - -# Désactiver l'écran splash (mettre false pour debug) -splash: true - -# Thème GRUB (laisse vide pour le thème par défaut) -theme: "" - -# Timeout du menu GRUB (en secondes) -timeout: 5 - -# Activer les entrées des autres OS détectés (os-prober) -enable_osprober: true - -# Écrire /etc/default/grub -writeEtcDefaultGrub: true + GRUB_TIMEOUT: 5 + GRUB_DEFAULT: "saved" + GRUB_DISABLE_SUBMENU: true + GRUB_TERMINAL_OUTPUT: "console" + GRUB_DISABLE_RECOVERY: true + GRUB_DISTRIBUTOR: "FWS" diff --git a/configs/baseline/airootfs/etc/calamares/modules/hostname.conf b/configs/baseline/airootfs/etc/calamares/modules/hostname.conf new file mode 100644 index 0000000..bd0e6c8 --- /dev/null +++ b/configs/baseline/airootfs/etc/calamares/modules/hostname.conf @@ -0,0 +1,6 @@ +--- +location: EtcFile +writeHostsFile: true +setSystemdHostname: EtcFile + +template: "fws-${first}" diff --git a/configs/baseline/airootfs/etc/calamares/modules/hwclock.conf b/configs/baseline/airootfs/etc/calamares/modules/hwclock.conf new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/configs/baseline/airootfs/etc/calamares/modules/hwclock.conf @@ -0,0 +1 @@ +--- diff --git a/configs/baseline/airootfs/etc/calamares/modules/initcpiocfg.conf b/configs/baseline/airootfs/etc/calamares/modules/initcpiocfg.conf index 618dde4..7cf73e4 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/initcpiocfg.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/initcpiocfg.conf @@ -1,24 +1,19 @@ -# ============================================================ -# FWS Linux — modules/initcpiocfg.conf -# Configure /etc/mkinitcpio.conf sur le système cible -# ============================================================ - -# Modules à inclure dans le initramfs +--- +# Hooks par défaut Arch + support clavier/LUKS avant block/filesystems. modules: [] - -# Binaires supplémentaires binaries: [] - -# Fichiers supplémentaires files: [] -# Hooks — ordre important ! hooks: - base - udev - autodetect + - microcode - modconf + - kms + - keyboard + - keymap + - consolefont - block - filesystems - - keyboard - fsck diff --git a/configs/baseline/airootfs/etc/calamares/modules/keyboard.conf b/configs/baseline/airootfs/etc/calamares/modules/keyboard.conf index 3621379..383d022 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/keyboard.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/keyboard.conf @@ -1,17 +1,6 @@ -# ============================================================ -# FWS Linux — modules/keyboard.conf -# ============================================================ - -# Disposition clavier par défaut -xorgConfigFileName: "/etc/X11/xorg.conf.d/00-keyboard.conf" - -# Clavier par défaut -keyboardLayout: "fr" -keyboardVariant: "" -keyboardModel: "pc105" - -# Permettre à l'utilisateur de choisir son clavier -guiTimezone: true - -# Conversions vc (console virtuelle) → X11 -convertedKeymapPath: "/lib/kbd/keymaps/xkb" +--- +xOrgConfFileName: "00-keyboard.conf" +convertedKeymapPath: "/usr/share/X11/xkb/symbols/pc" +keyboardLayout: "fr" +keyboardVariant: "" +keyboardModel: "pc105" diff --git a/configs/baseline/airootfs/etc/calamares/modules/locale.conf b/configs/baseline/airootfs/etc/calamares/modules/locale.conf index e0ff5a6..2a0fa54 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/locale.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/locale.conf @@ -1,18 +1,6 @@ -# ============================================================ -# FWS Linux — modules/locale.conf -# ============================================================ - -# Région/timezone par défaut -region: "Europe" -zone: "Paris" - -# Langue par défaut -locale: "fr_FR.UTF-8" - -# Format des nombres, dates, monnaie -# Laisse vide pour utiliser la même valeur que locale +--- +region: "Europe" +zone: "Paris" localeGenPath: "/etc/locale.gen" - -# Timezone GeoIP (détection auto basée sur l'IP) geoipStyle: "json" geoipUrl: "https://geoip.kde.org/v1/calamares" diff --git a/configs/baseline/airootfs/etc/calamares/modules/localecfg.conf b/configs/baseline/airootfs/etc/calamares/modules/localecfg.conf new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/configs/baseline/airootfs/etc/calamares/modules/localecfg.conf @@ -0,0 +1 @@ +--- diff --git a/configs/baseline/airootfs/etc/calamares/modules/machineid.conf b/configs/baseline/airootfs/etc/calamares/modules/machineid.conf new file mode 100644 index 0000000..8e76ee2 --- /dev/null +++ b/configs/baseline/airootfs/etc/calamares/modules/machineid.conf @@ -0,0 +1,4 @@ +--- +systemd: true +dbus: true +dbus-symlink: true diff --git a/configs/baseline/airootfs/etc/calamares/modules/mount.conf b/configs/baseline/airootfs/etc/calamares/modules/mount.conf new file mode 100644 index 0000000..9e90f1a --- /dev/null +++ b/configs/baseline/airootfs/etc/calamares/modules/mount.conf @@ -0,0 +1,25 @@ +--- +extraMounts: + - device: proc + fs: proc + mountPoint: /proc + - device: sys + fs: sysfs + mountPoint: /sys + - device: /dev + mountPoint: /dev + options: [bind] + - device: /dev/pts + fs: devpts + mountPoint: /dev/pts + - device: tmpfs + fs: tmpfs + mountPoint: /run + - device: /run/udev + mountPoint: /run/udev + options: [bind] + +extraMountsEfi: + - device: efivarfs + fs: efivarfs + mountPoint: /sys/firmware/efi/efivars diff --git a/configs/baseline/airootfs/etc/calamares/modules/networkcfg.conf b/configs/baseline/airootfs/etc/calamares/modules/networkcfg.conf new file mode 100644 index 0000000..156a3b9 --- /dev/null +++ b/configs/baseline/airootfs/etc/calamares/modules/networkcfg.conf @@ -0,0 +1,2 @@ +--- +# Copie /etc/NetworkManager du live vers le système cible (NM gérera le réseau). diff --git a/configs/baseline/airootfs/etc/calamares/modules/packages.conf b/configs/baseline/airootfs/etc/calamares/modules/packages.conf index ea2fc24..b2838c9 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/packages.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/packages.conf @@ -1,54 +1,16 @@ -# ============================================================ -# FWS Linux — modules/packages.conf -# Paquets installés via pacman pendant l'installation -# ============================================================ +--- +# Étape post-unpackfs : on retire les paquets qui ne servent que dans +# l'ISO live (installeur + outils archiso). Les paquets utiles sont déjà +# présents sur le système cible parce qu'unpackfs a copié tout le live. -# Gestionnaire de paquets backend: pacman - -# Ne pas mettre à jour la base de données pacman (déjà dans le live) update_db: false +update_system: false operations: - - install: - # Base système - - base - - base-devel - - linux - - linux-headers - - linux-firmware - - # Bootloader - - grub - - efibootmgr - - os-prober - - mkinitcpio-openswap - - # Réseau - - networkmanager - - network-manager-applet - - wpa_supplicant - - dhcpcd - - # Outils essentiels - - sudo - - nano - - vim - - git - - curl - - wget - - htop - - bash-completion - - # Locale & timezone - - tzdata - - # Optionnel — retire ce qui ne correspond pas à FWS - - pipewire - - pipewire-pulse - - wireplumber - -# Paquets à retirer du système live (pas nécessaires après install) - # - remove: + - remove: - calamares - - calamares-config + - kpmcore + - archinstall + - livecd-sounds + - mkinitcpio-archiso diff --git a/configs/baseline/airootfs/etc/calamares/modules/partition.conf b/configs/baseline/airootfs/etc/calamares/modules/partition.conf index 4ca65dc..4bfe10e 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/partition.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/partition.conf @@ -1,34 +1,22 @@ -# ============================================================ -# FWS Linux — modules/partition.conf -# ============================================================ - -# Backend de partitionnement -backend: kpmcore - -# Autoriser le partitionnement manuel -allowManualPartitioning: true - -# Schéma de partition par défaut (pour install automatique) -# Options: mbr, gpt -defaultPartitionTableType: gpt - -# Swap -# Options: none, small, suspend, file -defaultSwapType: small - -# Taille minimale des partitions en MiB -defaultFileSystemType: "ext4" - -# Partitions EFI (pour UEFI) +--- efiSystemPartition: "/boot/efi" -efiSystemPartitionSize: 300 +efiSystemPartitionSize: 300M +efiSystemPartitionName: EFI -# Point de montage racine -requiredStorage: 20.0 +userSwapChoices: + - none + - small + - suspend + - file -# Systèmes de fichiers proposés à l'utilisateur +drawNestedPartitions: true +alwaysShowPartitionLabels: true + +initialPartitioningChoice: replace +initialSwapChoice: small + +defaultFileSystemType: "ext4" availableFileSystemTypes: ["ext4", "btrfs", "xfs", "f2fs"] -# Chiffrement -# Activer le chiffrement LUKS -allowZfs: true +enableLuksAutomatedPartitioning: true +allowManualPartitioning: true diff --git a/configs/baseline/airootfs/etc/calamares/modules/services-systemd.conf b/configs/baseline/airootfs/etc/calamares/modules/services-systemd.conf index b503478..5fa6530 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/services-systemd.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/services-systemd.conf @@ -1,23 +1,15 @@ -# ============================================================ -# FWS Linux — modules/services-systemd.conf -# Services systemd activés sur le système installé -# ============================================================ - +--- services: - # Réseau - name: NetworkManager mandatory: true - # DHCP - - name: dhcpcd - mandatory: false + - name: systemd-resolved + mandatory: true - # Heure synchronisée - name: systemd-timesyncd mandatory: true - # Ajoute ici tes services FWS supplémentaires - # - name: mon-service-fws - # mandatory: false + - name: sshd + mandatory: false targets: [] diff --git a/configs/baseline/airootfs/etc/calamares/modules/unpackfs.conf b/configs/baseline/airootfs/etc/calamares/modules/unpackfs.conf index e9b0db4..91c348a 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/unpackfs.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/unpackfs.conf @@ -1,16 +1,9 @@ -# ============================================================ -# FWS Linux — modules/unpackfs.conf -# Copie le système live vers le disque cible -# ============================================================ +--- +# Copie le squashfs du live vers le disque cible. +# Le chemin /run/archiso/bootmnt///airootfs.sfs +# doit correspondre à `install_dir` dans configs/releng/profiledef.sh ("fws"). unpack: - # Source : le squashfs de l'ISO FWS - # Adapte "FWS" selon la valeur de iso_name dans profiledef.sh - - source: /run/archiso/bootmnt/FWS/x86_64/airootfs.sfs - sourcefs: squashfs + - source: "/run/archiso/bootmnt/fws/x86_64/airootfs.sfs" + sourcefs: "squashfs" destination: "" - - # Alternative si tu utilises erofs au lieu de squashfs : - # - source: /run/archiso/bootmnt/FWS/x86_64/airootfs.erofs - # sourcefs: erofs - # destination: "" diff --git a/configs/baseline/airootfs/etc/calamares/modules/users.conf b/configs/baseline/airootfs/etc/calamares/modules/users.conf index 4335a59..b320826 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/users.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/users.conf @@ -1,39 +1,24 @@ -# ============================================================ -# FWS Linux — modules/users.conf -# ============================================================ - -# Nom d'hôte par défaut +--- defaultGroups: - - users - - lp + - wheel + - audio - video - network - storage - - wheel - - audio - - optical - - scanner - power + - lp + - scanner -# Autoriser le login automatique autologinGroup: autologin - -# Sudoers — donne les droits sudo au groupe wheel sudoersGroup: wheel - -# Shell par défaut pour les nouveaux utilisateurs +setRootPassword: true +doAutologin: false userShell: /bin/bash -# Hostname par défaut -hostname: - location: EtcFile - template: "fws-${first}" - -# Règles pour les mots de passe passwordRequirements: - minLength: 6 - maxLength: -1 - nonempty: true + minLength: 6 + maxLength: -1 + nonempty: true -# Permet de définir le même mot de passe pour root et user -allowWeakPasswords: false +allowWeakPasswords: false +allowWeakPasswordsDefault: false diff --git a/configs/baseline/airootfs/etc/calamares/modules/welcome.conf b/configs/baseline/airootfs/etc/calamares/modules/welcome.conf index 1bd0dd5..c932491 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/welcome.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/welcome.conf @@ -1,29 +1,20 @@ -# ============================================================ -# FWS Linux — modules/welcome.conf -# ============================================================ +--- +showSupportUrl: true +showKnownIssuesUrl: true +showReleaseNotesUrl: false +showDonateUrl: false -# Afficher les conditions requises avant l'installation -showSupportUrl: true -showKnownIssuesUrl: true -showReleaseNotesUrl: false -showDonateUrl: false - -# Vérifications système requises requirements: - # Espace disque minimum en MiB - requiredStorage: 20.0 - - # RAM minimum en MiB - requiredRam: 2.0 - - # Vérifier la connexion internet (optionnel) - checkInternet: false - - # Vérifier si on tourne en live (pas déjà installé) - checkForRoot: true - - # Vérifier l'alimentation (AC power) - checkPower: true - - # Ne bloque pas l'install si pas connecté - internetCheckUrl: "https://cloudflare.com" + requiredStorage: 8.0 + requiredRam: 1.5 + internetCheckUrl: "https://archlinux.org" + check: + - storage + - ram + - power + - root + - screen + required: + - storage + - ram + - root diff --git a/configs/baseline/airootfs/etc/calamares/settings.conf b/configs/baseline/airootfs/etc/calamares/settings.conf index dbb4754..5643514 100644 --- a/configs/baseline/airootfs/etc/calamares/settings.conf +++ b/configs/baseline/airootfs/etc/calamares/settings.conf @@ -1,21 +1,45 @@ --- -componentName: fws +# ============================================================ +# FWS — Calamares settings +# ============================================================ -strings: - productName: FWS - shortProductName: FWS - version: 2026.03 - versionedName: FWS 2026.03 - bootloaderEntryName: FWS - productUrl: https://github.com/ton-repo/fws - supportUrl: https://github.com/ton-repo/fws/issues - knownIssuesUrl: https://github.com/ton-repo/fws/issues - releaseNotesUrl: https://github.com/ton-repo/fws +modules-search: [ local, /usr/lib/calamares/modules ] -images: - productLogo: logo.png - productIcon: logo.png - productWelcome: logo.png +sequence: + - show: + - welcome + - locale + - keyboard + - partition + - users + - summary + - exec: + - partition + - mount + - unpackfs + - machineid + - fstab + - locale + - keyboard + - localecfg + - users + - hostname + - hwclock + - networkcfg + - initcpiocfg + - initcpio + - grubcfg + - bootloader + - packages + - services-systemd + - umount + - show: + - finished -slideshow: show.qml -slideshowAPI: 2 \ No newline at end of file +branding: fws + +prompt-install: true +dont-chroot: false +oem-setup: false +disable-cancel: false +disable-cancel-during-exec: false diff --git a/configs/baseline/airootfs/etc/systemd/network/20-ethernet.network b/configs/baseline/airootfs/etc/systemd/network/20-ethernet.network deleted file mode 100644 index b87392e..0000000 --- a/configs/baseline/airootfs/etc/systemd/network/20-ethernet.network +++ /dev/null @@ -1,11 +0,0 @@ -[Match] -Type=ether -# Exclude virtual Ethernet interfaces -Kind=!* - -[Link] -RequiredForOnline=routable - -[Network] -DHCP=yes -MulticastDNS=yes diff --git a/configs/baseline/airootfs/etc/systemd/networkd.conf.d/ipv6-privacy-extensions.conf b/configs/baseline/airootfs/etc/systemd/networkd.conf.d/ipv6-privacy-extensions.conf deleted file mode 100644 index 0e9ceb4..0000000 --- a/configs/baseline/airootfs/etc/systemd/networkd.conf.d/ipv6-privacy-extensions.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Network] -IPv6PrivacyExtensions=yes diff --git a/configs/baseline/airootfs/etc/systemd/system/calamares.service b/configs/baseline/airootfs/etc/systemd/system/calamares.service deleted file mode 100644 index 6c074c2..0000000 --- a/configs/baseline/airootfs/etc/systemd/system/calamares.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=Calamares Installer -After=xorg-start.service -Requires=xorg-start.service - -[Service] -Type=simple -User=root -Environment=DISPLAY=:0 -ExecStartPre=/bin/sleep 2 -ExecStart=/usr/bin/calamares -Restart=on-failure -RestartSec=3 - -[Install] -WantedBy=multi-user.target diff --git a/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-config.service b/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-config.service deleted file mode 100644 index ebc50f0..0000000 --- a/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-config.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/cloud-config.service \ No newline at end of file diff --git a/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-final.service b/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-final.service deleted file mode 100644 index 80fa3c8..0000000 --- a/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-final.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/cloud-final.service \ No newline at end of file diff --git a/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-init-local.service b/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-init-local.service deleted file mode 100644 index dd8e9f1..0000000 --- a/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-init-local.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/cloud-init-local.service \ No newline at end of file diff --git a/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-init-main.service b/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-init-main.service deleted file mode 100644 index 875ff73..0000000 --- a/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-init-main.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/cloud-init-main.service \ No newline at end of file diff --git a/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-init-network.service b/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-init-network.service deleted file mode 100644 index ae77734..0000000 --- a/configs/baseline/airootfs/etc/systemd/system/cloud-init.target.wants/cloud-init-network.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/cloud-init-network.service \ No newline at end of file diff --git a/configs/baseline/airootfs/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service b/configs/baseline/airootfs/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service deleted file mode 100644 index 7d6ad92..0000000 --- a/configs/baseline/airootfs/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/systemd-networkd-wait-online.service \ No newline at end of file diff --git a/configs/baseline/airootfs/etc/systemd/system/sockets.target.wants/systemd-networkd.socket b/configs/baseline/airootfs/etc/systemd/system/sockets.target.wants/systemd-networkd.socket deleted file mode 100644 index 51942c8..0000000 --- a/configs/baseline/airootfs/etc/systemd/system/sockets.target.wants/systemd-networkd.socket +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/systemd-networkd.socket \ No newline at end of file diff --git a/configs/baseline/airootfs/etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf b/configs/baseline/airootfs/etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf deleted file mode 100644 index c9f9bce..0000000 --- a/configs/baseline/airootfs/etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Allow systemd-networkd-wait-online to succeed with one interface, otherwise, if multiple network interfaces exist, -# network-online.target gets needlessly delayed. -# See https://wiki.archlinux.org/title/systemd-networkd#systemd-networkd-wait-online -[Service] -ExecStart= -ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --any diff --git a/configs/baseline/airootfs/etc/systemd/system/xorg-start.service b/configs/baseline/airootfs/etc/systemd/system/xorg-start.service deleted file mode 100644 index 2764e06..0000000 --- a/configs/baseline/airootfs/etc/systemd/system/xorg-start.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Xorg Display Server -After=systemd-logind.service -Wants=systemd-logind.service - -[Service] -Type=simple -User=root -ExecStart=/usr/bin/Xorg :0 vt1 -nolisten tcp -Restart=on-failure -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/configs/baseline/airootfs/root/.xinitrc b/configs/baseline/airootfs/root/.xinitrc index 9e35e42..78d4489 100644 --- a/configs/baseline/airootfs/root/.xinitrc +++ b/configs/baseline/airootfs/root/.xinitrc @@ -1,4 +1,6 @@ #!/bin/sh +# Lancé par startx (cf. /root/.zprofile) +xsetroot -solid "#1a1a2e" openbox & sleep 1 exec calamares diff --git a/configs/baseline/airootfs/root/.zprofile b/configs/baseline/airootfs/root/.zprofile index 93bba12..d168f55 100644 --- a/configs/baseline/airootfs/root/.zprofile +++ b/configs/baseline/airootfs/root/.zprofile @@ -1,8 +1,5 @@ -# Fallback si les services systemd n'ont pas démarré Calamares -if [ "$(tty)" = "/dev/tty1" ] && [ -z "$DISPLAY" ]; then - Xorg :0 vt1 & - sleep 2 - DISPLAY=:0 openbox & - sleep 1 - DISPLAY=:0 calamares +# Démarrage automatique de Xorg + Calamares sur tty1 (autologin root). +# La session X exécute /root/.xinitrc qui lance Openbox + Calamares. +if [[ "$(tty)" == "/dev/tty1" && -z "$DISPLAY" ]]; then + exec startx -- vt1 fi diff --git a/configs/baseline/packages.x86_64 b/configs/baseline/packages.x86_64 index 4f6342c..4ab4b45 100644 --- a/configs/baseline/packages.x86_64 +++ b/configs/baseline/packages.x86_64 @@ -1,144 +1,109 @@ -alsa-utils -amd-ucode -arch-install-scripts -archinstall -b43-fwcutter +# ============================================================ +# FWS — paquets de l'ISO live +# Objectif : système live bootable + installeur Calamares +# fonctionnel + jeu minimal d'outils de rescue. +# ============================================================ + +# --- Base système --- base -bcachefs-tools -bind -bolt -brltty -broadcom-wl -btrfs-progs -calamares -clonezilla -cloud-init -cryptsetup -darkhttpd -ddrescue -dhcpcd -diffutils -dmidecode -dmraid -dnsmasq -dosfstools -e2fsprogs -edk2-shell -efibootmgr -espeakup -ethtool -exfatprogs -f2fs-tools -fatresize -foot-terminfo -fsarchiver -gpart -gpm -gptfdisk -grml-zsh-config -grub -hdparm -hyperv -intel-ucode -irssi -iw -iwd -jfsutils -kitty-terminfo -kpmcore -ldns -less -lftp -libfido2 -libusb-compat +base-devel linux -linux-atm linux-firmware -linux-firmware-marvell -livecd-sounds -lsscsi -lvm2 -lynx -man-db -man-pages -mc -mdadm -memtest86+ -memtest86+-efi +amd-ucode +intel-ucode + +# --- initramfs / archiso --- mkinitcpio mkinitcpio-archiso -mkinitcpio-nfs-utils -mmc-utils -modemmanager -mtools -nano -nbd -ndisc6 -fastfetch -nfs-utils -nilfs-utils -nmap + +# --- Boot --- +syslinux +grub +efibootmgr +edk2-shell +os-prober +memtest86+ +memtest86+-efi + +# --- Filesystems --- +btrfs-progs +e2fsprogs +exfatprogs +xfsprogs +f2fs-tools +dosfstools ntfs-3g -nvme-cli -openbox -open-iscsi -open-vm-tools -openconnect -openpgp-card-tools -openssh -openvpn -partclone +cryptsetup +lvm2 +mdadm + +# --- Outils disque --- parted -partimage -pcsclite -ppp -pptpclient -pv -qemu-guest-agent -qt5-base -qt5-svg -qt6-base -refind -reflector -rsync -rxvt-unicode-terminfo -screen -sdparm -sequoia-sq -sg3_utils +gptfdisk +fatresize +testdisk smartmontools -sof-firmware -squashfs-tools +nvme-cli +mmc-utils +hdparm + +# --- Réseau --- +networkmanager +wpa_supplicant +wireless-regdb +openssh +rsync +curl +wget + +# --- Shell / système --- +zsh +grml-zsh-config +bash +nano +vim +less +git sudo polkit polkit-gnome -syslinux -systemd-resolvconf -tcpdump -terminus-font -testdisk -tmux -tpm2-tools -tpm2-tss -ttf-dejavu -udftools -usb_modeswitch -usbmuxd +man-db +man-pages +arch-install-scripts +reflector +pacman-contrib + +# --- Hardware --- +dmidecode usbutils -vim -virtualbox-guest-utils-nox -vpnc -winboat-bin -wireless-regdb -wireless_tools -wpa_supplicant -wvdial -xdg-utils -xfsprogs -xl2tpd +pciutils +fastfetch +htop + +# --- Audio (slideshow, optionnel) --- +alsa-utils +sof-firmware + +# --- Xorg + Openbox (pour Calamares) --- xorg-server xorg-xinit xorg-xrandr -zsh xorg-xsetroot -xorg-xsetroot \ No newline at end of file +openbox +ttf-dejavu + +# --- Calamares (fournis par fws-local) --- +calamares +kpmcore +qt5-base +qt5-svg +qt5-webengine +qt6-base + +# --- Agents VM (pratique pour tester l'ISO) --- +qemu-guest-agent +virtualbox-guest-utils-nox +open-vm-tools + +# --- FWS (fws-local) --- +winboat-bin diff --git a/configs/releng/packages.x86_64 b/configs/releng/packages.x86_64 index 4f6342c..4ab4b45 100644 --- a/configs/releng/packages.x86_64 +++ b/configs/releng/packages.x86_64 @@ -1,144 +1,109 @@ -alsa-utils -amd-ucode -arch-install-scripts -archinstall -b43-fwcutter +# ============================================================ +# FWS — paquets de l'ISO live +# Objectif : système live bootable + installeur Calamares +# fonctionnel + jeu minimal d'outils de rescue. +# ============================================================ + +# --- Base système --- base -bcachefs-tools -bind -bolt -brltty -broadcom-wl -btrfs-progs -calamares -clonezilla -cloud-init -cryptsetup -darkhttpd -ddrescue -dhcpcd -diffutils -dmidecode -dmraid -dnsmasq -dosfstools -e2fsprogs -edk2-shell -efibootmgr -espeakup -ethtool -exfatprogs -f2fs-tools -fatresize -foot-terminfo -fsarchiver -gpart -gpm -gptfdisk -grml-zsh-config -grub -hdparm -hyperv -intel-ucode -irssi -iw -iwd -jfsutils -kitty-terminfo -kpmcore -ldns -less -lftp -libfido2 -libusb-compat +base-devel linux -linux-atm linux-firmware -linux-firmware-marvell -livecd-sounds -lsscsi -lvm2 -lynx -man-db -man-pages -mc -mdadm -memtest86+ -memtest86+-efi +amd-ucode +intel-ucode + +# --- initramfs / archiso --- mkinitcpio mkinitcpio-archiso -mkinitcpio-nfs-utils -mmc-utils -modemmanager -mtools -nano -nbd -ndisc6 -fastfetch -nfs-utils -nilfs-utils -nmap + +# --- Boot --- +syslinux +grub +efibootmgr +edk2-shell +os-prober +memtest86+ +memtest86+-efi + +# --- Filesystems --- +btrfs-progs +e2fsprogs +exfatprogs +xfsprogs +f2fs-tools +dosfstools ntfs-3g -nvme-cli -openbox -open-iscsi -open-vm-tools -openconnect -openpgp-card-tools -openssh -openvpn -partclone +cryptsetup +lvm2 +mdadm + +# --- Outils disque --- parted -partimage -pcsclite -ppp -pptpclient -pv -qemu-guest-agent -qt5-base -qt5-svg -qt6-base -refind -reflector -rsync -rxvt-unicode-terminfo -screen -sdparm -sequoia-sq -sg3_utils +gptfdisk +fatresize +testdisk smartmontools -sof-firmware -squashfs-tools +nvme-cli +mmc-utils +hdparm + +# --- Réseau --- +networkmanager +wpa_supplicant +wireless-regdb +openssh +rsync +curl +wget + +# --- Shell / système --- +zsh +grml-zsh-config +bash +nano +vim +less +git sudo polkit polkit-gnome -syslinux -systemd-resolvconf -tcpdump -terminus-font -testdisk -tmux -tpm2-tools -tpm2-tss -ttf-dejavu -udftools -usb_modeswitch -usbmuxd +man-db +man-pages +arch-install-scripts +reflector +pacman-contrib + +# --- Hardware --- +dmidecode usbutils -vim -virtualbox-guest-utils-nox -vpnc -winboat-bin -wireless-regdb -wireless_tools -wpa_supplicant -wvdial -xdg-utils -xfsprogs -xl2tpd +pciutils +fastfetch +htop + +# --- Audio (slideshow, optionnel) --- +alsa-utils +sof-firmware + +# --- Xorg + Openbox (pour Calamares) --- xorg-server xorg-xinit xorg-xrandr -zsh xorg-xsetroot -xorg-xsetroot \ No newline at end of file +openbox +ttf-dejavu + +# --- Calamares (fournis par fws-local) --- +calamares +kpmcore +qt5-base +qt5-svg +qt5-webengine +qt6-base + +# --- Agents VM (pratique pour tester l'ISO) --- +qemu-guest-agent +virtualbox-guest-utils-nox +open-vm-tools + +# --- FWS (fws-local) --- +winboat-bin diff --git a/setup-calamares.sh b/setup-calamares.sh index 19ef155..b1b9415 100644 --- a/setup-calamares.sh +++ b/setup-calamares.sh @@ -1,350 +1,118 @@ #!/bin/bash # ============================================================ -# FWS — Setup Calamares + Xorg autostart -# v4 — Version stable avec toutes les corrections +# FWS — Build des paquets AUR (calamares + winboat-bin) +# et création du repo pacman local fws-local/. +# +# Rejoue-le si tu changes la liste AUR_PACKAGES ou pour +# rafraîchir le repo local. # ============================================================ - set -e -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -CYAN='\033[0;36m' -NC='\033[0m' +AUR_PACKAGES=(calamares winboat-bin) +DISTRO_NAME="${ARCH_WSL_DISTRO:-Arch}" +RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m' +BLUE='\033[0;34m'; CYAN='\033[0;36m'; NC='\033[0m' info() { echo -e "${BLUE}==>${NC} $1"; } success() { echo -e "${GREEN}[OK]${NC} $1"; } warn() { echo -e "${YELLOW}[!!]${NC} $1"; } error() { echo -e "${RED}[ERR]${NC} $1"; exit 1; } -step() { echo -e "\n${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"; \ - echo -e "${CYAN} $1${NC}"; \ +step() { echo -e "\n${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" + echo -e "${CYAN} $1${NC}" echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"; } # ============================================================ -# DÉTECTION Git Bash / WSL +# Bascule Git Bash → WSL si besoin # ============================================================ -IS_GITBASH=false if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || -n "$WINDIR" ]]; then - IS_GITBASH=true -fi - -if $IS_GITBASH; then - info "Git Bash détecté — Recherche de la distro Arch dans WSL..." + info "Git Bash détecté — bascule dans WSL ($DISTRO_NAME)..." export MSYS_NO_PATHCONV=1 export MSYS2_ARG_CONV_EXCL="*" - ARCH_DISTRO="" - for name in "Arch" "ArchLinux" "archlinux" "arch" "ArchWSL"; do - if wsl.exe -d "$name" -u root -- echo "ok" > /dev/null 2>&1; then - ARCH_DISTRO="$name"; break - fi - done - - if [ -z "$ARCH_DISTRO" ]; then - warn "Détection automatique impossible." - read -r -p "Nom de ta distro Arch WSL > " ARCH_DISTRO - ARCH_DISTRO=$(echo "$ARCH_DISTRO" | tr -d '\r\n') + if ! wsl.exe -d "$DISTRO_NAME" -u root -- echo ok >/dev/null 2>&1; then + # Auto-détection + for name in "Arch" "ArchLinux" "archlinux" "arch" "ArchWSL"; do + if wsl.exe -d "$name" -u root -- echo ok >/dev/null 2>&1; then + DISTRO_NAME="$name"; break + fi + done fi - success "Distro : '$ARCH_DISTRO'" - SCRIPT_DIR_WIN="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -W)" - SCRIPT_PATH_WSL=$(MSYS_NO_PATHCONV=1 wsl.exe -d "$ARCH_DISTRO" -u root -- \ + SCRIPT_PATH_WSL=$(MSYS_NO_PATHCONV=1 wsl.exe -d "$DISTRO_NAME" -u root -- \ wslpath "$(echo "$SCRIPT_DIR_WIN" | sed 's|/|\\\\|g')/setup-calamares.sh" \ 2>/dev/null | tr -d '\r\n') - - info "Lancement dans WSL ($ARCH_DISTRO) en root..." - MSYS_NO_PATHCONV=1 wsl.exe -d "$ARCH_DISTRO" -u root -- bash "$SCRIPT_PATH_WSL" + MSYS_NO_PATHCONV=1 wsl.exe -d "$DISTRO_NAME" -u root -- bash "$SCRIPT_PATH_WSL" exit 0 fi # ============================================================ -# VÉRIFICATIONS +# Vérifications # ============================================================ -if ! command -v pacman &>/dev/null; then error "Pas dans Arch WSL !"; fi -if [ "$EUID" -ne 0 ]; then exec su -c "bash $0" root; fi -success "Arch Linux WSL — root ✓" +command -v pacman >/dev/null || error "pacman introuvable (lance depuis Arch / WSL)" +[ "$EUID" -eq 0 ] || exec su -c "bash $0" root +success "Arch Linux (root) ✓" -# ─── Détection des chemins du projet ──────────────────────── SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" LOCAL_REPO="$SCRIPT_DIR/local-repo" BUILD_DIR="/tmp/fws-aur-build" +BUILD_USER="fwsbuild" -PACMAN_CONF="" -for c in "$SCRIPT_DIR/releng/pacman.conf" \ - "$SCRIPT_DIR/configs/baseline/pacman.conf" \ - "$SCRIPT_DIR/configs/releng/pacman.conf" \ - "$SCRIPT_DIR/pacman.conf"; do - [ -f "$c" ] && { PACMAN_CONF="$c"; success "pacman.conf : $c"; break; } +# ============================================================ +step "1/4 — Outils de build" +# ============================================================ +pacman -Sy --needed --noconfirm base-devel git + +# ============================================================ +step "2/4 — Préparation utilisateur de build (non-root pour makepkg)" +# ============================================================ +rm -rf "$BUILD_DIR" +mkdir -p "$BUILD_DIR" + +if ! id "$BUILD_USER" &>/dev/null; then + useradd -m "$BUILD_USER" + echo "$BUILD_USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/fwsbuild + chmod 440 /etc/sudoers.d/fwsbuild + success "Utilisateur $BUILD_USER créé" +fi +chown -R "$BUILD_USER:$BUILD_USER" "$BUILD_DIR" + +# ============================================================ +step "3/4 — Build des paquets AUR : ${AUR_PACKAGES[*]}" +# ============================================================ +for pkg in "${AUR_PACKAGES[@]}"; do + info "Clonage $pkg…" + su - "$BUILD_USER" -c "git clone https://aur.archlinux.org/${pkg}.git $BUILD_DIR/$pkg" \ + || error "Clonage $pkg échoué" + + info "Build $pkg (peut prendre plusieurs minutes)…" + su - "$BUILD_USER" -c "cd $BUILD_DIR/$pkg && makepkg -s --noconfirm" \ + || error "Build $pkg échoué" + success "$pkg build OK" done -[ -z "$PACMAN_CONF" ] && error "pacman.conf introuvable !" - -PACKAGES_FILE="" -for c in "$SCRIPT_DIR/releng/packages.x86_64" \ - "$SCRIPT_DIR/configs/baseline/packages.x86_64" \ - "$SCRIPT_DIR/configs/releng/packages.x86_64" \ - "$SCRIPT_DIR/packages.x86_64"; do - [ -f "$c" ] && { PACKAGES_FILE="$c"; success "packages.x86_64 : $c"; break; } -done -[ -z "$PACKAGES_FILE" ] && error "packages.x86_64 introuvable !" - -AIROOTFS="" -for c in "$SCRIPT_DIR/airootfs" \ - "$SCRIPT_DIR/configs/baseline/airootfs" \ - "$SCRIPT_DIR/releng/airootfs"; do - [ -d "$c" ] && { AIROOTFS="$c"; success "airootfs : $c"; break; } -done -[ -z "$AIROOTFS" ] && error "airootfs introuvable !" # ============================================================ -step "ÉTAPE 1 — Outils de build" +step "4/4 — Création du repo pacman local fws-local" # ============================================================ -pacman -S --needed --noconfirm base-devel git || error "Échec install outils" -success "base-devel + git OK" - -# ============================================================ -step "ÉTAPE 2 — Rebuild Calamares depuis l'AUR" -# ============================================================ -warn "Suppression ancien build et repo local..." -rm -rf "$BUILD_DIR" "$LOCAL_REPO" +rm -rf "$LOCAL_REPO" mkdir -p "$LOCAL_REPO" -if ! id "fwsbuild" &>/dev/null; then - useradd -m fwsbuild - echo "fwsbuild ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers - success "Utilisateur fwsbuild créé" -fi +for pkg in "${AUR_PACKAGES[@]}"; do + cp "$BUILD_DIR/$pkg"/*.pkg.tar.zst "$LOCAL_REPO/" \ + || error "Paquet $pkg introuvable dans $BUILD_DIR/$pkg" +done -mkdir -p "$BUILD_DIR" -chown fwsbuild:fwsbuild "$BUILD_DIR" - -info "Clonage de calamares depuis l'AUR..." -su - fwsbuild -c \ - "git clone https://aur.archlinux.org/calamares.git $BUILD_DIR/calamares" \ - || error "Clonage échoué" - -info "Build de Calamares (plusieurs minutes)..." -su - fwsbuild -c \ - "cd $BUILD_DIR/calamares && makepkg -s --noconfirm" \ - || error "Build échoué" -success "Calamares buildé ✓" - -# ============================================================ -step "ÉTAPE 3 — Création du repo local pacman" -# ============================================================ -cp "$BUILD_DIR/calamares"/calamares-[0-9]*.pkg.tar.zst "$LOCAL_REPO/" \ - || error "Paquet introuvable" -repo-add "$LOCAL_REPO/fws-local.db.tar.gz" \ - "$LOCAL_REPO"/calamares-[0-9]*.pkg.tar.zst \ - || error "repo-add échoué" +repo-add "$LOCAL_REPO/fws-local.db.tar.gz" "$LOCAL_REPO"/*.pkg.tar.zst \ + || error "repo-add a échoué" success "Repo local prêt : $LOCAL_REPO" # ============================================================ -step "ÉTAPE 4 — Nettoyage packages.x86_64" +# Nettoyage utilisateur de build # ============================================================ -# Supprime les paquets invalides/AUR -for pkg in "mkinitcpio-openswap" "qt5-webengine" \ - "calamares-configs" "zshcalamares" "xorg-init"; do - if grep -q "^${pkg}$" "$PACKAGES_FILE"; then - sed -i "/^${pkg}$/d" "$PACKAGES_FILE" - warn "Supprimé (invalide) : $pkg" - fi -done +userdel -r "$BUILD_USER" 2>/dev/null || true +rm -f /etc/sudoers.d/fwsbuild -# Ajoute les paquets requis -for pkg in "calamares" \ - "xorg-server" "xorg-xinit" "xorg-xrandr" "xorg-xsetroot" \ - "openbox" "ttf-dejavu" \ - "qt5-base" "qt5-svg" \ - "kpmcore" "polkit" "polkit-gnome"; do - if ! grep -q "^${pkg}$" "$PACKAGES_FILE"; then - echo "$pkg" >> "$PACKAGES_FILE" - success "Ajouté : $pkg" - else - info "Déjà présent : $pkg" - fi -done - -# ============================================================ -step "ÉTAPE 5 — Patch pacman.conf" -# ============================================================ -# Supprime [community] obsolète -if grep -q "\[community\]" "$PACMAN_CONF"; then - sed -i '/^\[community\]/,/^Include.*mirrorlist/d' "$PACMAN_CONF" - warn "[community] supprimé" -fi - -# Supprime l'ancien bloc fws-local et le réécrit proprement -sed -i '/^\[fws-local\]/,/^$/d' "$PACMAN_CONF" -PACMAN_TMP=$(mktemp) -printf '[fws-local]\nSigLevel = Optional TrustAll\nServer = file://%s\n\n' \ - "$LOCAL_REPO" > "$PACMAN_TMP" -cat "$PACMAN_CONF" >> "$PACMAN_TMP" -mv "$PACMAN_TMP" "$PACMAN_CONF" -success "[fws-local] ajouté → $LOCAL_REPO" - -# ============================================================ -step "ÉTAPE 6 — Config airootfs (services + Calamares)" -# ============================================================ - -# ─── Nettoyage des anciens fichiers ───────────────────────── -rm -f "$AIROOTFS/etc/systemd/system/calamares-autostart.service" -rm -f "$AIROOTFS/etc/systemd/system/multi-user.target.wants/calamares-autostart.service" -rm -f "$AIROOTFS/etc/systemd/system/getty@tty1.service.d/calamares.conf" -rmdir "$AIROOTFS/etc/systemd/system/getty@tty1.service.d" 2>/dev/null || true - -# ─── Autologin root sur tty1 ──────────────────────────────── -info "Autologin root sur tty1..." -mkdir -p "$AIROOTFS/etc/systemd/system/getty@tty1.service.d" -cat > "$AIROOTFS/etc/systemd/system/getty@tty1.service.d/autologin.conf" << 'EOF' -[Service] -ExecStart= -ExecStart=-/sbin/agetty --autologin root --noclear %I $TERM -EOF -success "Autologin configuré" - -# ─── Service xorg-start ────────────────────────────────────── -info "Service xorg-start.service..." -mkdir -p "$AIROOTFS/etc/systemd/system" -cat > "$AIROOTFS/etc/systemd/system/xorg-start.service" << 'EOF' -[Unit] -Description=Xorg Display Server -After=systemd-logind.service -Wants=systemd-logind.service - -[Service] -Type=simple -User=root -ExecStart=/usr/bin/Xorg :0 vt1 -nolisten tcp -Restart=on-failure -RestartSec=2 - -[Install] -WantedBy=multi-user.target -EOF - -mkdir -p "$AIROOTFS/etc/systemd/system/multi-user.target.wants" -ln -sf /etc/systemd/system/xorg-start.service \ - "$AIROOTFS/etc/systemd/system/multi-user.target.wants/xorg-start.service" -success "xorg-start.service activé" - -# ─── Service calamares ─────────────────────────────────────── -info "Service calamares.service..." -cat > "$AIROOTFS/etc/systemd/system/calamares.service" << 'EOF' -[Unit] -Description=Calamares Installer -After=xorg-start.service -Requires=xorg-start.service - -[Service] -Type=simple -User=root -Environment=DISPLAY=:0 -ExecStartPre=/bin/sleep 2 -ExecStart=/usr/bin/calamares -Restart=on-failure -RestartSec=3 - -[Install] -WantedBy=multi-user.target -EOF - -ln -sf /etc/systemd/system/calamares.service \ - "$AIROOTFS/etc/systemd/system/multi-user.target.wants/calamares.service" -success "calamares.service activé" - -# ─── .zprofile fallback ────────────────────────────────────── -info "Création .zprofile (fallback)..." -mkdir -p "$AIROOTFS/root" -cat > "$AIROOTFS/root/.zprofile" << 'EOF' -# Fallback si les services systemd n'ont pas démarré Calamares -if [ "$(tty)" = "/dev/tty1" ] && [ -z "$DISPLAY" ]; then - Xorg :0 vt1 & - sleep 2 - DISPLAY=:0 openbox & - sleep 1 - DISPLAY=:0 calamares -fi -EOF -success ".zprofile fallback créé" - -# ─── settings.conf Calamares ───────────────────────────────── -info "settings.conf Calamares..." -mkdir -p "$AIROOTFS/etc/calamares/modules" -cat > "$AIROOTFS/etc/calamares/settings.conf" << 'EOF' ---- -modules-search: [ local, /usr/lib/calamares/modules ] - -sequence: - - show: - - welcome - - locale - - keyboard - - partition - - users - - summary - - exec: - - partition - - mount - - unpackfs - - fstab - - locale - - keyboard - - localecfg - - users - - initcpio - - bootloader - - services-systemd - - umount - - show: - - finished - -branding: default -prompt-install: false -dont-chroot: false -EOF -success "settings.conf créé" - -# ─── Vérification finale ───────────────────────────────────── -echo "" -info "Vérification des fichiers créés..." -for f in \ - "$AIROOTFS/etc/systemd/system/xorg-start.service" \ - "$AIROOTFS/etc/systemd/system/calamares.service" \ - "$AIROOTFS/etc/systemd/system/multi-user.target.wants/xorg-start.service" \ - "$AIROOTFS/etc/systemd/system/multi-user.target.wants/calamares.service" \ - "$AIROOTFS/etc/systemd/system/getty@tty1.service.d/autologin.conf" \ - "$AIROOTFS/root/.zprofile" \ - "$AIROOTFS/etc/calamares/settings.conf" -do - if [ -e "$f" ]; then - success "$(basename $f)" - else - warn "MANQUANT : $f" - fi -done - -# ============================================================ -step "NETTOYAGE" -# ============================================================ -userdel -r fwsbuild 2>/dev/null || true -sed -i '/fwsbuild ALL=(ALL) NOPASSWD: ALL/d' /etc/sudoers -success "Utilisateur fwsbuild supprimé" - -# ============================================================ echo "" echo -e "${GREEN}╔══════════════════════════════════════════════════╗${NC}" -echo -e "${GREEN}║ ✅ Setup terminé ! Lance maintenant : ║${NC}" -echo -e "${GREEN}║ ./build.sh ║${NC}" +echo -e "${GREEN}║ Setup terminé. Lance maintenant : ./build.sh ║${NC}" echo -e "${GREEN}╚══════════════════════════════════════════════════╝${NC}" -echo "" -echo -e " ${CYAN}Séquence de boot de l'ISO :${NC}" -echo -e " 1. Boot ISO FWS" -echo -e " 2. systemd → xorg-start.service → Xorg :0 démarre" -echo -e " 3. systemd → calamares.service → DISPLAY=:0 calamares" -echo -e " 4. Calamares s'ouvre automatiquement ✓" -echo -e "" -echo -e " ${CYAN}Si service échoue → fallback :${NC}" -echo -e " autologin root tty1 → .zprofile → Xorg + Calamares" -echo ""