ci(release): fail fast when the runner cannot mount

The org runner executes jobs in an unprivileged container, where mount() is
denied even as root, so mkarchiso died at pacstrap after a couple of minutes.
A tmpfs mount probe in the preflight now reports the missing capability
immediately instead of leaving a raw mount error next to the package setup.
This commit is contained in:
BlackAngelTV committed 2026-12-04 12:38:05 +01:00
1 parent 5f12530d7f
commit d99f489fd8
1 file changed
+13
+13
View File
@@ -75,6 +75,19 @@ jobs:
[ "$(id -u)" -eq 0 ] || sudo -n true 2>/dev/null \
|| { echo "::error::mkarchiso exige root (job root ou sudo sans mot de passe)"; exit 1; }
# mkarchiso bind-mounts /proc and /dev inside the chroot and loops the
# squashfs. In a non-privileged container mount() is denied even as
# root, and the build only dies at pacstrap minutes later: check now.
SUDO=(); [ "$(id -u)" -eq 0 ] || SUDO=(sudo)
MP="$(mktemp -d)"
if "${SUDO[@]}" mount -t tmpfs tmpfs "${MP}" 2>/dev/null; then
"${SUDO[@]}" umount "${MP}" && rmdir "${MP}"
else
rmdir "${MP}" 2>/dev/null || true
echo "::error::le runner refuse mount() : mkarchiso ne peut pas builder dans un conteneur non privilégié (il faut CAP_SYS_ADMIN + accès aux loop devices)."
exit 1
fi
- name: Dépendances de l'hôte (mkarchiso)
if: steps.check.outputs.publish == 'true' || inputs.build_only
run: |