From 3949b1c825e5262d0d3eb3b6ddd76f0449f684e0 Mon Sep 17 00:00:00 2001
From: Andreas Loibl <andreas@andreas-loibl.de>
Date: Wed, 28 Sep 2011 00:52:46 +0200
Subject: using linux32 for 32bit chroot in 64bit host

---
 build_gfxoverlay.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/build_gfxoverlay.sh b/build_gfxoverlay.sh
index ef332b7..b9b0d78 100755
--- a/build_gfxoverlay.sh
+++ b/build_gfxoverlay.sh
@@ -68,7 +68,12 @@ eof
 cat usr/local/bin/install-$drv-debian.sh >> overlay.sh
 sed -i '/exit 3/d' overlay.sh
 chmod +x overlay.sh
-chroot . /overlay.sh -v $ver -z
+if [ "$(uname -m)" = "x86_64" ] && ! file bin/true | grep -q 'ELF 64-bit'; then
+	echo "Found 32bit chroot, using linux32..."
+	chroot . linux32 /overlay.sh -v $ver -z
+else
+	chroot . /overlay.sh -v $ver -z
+fi
 cd ..
 umount root/proc root/sys root/dev root &>/dev/null
 rm -rf root
-- 
cgit v1.0