#!/bin/bash

base="/org/chroots"

dists="dapper edgy feisty"
archs="$(dpkg-architecture -qDEB_BUILD_ARCH)"

binds="home org root dev sys proc usr/local/bin dev/pts tmp var/tmp"

for dist in $dists; do
	for arch in $archs; do
		echo "Mounts for $dist-$arch..."
		root="$base/$dist-$arch"

		for bind in $binds; do
			if ! grep -q $root/$bind /proc/mounts; then
				echo "    $root/$bind"
				mount -o bind /$bind $root/$bind
			fi
		done
	done
done
