build.sh: stub modprobe in the container; loop autoloads host-side
Some checks failed
image / image (push) Failing after 16s

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jorijn van der Graaf 2026-08-08 19:36:55 +02:00
commit c2c2e90d3a

View file

@ -28,6 +28,13 @@ if [ "$(id -u)" = 0 ]; then
apk add -q git sudo openssl python3 py3-pip multipath-tools util-linux
pip install -q --break-system-packages \
git+https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git@3.11.1
# The container cannot modprobe (no /lib/modules in here), but it doesn't
# need to: the host kernel autoloads the loop driver when losetup opens
# the static /dev/loop-control node. Make pmbootstrap's explicit
# 'sudo modprobe loop' a no-op (/usr/local/sbin precedes /sbin in sudo's
# secure_path).
printf '#!/bin/sh\nexit 0\n' > /usr/local/sbin/modprobe
chmod +x /usr/local/sbin/modprobe
id build >/dev/null 2>&1 || adduser -D build
echo 'build ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/build
rm -rf dist