diff --git a/build.sh b/build.sh index 7eb8525..3da7f37 100644 --- a/build.sh +++ b/build.sh @@ -83,6 +83,8 @@ find /tmp/fws-build/releng -type f -exec dos2unix {} + 2>/dev/null echo "==> Lancement de mkarchiso..." mkdir -p "\$WORK_DIR/out" +chmod -f 777 "\$WORK_DIR/out/"FWS-*.iso 2>/dev/null || true +rm -f "\$WORK_DIR/out/"FWS-*.iso 2>/dev/null || true mkarchiso -v -w /tmp/fws-build/work -o "\$WORK_DIR/out" /tmp/fws-build/releng echo "==> Nettoyage..." @@ -149,6 +151,8 @@ else echo "==> Lancement de mkarchiso..." mkdir -p "$WORK_DIR/out" + chmod -f 777 "$WORK_DIR/out/"FWS-*.iso 2>/dev/null || true + rm -f "$WORK_DIR/out/"FWS-*.iso 2>/dev/null || true mkarchiso -v -w /tmp/fws-build/work -o "$WORK_DIR/out" /tmp/fws-build/releng echo "==> Nettoyage..." diff --git a/configs/baseline/airootfs/etc/calamares/modules/bootloader.conf b/configs/baseline/airootfs/etc/calamares/modules/bootloader.conf index f6425d1..1114344 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/bootloader.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/bootloader.conf @@ -1,18 +1,12 @@ --- -efiBootLoader: "grub" +efiBootLoader: "grub" -kernel: "/vmlinuz-linux" -img: "/initramfs-linux.img" -fallback: "/initramfs-linux-fallback.img" -timeout: "5" - -grubInstall: "grub-install" -grubMkconfig: "grub-mkconfig" -grubCfg: "/boot/grub/grub.cfg" -grubProbe: "grub-probe" -efiBootMgr: "efibootmgr" - -efiDirectory: "/boot/efi" -efiBootloaderId: "FWS" +grubInstall: "grub-install" +grubMkconfig: "grub-mkconfig" +grubCfg: "/boot/grub/grub.cfg" +grubProbe: "grub-probe" +efiBootMgr: "efibootmgr" +efiBootloaderId: "FWS" installEFIFallback: true +installHybridGRUB: false diff --git a/configs/baseline/airootfs/etc/calamares/modules/fstab.conf b/configs/baseline/airootfs/etc/calamares/modules/fstab.conf index d2d5bcc..d98f3eb 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/fstab.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/fstab.conf @@ -1,13 +1,10 @@ --- -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 + +tmpOptions: + default: + tmpfs: false + options: "" + ssd: + tmpfs: true + options: "defaults,noatime,mode=1777" diff --git a/configs/baseline/airootfs/etc/calamares/modules/initcpiocfg.conf b/configs/baseline/airootfs/etc/calamares/modules/initcpiocfg.conf index 7cf73e4..61c7191 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/initcpiocfg.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/initcpiocfg.conf @@ -1,19 +1,10 @@ --- -# Hooks par défaut Arch + support clavier/LUKS avant block/filesystems. -modules: [] -binaries: [] -files: [] +# Calamares 3.3+ : initcpiocfg modifie le mkinitcpio.conf existant +# au lieu de le réécrire entièrement. + +useSystemdHook: false hooks: - - base - - udev - - autodetect - - microcode - - modconf - - kms - - keyboard - - keymap - - consolefont - - block - - filesystems - - fsck + prepend: [] + append: [] + remove: [] diff --git a/configs/baseline/airootfs/etc/calamares/modules/mount.conf b/configs/baseline/airootfs/etc/calamares/modules/mount.conf index 9e90f1a..7fd6cdc 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/mount.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/mount.conf @@ -8,7 +8,7 @@ extraMounts: mountPoint: /sys - device: /dev mountPoint: /dev - options: [bind] + options: [ bind ] - device: /dev/pts fs: devpts mountPoint: /dev/pts @@ -17,9 +17,29 @@ extraMounts: mountPoint: /run - device: /run/udev mountPoint: /run/udev - options: [bind] - -extraMountsEfi: + options: [ bind ] - device: efivarfs fs: efivarfs 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 ] diff --git a/configs/baseline/airootfs/etc/calamares/modules/packages.conf b/configs/baseline/airootfs/etc/calamares/modules/packages.conf index b2838c9..8aefcd2 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/packages.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/packages.conf @@ -1,7 +1,7 @@ --- -# É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. +# Étape post-unpackfs : retire les paquets live-only. +# Tous les paquets utiles sont déjà dans le squashfs. +# Pas besoin d'installer quoi que ce soit depuis internet. backend: pacman update_db: false @@ -11,6 +11,4 @@ operations: - remove: - calamares - kpmcore - - archinstall - - livecd-sounds - mkinitcpio-archiso diff --git a/configs/baseline/airootfs/etc/calamares/modules/services-systemd.conf b/configs/baseline/airootfs/etc/calamares/modules/services-systemd.conf index 5fa6530..491c59c 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/services-systemd.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/services-systemd.conf @@ -1,15 +1,17 @@ --- -services: - - name: NetworkManager +units: + - name: "NetworkManager.service" + action: "enable" mandatory: true - - name: systemd-resolved - mandatory: true - - - name: systemd-timesyncd - mandatory: true - - - name: sshd + - name: "systemd-resolved.service" + action: "enable" mandatory: false -targets: [] + - name: "systemd-timesyncd.service" + action: "enable" + mandatory: false + + - name: "sshd.service" + action: "enable" + mandatory: false diff --git a/configs/baseline/airootfs/etc/calamares/modules/shellprocess.conf b/configs/baseline/airootfs/etc/calamares/modules/shellprocess.conf new file mode 100644 index 0000000..9339f8d --- /dev/null +++ b/configs/baseline/airootfs/etc/calamares/modules/shellprocess.conf @@ -0,0 +1,17 @@ +--- +# 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"' + + # 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"' diff --git a/configs/baseline/airootfs/etc/calamares/modules/users.conf b/configs/baseline/airootfs/etc/calamares/modules/users.conf index b320826..ba9edb0 100644 --- a/configs/baseline/airootfs/etc/calamares/modules/users.conf +++ b/configs/baseline/airootfs/etc/calamares/modules/users.conf @@ -22,3 +22,8 @@ passwordRequirements: allowWeakPasswords: false allowWeakPasswordsDefault: false + +hostname: + location: EtcFile + writeHostsFile: true + setSystemdHostname: true diff --git a/configs/baseline/airootfs/etc/calamares/settings.conf b/configs/baseline/airootfs/etc/calamares/settings.conf index 5643514..5cbeae7 100644 --- a/configs/baseline/airootfs/etc/calamares/settings.conf +++ b/configs/baseline/airootfs/etc/calamares/settings.conf @@ -23,14 +23,14 @@ sequence: - keyboard - localecfg - users - - hostname - hwclock - networkcfg + - packages + - shellprocess - initcpiocfg - initcpio - grubcfg - bootloader - - packages - services-systemd - umount - show: diff --git a/configs/baseline/packages.x86_64 b/configs/baseline/packages.x86_64 index 4ab4b45..6e993a2 100644 --- a/configs/baseline/packages.x86_64 +++ b/configs/baseline/packages.x86_64 @@ -26,6 +26,7 @@ memtest86+ memtest86+-efi # --- Filesystems --- +squashfs-tools btrfs-progs e2fsprogs exfatprogs @@ -97,7 +98,6 @@ calamares kpmcore qt5-base qt5-svg -qt5-webengine qt6-base # --- Agents VM (pratique pour tester l'ISO) --- diff --git a/configs/releng/airootfs/etc/calamares/modules/initcpiocfg.conf b/configs/releng/airootfs/etc/calamares/modules/initcpiocfg.conf index 618dde4..61c7191 100644 --- a/configs/releng/airootfs/etc/calamares/modules/initcpiocfg.conf +++ b/configs/releng/airootfs/etc/calamares/modules/initcpiocfg.conf @@ -1,24 +1,10 @@ -# ============================================================ -# FWS Linux — modules/initcpiocfg.conf -# Configure /etc/mkinitcpio.conf sur le système cible -# ============================================================ +--- +# Calamares 3.3+ : initcpiocfg modifie le mkinitcpio.conf existant +# au lieu de le réécrire entièrement. -# Modules à inclure dans le initramfs -modules: [] +useSystemdHook: false -# Binaires supplémentaires -binaries: [] - -# Fichiers supplémentaires -files: [] - -# Hooks — ordre important ! hooks: - - base - - udev - - autodetect - - modconf - - block - - filesystems - - keyboard - - fsck + prepend: [] + append: [] + remove: [] diff --git a/configs/releng/packages.x86_64 b/configs/releng/packages.x86_64 index 4ab4b45..6e993a2 100644 --- a/configs/releng/packages.x86_64 +++ b/configs/releng/packages.x86_64 @@ -26,6 +26,7 @@ memtest86+ memtest86+-efi # --- Filesystems --- +squashfs-tools btrfs-progs e2fsprogs exfatprogs @@ -97,7 +98,6 @@ calamares kpmcore qt5-base qt5-svg -qt5-webengine qt6-base # --- Agents VM (pratique pour tester l'ISO) --- diff --git a/setup-calamares.sh b/setup-calamares.sh index b1b9415..1429195 100644 --- a/setup-calamares.sh +++ b/setup-calamares.sh @@ -58,6 +58,41 @@ LOCAL_REPO="$SCRIPT_DIR/local-repo" BUILD_DIR="/tmp/fws-aur-build" 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" # ============================================================