From 460b0f1edc1596cbd0dc5df5671d227a0fc1b780 Mon Sep 17 00:00:00 2001 From: Simo Leone Date: Thu, 13 Nov 2008 03:49:25 -0600 Subject: 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 --- archiso/hooks/archiso | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index c8b6a1b..d3d8736 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -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 -- cgit v1.2.3-70-g09d2