From: Luke Kenneth Casson Leighton Date: Thu, 19 Aug 2021 21:54:14 +0000 (+0100) Subject: coriolis2 chroot use different fstab non-bind-mount X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b960a8d51967ee3141f0893582a1194902dcca14;p=dev-env-setup.git coriolis2 chroot use different fstab non-bind-mount use schroot instead of chroot --- diff --git a/coriolis2-chroot b/coriolis2-chroot index 779cfaa..066c94a 100755 --- a/coriolis2-chroot +++ b/coriolis2-chroot @@ -11,8 +11,45 @@ apt install -y debootstrap schroot /usr/sbin/debootstrap buster /opt/chroot/coriolis \ http://ftp.uk.debian.org/debian echo "coriolis2" > /opt/chroot/coriolis/etc/debian_chroot +# make coriolis2 profile +mkdir -p /etc/schroot/coriolis2 +cp /etc/schroot/default/* /etc/schroot/coriolis2 + +# create special fstab not bind-mounting /home +cat </etc/schroot/coriolis2/fstab +# +/proc /proc none rw,bind 0 0 +/sys /sys none rw,bind 0 0 +/dev /dev none rw,bind 0 0 +/dev/pts /dev/pts none rw,bind 0 0 +/tmp /tmp none rw,bind 0 0 +EOF + +# Add coriolis config to schroot.conf +cat <>/etc/schroot/schroot.conf +[coriolis] +description=Debian Buster for Coriolis +directory=/opt/chroot/coriolis +groups=sbuild-security,$SUDO_USER,users +type=directory +profile=coriolis2 +EOF + +echo "Adding the following coriolis section to /etc/schroot/schroot.conf: + +[coriolis] +description=Debian Buster for Coriolis +directory=/opt/chroot/coriolis +groups=sbuild-security,$SUDO_USER,users +type=directory +profile=coriolis2 + +This enables you to chroot into coriolis as an unprivileged user by running +'schroot -c coriolis /bin/bash' +" + # Install apt dependencies in the chroot -chroot /opt/chroot/coriolis /bin/bash << EOF +schroot -c coriolis /bin/bash << EOF echo Installing necessary apt dependencies in the chroot apt-get update -y apt-get upgrade -y @@ -50,27 +87,6 @@ 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 coriolis config to schroot.conf -cat <>/etc/schroot/schroot.conf -[coriolis] -description=Debian Buster for Coriolis -directory=/opt/chroot/coriolis -groups=sbuild-security,$SUDO_USER,users -type=directory -EOF - -echo "Adding the following coriolis section to /etc/schroot/schroot.conf: - -[coriolis] -description=Debian Buster for Coriolis -directory=/opt/chroot/coriolis -groups=sbuild-security,$SUDO_USER,users -type=directory - -This enables you to chroot into coriolis as an unprivileged user by running -'schroot -c coriolis /bin/bash' -" - # Build and install yosys from source # note that a specific version of yosys is needed for ls180 at the moment chroot /opt/chroot/coriolis /bin/bash << EOF