From e1b7574fa3fcdd6694a00553a0f0c0b20dc27d02 Mon Sep 17 00:00:00 2001
From: Geoffrey Thomas <geofft@mit.edu>
Date: Sun, 25 Oct 2009 22:05:58 -0400
Subject: [PATCH] Fix /etc/setup.d/00check to permit union chroots on the root filesystem.

It's only unsafe for the chroot directory to be the root directory if
we're not doing a union filesystem on top of it.

Note that to make this useful, you'll need to make the overlay a
separate filesystem (e.g., by mounting a tmpfs on
/var/lib/schroot/union/overlay) for aufs to permit the mount.

Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
---
 etc/setup.d/00check |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/etc/setup.d/00check b/etc/setup.d/00check
index 494d62c..f62f068 100755
--- a/etc/setup.d/00check
+++ b/etc/setup.d/00check
@@ -131,7 +131,8 @@ esac
 # toasted by accident.
 if [ -z "$CHROOT_PATH" ] \
     || [ "$CHROOT_PATH" = "/" ] \
-    || [ "$CHROOT_DIRECTORY" = "/" ] \
+    || ( [ -z "$CHROOT_UNION_TYPE" ] \
+         && [ "$CHROOT_DIRECTORY" = "/" ] ) \
     || [ "$CHROOT_UNION_OVERLAY_DIRECTORY" = "/" ]
 then
     echo "Invalid chroot mount path or directory"
-- 
1.5.6.5

