From 02769190ad2e6e6baeb4253193051e216db666f2 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Mon, 13 Feb 2023 14:48:45 +0100 Subject: [PATCH] tests/as-debootstrap-unshare-wrapper: bind-mount /proc to work around #1031222 --- tests/as-debootstrap-unshare-wrapper | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/as-debootstrap-unshare-wrapper b/tests/as-debootstrap-unshare-wrapper index 030696d..6c88564 100644 --- a/tests/as-debootstrap-unshare-wrapper +++ b/tests/as-debootstrap-unshare-wrapper @@ -35,8 +35,15 @@ if [ -n "$AUTOPROXY" ] && [ -x "$AUTOPROXY" ] && [ -e /tmp/.auto-apt-proxy-0 ]; chmod 644 "$TMP_APT_CONFIG" fi +# debootstrap runs mount -t proc proc /proc which doesn't work in an unshared +# namespace on privileged docker (like salsaci), so mount /proc manually +# https://bugs.debian.org/1031222 +# https://salsa.debian.org/installer-team/debootstrap/-/merge_requests/91 $prefix {{ CMD }} --variant=custom --mode={{ MODE }} \ --setup-hook='env '"${AUTOPROXY:+APT_CONFIG='$TMP_APT_CONFIG'}"' container=lxc debootstrap --variant={{ VARIANT }} unstable "$1" {{ MIRROR }}' \ + --setup-hook='mount -o rbind /proc "$1/proc"' \ + --setup-hook='chroot "$1" dpkg-reconfigure systemd || true' \ + --setup-hook='umount --lazy "$1/proc"' \ - /tmp/debian-mm.tar {{ MIRROR }} if [ -n "$AUTOPROXY" ] && [ -x "$AUTOPROXY" ] && [ -e /tmp/.auto-apt-proxy-0 ]; then rm "$TMP_APT_CONFIG"