From a0239ef94b2f75c46558feb1399975f21e370111 Mon Sep 17 00:00:00 2001
From: Alexander Sack <asac@linaro.org>
Date: Fri, 2 Jul 2010 14:24:16 +0200
Subject: Ensure that mtab is properly linked to /proc/mounts in
 binary_virtual-hdd.

---
 helpers/binary_virtual-hdd | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/helpers/binary_virtual-hdd b/helpers/binary_virtual-hdd
index 4e61c6b..aeb701a 100755
--- a/helpers/binary_virtual-hdd
+++ b/helpers/binary_virtual-hdd
@@ -70,6 +70,13 @@ if [ "${LH_BUILD_WITH_CHROOT}" = "true" ]
 then
 	mv binary-virtual.img chroot
 
+	# hack to recreate mtab from chroot_hacks if its gone for some reason
+	if ! Chroot chroot "test -s /etc/mtab"
+	then
+		Chroot chroot "rm -f /etc/mtab"
+		Chroot chroot "ln -s /proc/mounts /etc/mtab"
+	fi
+
 	case "${LH_BINARY_FILESYSTEM}" in
 		ext2)
 			Chroot chroot "mkfs.ext2 -F binary-virtual.img"
-- 
cgit v1.0