From 3c5c3ee1b0e0f0ae00344b206d796307d2a582cf Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 19 Aug 2021 22:26:57 +0100 Subject: [PATCH] experiment using schroot itself for install --- mk-deb-chroot | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/mk-deb-chroot b/mk-deb-chroot index 805f18f..d97f96c 100755 --- a/mk-deb-chroot +++ b/mk-deb-chroot @@ -19,8 +19,29 @@ apt install -y debootstrap schroot http://ftp.uk.debian.org/debian echo "$chrootdir" > /opt/chroot/$chrootdir/etc/debian_chroot +# Add chroot config to schroot.conf +cat <>/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 @@ -62,24 +83,3 @@ chgrp $SUDO_USER /home/$SUDO_USER/.bash_profile 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 <>/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' -" - -- 2.30.2