More verbose logging, also maybe don't rbind root over mnt pls thanks

This commit is contained in:
Salt 2020-12-04 02:47:08 -06:00
parent cb8c7537c0
commit bcaf588de5

View File

@ -192,16 +192,18 @@ build-gentoo() {
"${EDITOR:-vim}" "$_optdest/etc/fstab"
# Now we need to pivot into a chroot and finish configuration natively
popd
popd > /dev/null 2>&1
log "Pivoting to container for more setup"
cp "$0" "$_optdest/gentoostrap.sh"
if ! grep -qs "$_optdest/proc " /proc/mounts; then
log "Mounting proc"
mount --types proc /proc "$_optdest/proc"
fi
for dir in sys dev; do
if ! grep -qs "$_optdest/$mount " /proc/mounts; then
mount --rbind /$mount "$_optdest/$mount"
mount --make-rslave "$_optdest/$mount"
log "Mounting $dir"
if ! grep -qs "$_optdest/$dir " /proc/mounts; then
mount --rbind /$dir "$_optdest/$dir"
mount --make-rslave "$_optdest/$dir"
fi
done
chroot "$_optdest" /gentoostrap.sh -c