http://ftp.uk.debian.org/debian
echo "$chrootdir" > /opt/chroot/$chrootdir/etc/debian_chroot
+# Add chroot config to schroot.conf
+cat <<EOF >>/etc/schroot/schroot.conf
+[$chrootdir]
+description=Debian Buster for $chrootdir
+directory=/opt/chroot/$chrootdir
+groups=sbuild-security,$SUDO_USER,users
+type=directory
+EOF
+
+echo "Adding the following $chrootdir section to /etc/schroot/schroot.conf:
+
+[$chrootdir]
+description=Debian Buster for $chrootdir
+directory=/opt/chroot/$chrootdir
+groups=sbuild-security,$SUDO_USER,users
+type=directory
+
+This enables you to chroot into $chrootdir as an unprivileged user by running
+'schroot -c $chrootdir /bin/bash'
+"
+
# Install apt dependencies in the chroot
-chroot /opt/chroot/$chrootdir /bin/bash << EOF
+schroot -c $chrootdir /bin/bash << EOF
echo Installing necessary apt dependencies in the chroot
apt-get update -y
apt-get upgrade -y
echo -e "Added 'export PATH=/usr/lib/ccache:\"\044PATH\"\nexport DISPLAY=:0.0' to /home/$SUDO_USER/.bash_profile to speed up rebuilds"
EOF
-# Add chroot config to schroot.conf
-cat <<EOF >>/etc/schroot/schroot.conf
-[$chrootdir]
-description=Debian Buster for $chrootdir
-directory=/opt/chroot/$chrootdir
-groups=sbuild-security,$SUDO_USER,users
-type=directory
-EOF
-
-echo "Adding the following $chrootdir section to /etc/schroot/schroot.conf:
-
-[$chrootdir]
-description=Debian Buster for $chrootdir
-directory=/opt/chroot/$chrootdir
-groups=sbuild-security,$SUDO_USER,users
-type=directory
-
-This enables you to chroot into $chrootdir as an unprivileged user by running
-'schroot -c $chrootdir /bin/bash'
-"
-