diff --git a/gentoostrap.sh b/gentoostrap.sh index 84ddee8..47fe4df 100755 --- a/gentoostrap.sh +++ b/gentoostrap.sh @@ -195,11 +195,15 @@ build-gentoo() { popd log "Pivoting to container for more setup" cp "$0" "$_optdest/gentoostrap.sh" - mount --types proc /proc "$_optdest/proc" - mount --rbind /sys "$_optdest/sys" - mount --make-rslave "$_optdest/sys" - mount --rbind /dev "$_optdest/dev" - mount --make-rslave "$_optdest/dev" + if ! grep -qs "$_optdest/proc " /proc/mounts; then + 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" + fi + done chroot "$_optdest" /gentoostrap.sh -c chroot "$_optdest" /gentoostrap.sh -d log "Configuration complete! You should be good to reboot now."