Fix loop device mounting

Take away redirects so error messages are
readable, and wait to make sure udev creates
the loopback devices before we try to use them.

Signed-off-by: Simo Leone <simo@archlinux.org>
This commit is contained in:
Simo Leone 2008-11-13 03:49:25 -06:00
parent 7f1a141136
commit 460b0f1edc

View File

@ -12,7 +12,11 @@ _mnt_squashfs()
msg "::: Adding new union branch: ${1}"
/bin/modprobe -q loop >/dev/null 2>&1
mkdir -p "/tmpfs/mnt/loop${LOOP_NUM}"
if ! /bin/losetup "/dev/loop${LOOP_NUM}" ${1} > /dev/null 2>&1; then
# sometimes it takes udev a while to create device nodes
until [ -e "/dev/loop${LOOP_NUM}" ]; do
sleep 1
done
if ! /bin/losetup "/dev/loop${LOOP_NUM}" ${1}; then
echo "ERROR: Cannot mount loop device /dev/loop${LOOP_NUM}"
break
fi