[Git][qa/jenkins.debian.net][master] schroot-create: use unshare mode
Mattia Rizzolo (@mattia)
gitlab at salsa.debian.org
Mon Apr 6 18:52:02 BST 2026
Mattia Rizzolo pushed to branch master at Debian QA / jenkins.debian.net
Commits:
f646694e by Jochen Sprickerhof at 2026-04-06T19:51:41+02:00
schroot-create: use unshare mode
Hopefully fixes hanging systems on jenkins.d.n and ionos10-amd64.d.n.
The maintainer scripts of console-setup seems to interact badly with the
hardware when run in a simple chroot. Instead this uses the unshare mode
of mmdebstrap so it can't break the hardware.
Signed-off-by: Mattia Rizzolo <mattia at debian.org>
- - - - -
2 changed files:
- bin/schroot-create.sh
- hosts/common/etc/sudoers.d/jenkins
Changes:
=====================================
bin/schroot-create.sh
=====================================
@@ -47,6 +47,7 @@ SUITE="$1"
shift
SCHROOT_TARGET=$(mktemp -d -p "$SCHROOT_BASE"/ "schroot-install-$TARGET-XXXX")
+MMDEBSTRAP_TARGET=$(mktemp -p "$SCHROOT_BASE"/ "schroot-install-$TARGET-XXXX").tar
if [ -z "$SCHROOT_TARGET" ]; then
echo "Could not create a directory to create the chroot in, aborting."
exit 1
@@ -61,6 +62,7 @@ cleanup() {
done
sudo rm -rf --one-file-system "$SCHROOT_TARGET" || ( echo "Warning: $SCHROOT_TARGET could not be fully removed during cleanup." ; ls "$SCHROOT_TARGET" -la )
fi
+ rm -f "$MMDEBSTRAP_TARGET"
rm -f "$TMPLOG"
}
trap cleanup INT TERM EXIT
@@ -141,18 +143,23 @@ bootstrap() {
echo "This node is reported to run in the future, configuring APT to ignore the Release file expiration..."
DEBOOTSTRAP+=(--aptopt='Acquire::Check-Valid-Until "false"')
fi
+ if [ "$1" = "diffoscope" ] ; then
+ DEBOOTSTRAP+=(--include=diffoscope --aptopt='Apt::Install-Recommends "true"')
+ fi
set -x
- sudo -- "${DEBOOTSTRAP[@]}" "$SUITE" "$SCHROOT_TARGET" "$MIRROR" | tee "$TMPLOG"
+ "${DEBOOTSTRAP[@]}" "$SUITE" "$MMDEBSTRAP_TARGET" "$MIRROR" | tee "$TMPLOG"
local rt="${PIPESTATUS[0]}"
if ! "$DEBUG" ; then set +x ; fi
local RESULT
RESULT=$(grep -E "E: (Couldn't download packages|Invalid Release signature)" "$TMPLOG" || true)
if [ -n "$RESULT" ] || [ "$rt" -ne 0 ]; then
echo "$(date -u) - initial bootstrap failed, sleeping 5min before retrying..."
- sudo rm -rf --one-file-system "$SCHROOT_TARGET"
+ sudo rm -rf --one-file-system "$MMDEBSTRAP_TARGET"
sleep 5m
- sudo -- "${DEBOOTSTRAP[@]}" "$SUITE" "$SCHROOT_TARGET" "$MIRROR" || ( echo "$(date -u ) - 2nd bootstrap failed, giving up..." ; exit 1 )
+ "${DEBOOTSTRAP[@]}" "$SUITE" "$MMDEBSTRAP_TARGET" "$MIRROR" || ( echo "$(date -u ) - 2nd bootstrap failed, giving up..." ; exit 1 )
fi
+ sudo tar -C "$SCHROOT_TARGET" -xf "$MMDEBSTRAP_TARGET"
+ rm -f "$MMDEBSTRAP_TARGET"
rm -f "$TMPLOG"
# configure policy-rc.d to not start services
=====================================
hosts/common/etc/sudoers.d/jenkins
=====================================
@@ -17,6 +17,7 @@ jenkins ALL= \
/bin/chmod +x /chroots/*, \
/bin/tar -c --exclude ./sys/\* --exclude ./proc/\* -f /schroots/*, \
/bin/tar --mtime=* --clamp-mtime -C /srv/workspace/* -cf *, \
+ /bin/tar -C /schroots/* -xf /schroots/*, \
/usr/sbin/chroot /schroots/*, \
/usr/sbin/chroot /chroots/*, \
/usr/sbin/chroot /media/*, \
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/f646694e030a7bebc107c6877e40866b46c53633
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/f646694e030a7bebc107c6877e40866b46c53633
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20260406/4368200f/attachment-0001.htm>
More information about the Qa-jenkins-scm
mailing list