From: Luke Kenneth Casson Leighton Date: Thu, 19 Aug 2021 21:26:57 +0000 (+0100) Subject: experiment using schroot itself for install X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3c5c3ee1b0e0f0ae00344b206d796307d2a582cf;p=dev-env-setup.git experiment using schroot itself for install --- 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' -" -