- "$suite" "$rootdir" "$mirror"
-echo "$tuple" > $rootdir/etc/debian_chroot
-echo "force-unsafe-io" > $rootdir/etc/dpkg/dpkg.cfg.d/force-unsafe-io
+ "$suite" "$rootdir" "$mirror" "$script"
+echo "$tuple" > "$rootdir/etc/debian_chroot"
+echo "force-unsafe-io" > "$rootdir/etc/dpkg/dpkg.cfg.d/force-unsafe-io"
+
+cleanup+=("umount $rootdir/dev")
+case "$(uname -s)" in
+ Linux)
+ ;;
+ GNU/kFreeBSD)
+ mount -t devfs none "$rootdir/dev"
+ ;;
+ *)
+ echo >&2 "Warning: Unexpected uname -s output."
+ ;;
+esac
+