From bcaf588de57864d68a150e9094c5421ad4531fbc Mon Sep 17 00:00:00 2001
From: Salt <rehashedsalt@cock.li>
Date: Fri, 4 Dec 2020 02:47:08 -0600
Subject: [PATCH] More verbose logging, also maybe don't rbind root over mnt
 pls thanks

---
 gentoostrap.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gentoostrap.sh b/gentoostrap.sh
index 47fe4df..9a8ed5d 100755
--- a/gentoostrap.sh
+++ b/gentoostrap.sh
@@ -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