build: switch ISO run to rootful podman — rootless can't losetup (host CAP_SYS_ADMIN rejection)
This commit is contained in:
parent
d5c8638de5
commit
4e1ccdbb1a
1 changed files with 15 additions and 4 deletions
|
|
@ -19,12 +19,23 @@ if command -v ksvalidator &>/dev/null; then
|
|||
ksvalidator "$KS"
|
||||
fi
|
||||
|
||||
# ── Build container ──
|
||||
# ── Build container (rootless OK) ──
|
||||
podman build -t veilor-build:latest "$REPO_ROOT/build"
|
||||
|
||||
# ── Build ISO ──
|
||||
# --make-iso requires --privileged (loop devices, mount).
|
||||
podman run --rm --privileged \
|
||||
# ── Build ISO (rootful — losetup + mount need real CAP_SYS_ADMIN) ──
|
||||
# rootless podman can't create loop devices even with --privileged because the
|
||||
# host kernel rejects CAP_SYS_ADMIN from a user namespace.
|
||||
SUDO=""
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
SUDO="sudo"
|
||||
echo "[INFO] Running ISO build under sudo (loop devices require root)"
|
||||
fi
|
||||
|
||||
# Make rootful podman see the rootless-built image
|
||||
$SUDO podman load -i <(podman save veilor-build:latest) 2>/dev/null || \
|
||||
$SUDO podman build -t veilor-build:latest "$REPO_ROOT/build"
|
||||
|
||||
$SUDO podman run --rm --privileged \
|
||||
--security-opt label=disable \
|
||||
-v /dev:/dev \
|
||||
-v "$REPO_ROOT:/work" \
|
||||
|
|
|
|||
Loading…
Reference in a new issue