#!/bin/sh

set -Ceu
suite="${1}"
sudo rm -rf "${suite}.chroot"
sudo debootstrap --include debootstrap,fakeroot,fakechroot "${suite}" "${suite}.chroot" http://deb.debian.org/debian
sudo chroot "${suite}.chroot" /bin/sh -Ceu -x <<-===
	export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
	adduser --gecos x --disabled-password x
	su - x -c "fakechroot fakeroot debootstrap --variant=fakechroot '${suite}' '/tmp/${suite}'"
	chroot "/tmp/${suite}" /bin/sh
	===
